473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Submit web form only client-side with Python? COM?

Say I have have an HTML form , the user hits the submit button and I
what text they enetered into a HTML form field is written to a file.

But I don't have PHP, JAVA the usual client or server sided layers to
write the data to a file, and I'm not to keen on JavaScript. Note: I
can not add or download anything, I must use what I have.

But I have Python 2.1 and I'm on a WinXP desktop with the win32.com,
and usual active-x objects, MS-Office ect - what'd normally locally on
an XP work station.

So I can present the user with an HTML form in it - but how can I
write the form data to a local file on my work station?

If there isn't a web form way, could there be another way to get a box
to come up with input fields with the capability to submit the data to
a file?

Thanks,
Lee G.

Aug 4 '07 #1
3 1776
goldtech <go******@worldpost.comwrites:
So I can present the user with an HTML form in it - but how can I
write the form data to a local file on my work station?
The simplest way is with the cgi and CGIHTTPServer modules. You'd
write your form in an html file, with the target set to a Python
script that you'd write as a cgi. Then you'd write a trivial CGI HTTP
server (look at the example code in the comments) with CGIHTTPServer.
The user would point their browser at your server (you could make a
desktop shortcut for that), the browser shows the html file, and the
submit button sends the form contents to your cgi.

This is very basic, old-school web programming, not as flexible or
high-performance as using the fancy frameworks, but a lot simpler for
limited applications like what you're describing.
Aug 4 '07 #2
Paul Rubin wrote:
goldtech <go******@worldpost.comwrites:
>So I can present the user with an HTML form in it - but how can I
write the form data to a local file on my work station?

The simplest way is with the cgi and CGIHTTPServer modules. You'd
write your form in an html file, with the target set to a Python
script that you'd write as a cgi. Then you'd write a trivial CGI HTTP
server (look at the example code in the comments) with CGIHTTPServer.
The user would point their browser at your server (you could make a
desktop shortcut for that), the browser shows the html file, and the
submit button sends the form contents to your cgi.

This is very basic, old-school web programming, not as flexible or
high-performance as using the fancy frameworks, but a lot simpler for
limited applications like what you're describing.
CGIHTTPServer is not available on Windows (OP said they are on Win XP) due to
use of fork and exec to execute the CGI. I suggested a few other options in my
reply, but unfortunately CGIHTTPServer is not an option for this task.

-Jay
Aug 4 '07 #3
En Sat, 04 Aug 2007 19:17:35 -0300, Jay Loden <py****@jayloden.com>
escribió:
Paul Rubin wrote:
>goldtech <go******@worldpost.comwrites:
>>So I can present the user with an HTML form in it - but how can I
write the form data to a local file on my work station?

The simplest way is with the cgi and CGIHTTPServer modules. You'd
write your form in an html file, with the target set to a Python

CGIHTTPServer is not available on Windows (OP said they are on Win XP)
CGIHTTPServer does work on Windows (even on Python 2.1, as far as I can
go) and using it might be simple enough.
due to
use of fork and exec to execute the CGI.
CGIHTTPServer uses popen2 or popen3 if available.
I suggested a few other options in my
reply, but unfortunately CGIHTTPServer is not an option for this task.
I can't see any other reply from you on this thread... (I'm using the
gmane newsgroup interfase)

--
Gabriel Genellina

Aug 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Dave Smithz | last post by:
Hi there, A PHP application I built has a section which lists a number of members to a club whose names each appear with a check box beside them that can be ticked. These check boxes are part...
3
by: Mark Michel | last post by:
Hi. I have made an html form which I would like to send by e-mail. When the recipient receives the e-mail form, I would like them to be able to fill it out and click the Submit button which will...
5
by: José Carlos | last post by:
Hi. I am trying send a text value when click in an image. If i write: onClick="javascript:document.client.submit();" send all form, but i want to send only a input type text (name = cod),...
11
by: charlie_M | last post by:
I have a number of applications where I want to have many onclick='submit()' attached to different 'elements' on a single form ..... which sends the form to a CGI "script" which does all the...
2
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely...
9
by: Eric George | last post by:
Hi, Has anyone had any success using jscript submit method in their VS.NET projects? For example I have some client processing in a script function then call <form name>.submit(); This won't...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
5
by: Simon Benson | last post by:
Probably a fairly simple problem but one that's been plaguing me for a couple of days... can anyone help? I have a classic ASP page with a number of text boxes which are updatable. For...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.