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

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10

    Executing in the browser


    hey guys i was just wondering how i could get a .py to run into web browser it self

    my general project idea is to make a python program that loads different html documents as the day changes, almost like a calender if u will. but creating the program isnt the issue, it knowing if i can run the prgram in the browser and what is nec. to do so.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    51
    Rep Power
    10
    I posted in the other thread the changes that need to be made in the config file. If you didn't understand what I said, here is a much more in-depth tutorial. http://www.thesitewizard.com/archive...toapache.shtml

    If it just shows the source or asks you to save it when you try to view it then you need to configure apache properly, if it gives you an internal server error check the apache error log and your python syntax.
  4. #3
  5. A wanna-be guru of some sort
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2004
    Location
    Either online or offline
    Posts
    625
    Rep Power
    20
    Please do not repeat same topics. What you're asking here is no different than what you asked in Python CGI thread. You got your answer there, no need to look for it again in a different place.
    Am I supposed to sign here?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10
    well no its not actually...at this very moment perhaps but my question is really more "Is it possible to make a script where the layout of a certian table change ever "new day"?"

    what i mean by new is like today is friday and 2morrow 12:01am will be a new day.

    i kno i will need 'time module but if u could give me some guidence it is very much appre. ty
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    ofcourse it is possible, you will have to combine either python as cgi or mod_python for apache to do it though. But yes, your right just some use of the time module like you can make it based off the day of the week, week of the year, hour of the day, year of the century, it will just depend on how you want to do it, just go to pythons web site and look at the docs on the time module, it will give you a pretty good idea of what it can do.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    51
    Rep Power
    10
    It is also possible to create a txt file with the table code in it, then set up a cron job to change this text file daily. And just load the html from the text file and display it. PHP would be a little easier IMO to complete this task.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    actually php and python are both very very easy to use in the web development area, I think python is a bit more powerfull but has less support for web development. However python can be used in more places than just on the web where as php doesn't have much support outside of web development.

IMN logo majestic logo threadwatch logo seochat tools logo