This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
ways-to-run-python [2017/09/15 08:49] zoza [OSX] |
ways-to-run-python [2017/10/18 09:57] zoza |
||
---|---|---|---|
Line 13: | Line 13: | ||
* **conda** is a package and environment management system for Python, R, Node.js, Java and other application stacks. It creates an environment (-n name) using a specified python version | * **conda** is a package and environment management system for Python, R, Node.js, Java and other application stacks. It creates an environment (-n name) using a specified python version | ||
<code>conda create -n myenv python=3.4</code> | <code>conda create -n myenv python=3.4</code> | ||
+ | On managing (python) environments with conda: https://conda.io/docs/user-guide/tasks/manage-environments.html | ||
* **virualenv** is a python module installed using | * **virualenv** is a python module installed using | ||
Line 18: | Line 19: | ||
<code>virtualenv --python python3 env | <code>virtualenv --python python3 env | ||
source env/bin/activate</code> | source env/bin/activate</code> | ||
+ | some instructions: http://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv | ||
+ | |||
+ | * **docker** | ||
+ | <code> | ||
+ | docker run -it -p 8888:8888 -p 6006:6006 -v sharedfolder:/root/sharedfolder floydhub/dl-docker:cpu bash | ||
+ | root@4aa86b7ed9d6:~# jypiter notebook | ||
+ | bash: jypiter: command not found | ||
+ | root@4aa86b7ed9d6:~# jupyter notebook | ||
+ | </code> | ||
+ | |||
+ | ====== ipython goodies ====== | ||
+ | |||
+ | run any shell command starting with % | ||
+ | |||
+ | for example, list files by size, or move a file to another location: | ||
+ | <code python>%ls -lhS | ||
+ | %mv a_file.extension newlocation/ </code> | ||
+ | |||
+ | load in an external .py file: | ||
+ | |||
+ | <code python> | ||
+ | %load file_name.py | ||
+ | </code> | ||
+ | |||
+ | and call any function defined in it. | ||
+ | |||
+ | ====== pygame ====== | ||
+ | |||
+ | |||
+ | get key from a user input as pygame.event | ||
+ | http://content.gpwiki.org/index.php/Python:Pygame_keyboard_input |