How to execute a python script?

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

newsiness

VIP Member
Impact
49
My current hosting unable to execute .py script. When i execute the .py file it shows the script code on the page, for example:http://wapnews.mobi/example.py Any idea so that i can execute this .py script on my current hosting? Can i configure the Apache Handlers to execute this script? If yes, how? Thanks in advance!!!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
0
Close
try creating an .htaccess (thats dot htaccess) file in your web root with
Code:
AddHandler cgi-script .py

-JasonR
 
0
Close
DopeDomains said:
try creating an .htaccess (thats dot htaccess) file in your web root with
Code:
AddHandler cgi-script .py

-JasonR

added...but it shows Internal Server Error...any idea? Thanks
 
0
Close
Is your shebang correct? There should be a line at the top of the file that points to the location of the python interpreter, so if it's installed in /usr/bin, then the shebang should be
Code:
#!/usr/bin/python
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back