python help

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

python help

Post by SidewinderX »

hello, i know absoltuley nothing about python other then how to run it on my linux server.

My friend coded this simple script for me

Code: Select all

#!/usr/bin/env python2 
import urllib2
import urllib

data = {'pid': '40478458384'}
data = urllib.urlencode(data)
for line in urllib2.urlopen('http://www.extreme-hq.com/other/dfx/test/stats.php', data):
	pass
but it dosnt work on my local server nor my server i rent my web space from (it works on his server)

this is the error i get
[root@localhost html]# python /var/www/html/update.py
Traceback (most recent call last):
File "/var/www/html/update.py", line 7, in ?
for line in urllib2.urlopen('http://www.extreme-hq.com/other/dfx/test/stats.php', data):
TypeError: iteration over non-sequence
i dont know what any of this means or does, i know what the script is suppose to do, but im sure anyone who knows python can figure that out, does anyone know how i can fix this code?

any help what so ever is appreciated, thanks
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

well i updated to python 2.4 and it works fine which means the server i rent my space from dosnt have the latest version of python. i doubt they will update their version but idk. is there anyway i can get this script to run on python 2.2 ?
Post Reply