Difference between revisions of "Python"

From TSG Doc
Jump to navigation Jump to search
m
 
(One intermediate revision by one other user not shown)
Line 21: Line 21:
 
| resources              = {{Infobox tsg
 
| resources              = {{Infobox tsg
 
   | child = yes
 
   | child = yes
   | header2 = Workshop
+
   | header1 = Workshop
   | data2 = {{bulleted list
+
   | data1 = {{bulleted list
 
       | [[Workshop: Python for behavioural scientists|Python for behavioural scientists]]
 
       | [[Workshop: Python for behavioural scientists|Python for behavioural scientists]]
 
   }}
 
   }}
Line 32: Line 32:
  
 
<!-- Table of Contents will be generated here -->
 
<!-- Table of Contents will be generated here -->
 
==Upgrade from 2.7 to 3.7==
 
Since Python version 2.7 has reached end of life since January first 2020, this version is no longer installed on our [[System Image]]. Standard is now: Python 3.7 64-bits.
 
If you still have scripts written in Python2, the scripts should be upgraded to Python 3. Most changes are probably the print statements. Print statements should always have parentheses: print('some text')
 
Key differences between Python 2 and Python 3 are here: https://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html
 
 
For our previous documentation for Python 2.7, see [[Python/Legacy]]
 
  
 
==Psychopy==
 
==Psychopy==
{{see |Psychopy}}
+
{{see also|Psychopy}}
  
 
When your script fails to load in Psychopy, because you need packages that are not installed on our lab computers, please contact TSG.
 
When your script fails to load in Psychopy, because you need packages that are not installed on our lab computers, please contact TSG.

Latest revision as of 10:42, 19 August 2025

Python
Python(tm)
Installed version3.7.9 64-bits
Development statusActive
Written inPython
Websitepython.org
Workshop

Python is a general-purpose, high-level programming language. It is also a type of snake and a rollercoaster, but one is arguably more relevant to your research than the others.
On the lab computers, there is support for Spyder, PyCharm and Psychopy.


Psychopy

See also: Psychopy

When your script fails to load in Psychopy, because you need packages that are not installed on our lab computers, please contact TSG.

Usage

Example: TestArgs.py

Execute the following script within the commandline (CMD): python testArgs.py a.
You should see the following result:

number of argument:  2
 argv[0]: ./testArgs.py
 argv[1]: a

See Also

External Links