Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Question about Python

Discussion in 'General Discussion' started by bmcpanel, Aug 15, 2002.

  1. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    316
    A customer is asking about Python. Can anyone tell me if Python is configured to be used as he is referring below? I am Python illiterate.

    Thanks...

    =========================
    Actually, I believe my question falls under configuration and not programming. As you must configure the Apache server to recognize and execute PHP scripts, so it must do to allow Apache to recognize and execute Python scripts. I think the Apache server must be set up to recognize the standard .py Python extention and then reference the python binary in order for it to be executed, in a similar fashion as it does for PHP.
     
  2. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    316
    Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java not PHP

    You should put this header in every python scripts/programs

    #! /usr/bin/python

    Also like mod_perl there is an integration with Apache for python too which is called mod_python (however it is not recommended to use these modules)

    Also Add handler for .py file to httpd.conf

    refer to this site for more information
    http://www.modpython.org
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    316
    Thank you. This info is very helpful.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice