|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Python and the web
Couple questions to ask:
1) building a website on my desktop and everytime i write the html code i have to save it both as text and as .htm its kind of annoying. isn't there anyway to kind of automate it. 2)I want to use python on the server side and i'ld like to have a a from submission go to say clien_parser.py. after i link it to the script does it go there automatically or do i need to be using the cgi bin info from python. Basically the question is how do i get the form to go to the script and how do i get python to read and process the info. 3)I forgot the third. i'll remember: ![]()
__________________
"In theory, there is no difference between theory and practice. But, in practice, there is."
|
|
#2
|
|||
|
|||
|
Quote:
1) I don't understand this part, why do you have to save it as .txt? 2) you direct the form data to the script in your HTML form example: <form action="clien_parser.py" name="pyform" method="post"> if you want to do CGI with python, read the devshed tutorial http://www.devshed.com/c/a/Python/W...rams-in-Python/ |
|
#3
|
|||
|
|||
|
Quote:
Thank you for answering. I first save it as text so that i can manipulate easier. I've read some tutorials that told me if i want to do so i need to save it as a text and not htm. 2) in your example name = "pyform" is that the mandatory attribute or generic? 3)Thank you for you link i appreaciate it. |
|
#4
|
||||
|
||||
|
Well, you dont have to write anything to a text file and i can't see how it could be easier since data read in from a file is just a string. So if you just want to manipulate it then theres no need, but then maybe theres something your not telling. And just to clear things up a little
, the file extention means nothing to Python so anything you like...What server are you trying to run this from anyway or do you just want to have the app serverless, if so then you should look at the CGIHTTPServer module. http://www.python.org/doc/2.3.3/lib...HTTPServer.html Hope this helps. Mark P.S. The name of the form (like all other element names) is generic |
|
#5
|
|||
|
|||
|
Quote:
I still don't get what your talking about with the text file though. I want to create a webpage so i go into notepad and right the necessary script, then i save it as htm. is that what your saying. what happens when i want to edit the script? then i have to copy and paste it onto notepad manipulate it and then save it again. If i save it as text, all i do is manipulate the text file and save a copy as htm and as text, that way i don't do any copy and paste. hope this clears it up and what i do. If there is a better way i'ld love to hear it as you can see i'm a web developing novice. thanks again for your reply. |
|
#6
|
|||
|
|||
|
Quote:
When you want to edit the file, open the HTML file in notepad. Or, better yet, don't close notepad, just save the file before viewing the changes. Even better, don't use notepad. Try EditPlus, or Textpad or one of the other free text editors that do syntax highlighting, etc. |
|
#7
|
||||
|
||||
|
The content of html files is just plain text.
You can edit and save html files using Notepad. There are plenty of Free Text Editors on the web which make editing html files easier. For example - when you use the open file dialog they show your html files without you having to change the file type settings. Your tutorial probably warned you not to use a word processor program like Wordpad or Word. They can add funny codes and mess things up.
__________________
*** Experimental Python Markup CGI V2 *** |
|
#8
|
|||
|
|||
|
Quote:
Now next question: Can i use PWS on windows to turn my computer into a server, that way i can test out the cgi capabilities. I'm on windows xp. I hope this isn't a stupid question but i've heard about it, thats why. Last edited by caroundw5h : April 1st, 2004 at 06:37 PM. |
|
#9
|
||||
|
||||
|
In theory yes although i havn't used it since Apache beats it hads down every time! So if you can get Apache, you wont regret it
![]() Mark. |
|
#10
|
|||
|
|||
|
M$ say that PWS is not supported on Windows XP, and I have heard reports that it will not run at all. On the other hand I could never get PWS to run on Windows 98 either.
My advice is to avoid it like the plague and use a decent web server like Apache. If you need ASP functionality then take a look at AHTML from Selisoft (http://www.selisoft.com/en/ahtml/), which does a reasonable job of providing ASP emulation under Apache and other servers. There are other products that do this but they are priced in the hundreds of dollars range, while AHTML is about $30. Dave - The Developers' Coach |
|
#11
|
|||
|
|||
|
Thank you for your responses. I guess what i'm asking is can i run apache or a server on my home computer and still use it as a personal computer. I only want to test the cgi output. I will take a look at apache however. Thank you.
While we are at it. Can you tell me exactly what a Server is. I know it is a dedicated computer to hold info, but why do you need speacial sofware like apache. technically isn't being connected to the net enough? i mean ppl want to see your home page, they can just log on to your site, that you store on your own computer right? what does apache, cheetah and all the others do that is so speacial? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python and the web |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|