other:python:starting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
other:python:starting [2019/04/26 11:57] – Improved the quick start section jypeter | other:python:starting [2019/05/17 10:56] – [Initialization] Improved jypeter | ||
---|---|---|---|
Line 35: | Line 35: | ||
- Start a terminal on an //obelix// server | - Start a terminal on an //obelix// server | ||
- | - Type '' | + | - Type '' |
+ | - ...or follow the steps below to use the more complete //CDAT// distribution.\\ Remember that **you can exit the interpreter by typing CTRL-D** (or '' | ||
- Determine if you are using a [[other: | - Determine if you are using a [[other: | ||
* In a //bash// shell: '' | * In a //bash// shell: '' | ||
Line 41: | Line 42: | ||
- Choose which //flavor// of Python you want by typing: | - Choose which //flavor// of Python you want by typing: | ||
* Python 2.7.x: '' | * Python 2.7.x: '' | ||
- | * Python | + | * Python |
- Type '' | - Type '' | ||
+ | - Note: if you will have to use python regularly, you should add the '' | ||
+ | * **Do not** add the '' | ||
==== Useful keyboard shortcuts ==== | ==== Useful keyboard shortcuts ==== | ||
Line 268: | Line 271: | ||
Note: Anaconda provides and uses '' | Note: Anaconda provides and uses '' | ||
- | ===== Launching Python | + | ===== ipython |
- | + | ||
- | Once you have initialized the [[# | + | |
- | + | ||
- | Remember that on Linux/Mac you can check which python you are using by typing '' | + | |
- | + | ||
- | ==== Useful keyboard shortcuts ==== | + | |
- | + | ||
- | ^ Key ^ Effect | + | |
- | | **CTRL-D** | + | |
- | | **↑ and ↓** | Go to previous/ | + | |
- | | **CTRL-A** | + | |
- | | **CTRL-E** | + | |
- | | **CTRL-K** | + | |
- | | **CTRL-U** | + | |
- | | **TAB** x 2 | Do some TAB-completion (context dependent)\\ e.g. '' | + | |
- | | **CTRL-C** | + | |
- | | **CTRL-Z** | + | |
- | + | ||
- | ==== Stand-alone script ==== | + | |
- | + | ||
- | A python script is just like any other shell script. You don't have to explicitly call the python interpreter, | + | |
- | + | ||
- | < | + | |
- | jypeter@asterix1 - ...jypeter - 54 >cat basic_script.py | + | |
- | # | + | |
- | + | ||
- | import sys | + | |
- | + | ||
- | script_name = sys.argv[0] | + | |
- | + | ||
- | print(' | + | |
- | + | ||
- | # The end | + | |
- | + | ||
- | jypeter@asterix1 - ...jypeter - 55 >chmod +x basic_script.py | + | |
- | + | ||
- | ypeter@asterix1 - ...jypeter - 56 ># Type here what is required to initialize the distribution you want | + | |
- | + | ||
- | jypeter@asterix1 - ...jypeter - 57 > | + | |
- | Hello world, I am the ./ | + | |
- | </ | + | |
- | + | ||
- | ==== Standard interpreter ==== | + | |
- | + | ||
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | Type '' | + | |
==== ipython interpreter ==== | ==== ipython interpreter ==== |
other/python/starting.txt · Last modified: 2025/07/03 16:18 by jypeter