User Tools

Site Tools


ways-to-run-python

This is an old revision of the document!



Warning: Declaration of syntax_plugin_wrap_div::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 14

Warning: Declaration of syntax_plugin_wrap_div::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 14

Warning: Declaration of syntax_plugin_wrap_closesection::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 0

Warning: Declaration of syntax_plugin_wrap_closesection::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 0

Warning: Declaration of syntax_plugin_wrap_span::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 0

Warning: Declaration of syntax_plugin_wrap_span::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 0

Warning: Declaration of syntax_plugin_gallery::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 0

Warning: Declaration of syntax_plugin_gallery::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 0

Warning: Declaration of syntax_plugin_vshare::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 0

Warning: Declaration of syntax_plugin_vshare::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 0

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3444 in /var/www/kucjica/emperors-wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== Ways to run Python ====== ===== OSX ===== * **default configuration** (python2.7): <code>/usr/bin/python </code> is normally going to run python2.7, linked like this /usr/bin/python2.7@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 when using this native version of python, some dependences might run into permission problems and thus installing modules via pip requires an extra flag "--user" which installs it only for the current users * **pyhton3**: osx comes with python3 installed, which can be called with <code>$ python3 </code> * **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> On managing (python) environments with conda: https://conda.io/docs/user-guide/tasks/manage-environments.html * **virualenv** is a python module installed using <code>pip install --user virtualenv</code> <code>virtualenv --python python3 env 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

ways-to-run-python.1508320673.txt.gz · Last modified: 2017/10/18 09:57 by zoza