Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Python Scripting

    Hello, I'm fairly new to running scripts on servers, so I've a few doubts.

    Firstly, if I've a simply python script and I save it in my /cgi-bin folder (yes, my server has python support) how would I run it?

    Do I have to make it executable using chmod? I think that this is needed for almost all executable scripts but my hosting service doesn't say this. They also say that I don't have to update my path at the top of the script because they automatically set it for scripts in the folder.

    If python scripts on servers need any other includes, or such things, just lemme know.

    Cheers.

  • #2
    New Coder
    Join Date
    Jul 2010
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Bump. Noone?

  • #3
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,877
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Yes, the script needs to be executable. Use chmod and set it to 755.

    I don't work with Python, so I don't know if it requires any special includes for cgi scripts. (This forum area is almost entirely Perl related questions)

    If the script is in your cgi-bin folder and assuming your host hasn't setup any special url rewrite rules, the url to call your script would be:
    http://yourwebsite.com/cgi-bin/yourscript.py


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •