The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    16
    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:
    16
    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
     
  3. bmcpanel

    bmcpanel Well-Known Member

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

Share This Page