October 4th, 2005, 11:26 PM
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.
October 5th, 2005, 12:41 AM
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.
October 5th, 2005, 03:25 AM
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?
October 8th, 2005, 01:10 AM
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
October 9th, 2005, 12:22 PM
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.
October 9th, 2005, 01:52 PM
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.
October 9th, 2005, 06:33 PM
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.