| 4 | | * [[cypress/Python|Running Python on Cypress]] |
| | 4 | == What is Python? == |
| | 5 | Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. |
| | 6 | * [https://www.python.org/ Python] |
| | 7 | |
| | 8 | === Python 2 or 3 === |
| | 9 | Python 3 was incompatible with Python 2. |
| | 10 | ==== Python2 ==== |
| | 11 | The last version of Python 2, released in 2010, was Python 2.7. The support for this version ended on January 1, 2020. |
| | 12 | {{{ |
| | 13 | # HELLO PYTHON |
| | 14 | import datetime |
| | 15 | import socket |
| | 16 | |
| | 17 | now = datetime.datetime.now() |
| | 18 | print 'Hello, world!' |
| | 19 | print now.isoformat() |
| | 20 | print socket.gethostname() |
| | 21 | }}} |
| | 22 | |
| | 23 | ==== Python3 ==== |
| | 24 | Python 3 was not just another version of Python 2 code. Python 3 came with a new syntax intended to prevent redundant or repetitive code. |
| | 25 | {{{ |
| | 26 | # HELLO PYTHON |
| | 27 | import datetime |
| | 28 | import socket |
| | 29 | |
| | 30 | now = datetime.datetime.now() |
| | 31 | print('Hello, world!') |
| | 32 | print(now.isoformat()) |
| | 33 | print(socket.gethostname()) |
| | 34 | }}} |
| | 35 | |
| | 36 | == How to run Python on Cypress == |
| | 37 | * [[/cypress/Python#PythonModules|Python Modules]] |