Skip to main content

Home/ Python Programming/ Group items tagged IT

Rss Feed Group items tagged

reckoner reckoner

Pygments - Python syntax highlighter - 0 views

  • This is the home of Pygments. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are:
reckoner reckoner

geopy - Geocoding Toolbox for Python - 0 views

  • Description geopy makes it easy for developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other sources of data, such as wikis. Development Status Under development since September 2006. Latest release: 0.93. License geopy is open source software released under the MIT license. Contact Questions, comments, and bug reports are welcome at exogen@gmail.com, the geopy mailing list, and on brian's blog.
reckoner reckoner

pyobfuscate - 0 views

  • pyobfuscate is a source code obfuscator: It makes Python source code hard to read for humans, while still being executable for the Python interpreter. For more information, see the README.
reckoner reckoner

PyX - Python graphics package - 0 views

  •  
    PyX is a Python package for the creation of PostScript and PDF files. It combines an abstraction of the PostScript drawing model with a TeX/LaTeX interface. Complex tasks like 2d and 3d plots in publication-ready quality are built out of these primitives.
reckoner reckoner

Debugging in Python - 0 views

  • So here is my own personal gentle introduction to using pdb. It assumes that you are not using any IDE -- that you're coding Python with a text editor and running your Python programs from the command line.
reckoner reckoner

Python Idioms and Efficiency Suggestions - 0 views

  • What idioms should I use to make my code easier to read? Read "The Python Cookbook", especially the first few chapters. It's a great source of well-written Python code examples.
  • Use function factories to create utility functions. Often, especially if you're using map and filter a lot, you need utility functions that convert other functions or methods to taking a single parameter. In particular, you often want to bind some data to the function once, and then apply it repeatedly to different objects. In the above example, we needed a function that multiplied a particular field of an object by 3, but what we really want is a factory that's able to return for any field name and amount a multiplier function in that family:
  • Use zip and dict to map fields to names. zip turns a pair of sequences into a list of tuples containing the first, second, etc. values from each sequence. For example, zip('abc', [1,2,3]) == [('a',1),('b',2),('c',3)]. You can use this to save a lot of typing when you have fields in a known order that you want to map to names:
  •  
    suggestions for better programming style.
reckoner reckoner

sympy - Google Code - 0 views

  •  
    SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and d
reckoner reckoner

Python Cookbook : Read tabular data from Excel spreadsheets the fast and easy way - 0 views

  • Sometimes you get an Excel spreadsheet (say, from the marketing departement) and you want to read tabular data from it (i.e. a line with column headers and lines of data). There are many ways to do this (including ODBC + mxODBC), but the easiest way I've found is this one : provide a file name and a sheet name, and read the data !
Jac Londe

Eli Bendersky's website » Python metaclasses by example - 12 views

    • Mauro De Giorgi
       
      Start read from here
  • Study and understand this example and you’ll grasp most of what one needs to know about writing metaclasses.
  • To control the creation and initialization of the class in the metaclass, you can implement the metaclass’s __new__ method and/or __init__ constructor [6]. Most real-life metaclasses will probably override just one of them. __new__ should be implemented when you want to control the creation of a new object (class in our case), and __init__ should be implemented when you want to control the initialization of the new object after it has been created.
  • ...3 more annotations...
  • It’s important to note here that these print-outs are actually done at class creation time, i.e. when the module containing the class is being imported for the first time. Keep this detail in mind for later.
  • So when the call to MyMeta is done above, what happens under the hood is this:
  • Python metaclasses by example
« First ‹ Previous 101 - 109 of 109
Showing 20 items per page