I am using Python 2.5 r25:51908 MSC v.1318 32 bit (Intel) on wind32
I am totally new to Python and started yesterday going over a couple
of examples I found in the documentation which address a problem I am
trying to solve.
I have successfully opened a file and read the results adapting this
code
Here is what var data collected:
302 Found
Found
The document has moved http://www.thenational.us/pages/
htmlos/001863.1.059070780420726458">here.
Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_mono/
2.2 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1
Server at thenation
I got it! You can see the code at the bottom of this post. Sorry for
three posts on this question.
I have to run the program one time just to get the dynamically
generated redirect URL for the POST (it looks like this)
The document has moved http://www.thenational.us/pages/htmlos/
001863.1.05907
En Mon, 02 Mar 2009 23:02:10 -0200, JohnV escribió:
I have to run the program one time just to get the dynamically
generated redirect URL for the POST (it looks like this)
The document has moved http://www.thenational.us/pages/htmlos/
001863.1.059070780420726458">
I then paste the redirected U
Thanks for your suggestion, but I am not able to get it to work for
me.
My original script was:
f = open('C:\Users\Owner\Desktop\mydata.txt', 'r')
read_data = f.read()
f.close()
import httplib, urllib
params = urllib.urlencode({'textarea1': read_data})
headers = {"Content-type": "application/x-
En Tue, 03 Mar 2009 04:13:46 -0200, JohnV escribió:
Thanks for your suggestion, but I am not able to get it to work for
me.
My original script was:
f = open('C:\Users\Owner\Desktop\mydata.txt', 'r')
read_data = f.read()
f.close()
\ is the escape character in Python. You must double it when
On Mar 2, 10:13 pm, JohnV wrote:
> Thanks for your suggestion, but I am not able to get it to work for
> me.
>
> My original script was:
>
> f = open('C:\Users\Owner\Desktop\mydata.txt', 'r')
> read_data = f.read()
>
> f.close()
>
> import httplib, urllib
> params = urllib.urlencode({'textarea1':
En Wed, 04 Mar 2009 14:36:21 -0200, JohnV escribió:
Couldn't figure out the proper usage of the urllib2 functions to fix
the 302 Found problem, but what I did was change the URL to a php page
and httplib.HTTPConnection() worked fine when a "POST" was sent to
that page. So, when I have learned
> Sorry, I think you didn't get my later post -- than in fact was from a
> month ago...
> Seehttp://article.gmane.org/gmane.comp.python.general/613312/
> urllib2 should handle a 302 redirect automatically.
>
> --
> Gabriel Genellina
I went to the link you provided and sure enough there was your