Thread: zip file

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    58
    Rep Power
    11

    zip file


    im using an editor called jext and i made a simple program that says 'hello world'. I have a zip file now but i cant run it. I would like to put it on the web some how so it would have to be an exe (i think). Any ideas?
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    You made a simple "hello world" program, and then zipped it up and now you want to make it so:

    1. People can download it [You'll need some web space]?
    2. You want people to be able to view the program though there web browser [You want to turn it into a CGI script]?

    Sorry for the comfusion ,

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    58
    Rep Power
    11
    to put it on the internet to display on the browser. (num 2)
    Could u tell me how to do it or a tutorial perhaps
    thx
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    There are a few things you'll need to put the webpage online. Firstly, a domain name [optional] and secondly a webserver that's been configured to run CGI scripts: you can get help with setting this up on a local machine from the "Apache Development" forum here:

    http://forums.devshed.com/forumdisplay.php?f=45

    Alternativly you could sign up for a free website with one of the free hosts listed here:

    http://www.python.org/cgi-bin/moinmoin/FreeHosts

    Next, you'll need to make a some changes to your Python program so it can be run as CGI. So if your program looks something like this:

    Code:
    #!/usr/bin/env python
    
    print 'Hello World'
    then you'll need to add another print statment before your message; to send the Content-Type header. Also note that it is important to include the path to where python is installed on the server on the first line of your program (above).

    Code:
    #!/usr/bin/env python
    
    print 'Content-Type: text/html\n'
    
    print 'Hello World'
    Notice the new line character at the end of this new line. This is required to seperate headers from the body of the page. It's pretty simple stuff, give it a wiz and let me know if you have any problems getting it going.

    You might also enjoy reading one of these articles, located in devsheds Python section.

    http://www.devshed.com/c/a/Python/Writing-CGI-Programs-in-Python/
    http://www.devshed.com/c/a/Python/Python-on-the-Web/

    Have fun,

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo