Programowanie w systemie UNIX/Python: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Nie podano opisu zmian
Linia 1:
 
 
=Instalacja=
 
* [[Zanurkuj w Pythonie/Python w systemach Linux|Opis ]]
* jak skonfigurować Ubuntu do pracy w Pythonie<ref>[http://openbookproject.net/thinkcs/python/english3e/app_c.html Configuring Ubuntu for Python Development]</ref>
Linia 9 ⟶ 6:
 
== Ręczne wprowadzanie poleceń ==
W konsoli wpisujemy :
 
python
 
Otrzymujemy :
 
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
Linia 19 ⟶ 16:
Type "help", "copyright", "credits" or "license" for more information.
 
i pojawia się znak :
 
>>>
Linia 29 ⟶ 26:
== Plik z poleceniami Pythona==
 
Plik tekstowy <code>a.py</code> z kodem w Pythonie ( rozszerzenie py) uruchamiamy za pomocą komendy :
 
python a.py
Linia 35 ⟶ 32:
==Skrypt z poleceniami Pythona ==
 
Możemy utworzyć skrypt bashu :<ref>[http://www.linuxjournal.com/article/3946 Python Programming for Beginners May 01, 2000 By Jacek Artymiak ]</ref>
 
<source lang="bash">
#! /usr/local/bin/python
import sys
if '-h' in sys.argv or '--help' in sys.argv or '--help' in sys.argv:
print '''
help.py--does nothing useful (yet)
options: -h, -help, or --help-display this help
Copyright (c) Jacek Artymiak, 2000 '''
sys.exit(0)
else:
print '"I don't recognize this option'"
sys.exit(0)
</source>
 
zapisać go jako <code>help.py</code>
 
nadać mu prawo wykonywalności :
chmod 0700 help.py
 
i uruchomić go z konsoli :
 
./help.py -h
Linia 69 ⟶ 68:
==scipy==
 
Instalacja : <ref>[http://stackoverflow.com/questions/24808043/importerror-no-module-named-scipy stackoverflow question : importerror-no-module-named-scipy]</ref>
 
sudo apt-get install python-scipy
sudo pip install scipy
 
==PyOpenGlPyOpenGL==
opis<ref>[http://www.de-brauwer.be/wiki/wikka.php?wakka=PyOpenGL PyOPenGl by ElieDeBrauwer]</ref>
 
==PyOpenClPyOpenCL==
Instalujemy python-pip i python-setuptools. :<ref>[httphttps://wwwpackaging.pip-installerpython.org/en/latestinstall_requirements_linux/#installing.html -pip-installersetuptools-wheel-with-linux-package-managers Installing pip/setuptools/wheel with Linux Package Managers]</ref>
sudo apt-get install python-pip
 
uaktualnij pip<ref>[http://wheel.readthedocs.org/en/latest/ Wheel A built-package format for Python.]</ref>
 
pip install --upgrade pip
 
=Zobacz również=
* [[Zanurkuj w Pythonie| Więcej informacji o Pythonie ]]
* PyOpenCl PyOpenCL<ref>[httphttps://wiki.tiker.net/PyOpenCL PyOpenCL by Andreas Klöckner]</ref>
* PyCuda <ref>[httphttps://mathema.tician.de/software/pycuda/ PyCUDA by Andreas Klöckner]</ref>
 
=Odnośniki=
<references />