Python: Difference between revisions
Jump to navigation
Jump to search
m (→Tips) |
m (→Tips) |
||
Line 28: | Line 28: | ||
== Tips == | == Tips == | ||
* equivalent of the C ternary operator bool?restrue:resfalse | * equivalent of the C ternary operator ?: (''bool'' ? ''restrue'' : ''resfalse''), use a tuple | ||
<source lang="py"> | <source lang="py"> | ||
(resfalse,restrue)[bool] | (resfalse,restrue)[bool] |
Revision as of 17:19, 23 November 2011
documentation
- Official website
- Dive into Python
- euroscipy (scientific python community)
- Getting started with scipy
- Python comme langage scientifique
- Python et le C
Libraries
- iPython
- Standard Library
- SciPy - NumPy
- Matplotlib
- SymPy
- Cython
- PyTables
- Modular toolkit for Data Processing
Miscellaneous
- Fernando Perez page on Python
- Interfacing C++ and Python
- Fitting data with python
- 3D Scientific Data Visualization and Plotting
Tips
- equivalent of the C ternary operator ?: (bool ? restrue : resfalse), use a tuple
<source lang="py"> (resfalse,restrue)[bool] </source>
- adding a path to a directory containing your module files
<source lang="py"> import sys sys.path += [ "/home/username/bin/Python" ] </source>
- test whether a string has only digits or letters
<source lang="py"> str = '1321' str.isdigit() # returns True/False str.isalpha() # returns True/False </source>