Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.9.1. General information about Python
Notes:
- On virtual hosting, you can run Python scripts as CGI applications, while on business hosting, you can run full-fledged web applications.
- If you encounter problems with displaying Cyrillic characters, see Python script does not output Cyrillic.
After connecting to the hosting via SSH, you can check the version numbers of the interpreters and the lists of available modules.
Change version
For a list of available versions, see Supported technologies.
Python version check command (X.X — version number):
pythonX.X -V
Control panel
Notes:
- The version change occurs for the alias
python. - Affects all new SSH connections.
- Open the "Linux configuration" section.
- In the "Python version" block, select the desired version and save the changes (for more details, see Linux configuration).
- Run the command
source ~/.bashrcor. ~/.bashrcor simply reconnect via SSH.
Interpreter
Affects only commands that are run with a specific interpreter specified.
Path to the Python interpreter of the required version (X.X — version number):
/usr/bin/pythonX.X
Modules
Viewing the list of available modules:
- Enter interactive mode (
X.X— Python version number):pythonX.X - Execute the command:
help('modules') - To exit interactive mode, press Ctrl+D or execute the command:
exit()
On the hosting, you can independently install additional modules. You can also submit a suggestion for the administration to consider the possibility of globally installing the module you need.