How to run Python scripts?

If you wish to run Python scripts in your hosting account, you can create and edit them in two ways: either in cPanel or via SSH.

To create and edit Python script in cPanel use the following steps

1. Log in to your cPanel:
2. Go to section Files > File Manager
3. You can choose whether you want to run script in cgi-bin folder or outside it.

cgi-bin folder contains executable CGI scripts. If the file should be placed out of cgi-bin folder, .htaccess should be created additionally.

4. In order to run Python script in cgi-bin folder follow the steps

  • Go to cgi-bin folder.
  • Vreate the file with .py extension for example nctest.py in /home/cPuser/public_html/cgi-bin directory (where cPuser is your actual cPanel username).

5. In order to create the file, click New File > specify the name of the file with the required extension and click Create New File:
6. Change the permission of the file to 0755
7. In order to change the permissions of the file you need to select the file > click Change Permissions > Mark Execute for User, Group, World columns and click Change Permissions
8. Open the file, click Edit and add the code.

  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Verwandte Artikel

Accessing cPanel from a dynamic IP address

If you get logged out from cPanel and get an error The IP has changed, then it is possible that...

Difference between cPanel and WHM

WHM (WebHost Manager), provides administrative control of your dedicated server or VPS. It allows...

How can I check my website access logs?

Using Raw Access Logs menu in cPanel you can check the traffic coming to your website, before it...

How do I add an Apache handler?

1. Click on the “Apache handlers” link in Cpanel. (under the 'site management header.)2. Enter...

How do I add new email account to my hosting account?

Every AllNewISP.com linux hosting account comes with a cPanel as a control panel. You can create...

Powered by WHMCompleteSolution