LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2004, 03:38 AM   #1
safrout
Member
 
Registered: Mar 2002
Location: egypt
Distribution: Gentoo
Posts: 457

Rep: Reputation: 30
can anyone help me pl with this eror i a python script


i made this script about 3 months ago and it was working very good till few days ag where i started getting this error and i don't know why

Code:
import urllib, commands, datetime
i = commands.getoutput("lynx -dump -nolist -auth safrout:sa1782ao http://10.0.0.138/ip.htm | grep '^ *[0-9].*ppp$' -m 1 | cut -c 4-15")
x= commands.getoutput ("host safrout.homelinux.net | cut -c 35-46")
url="http://aokda:saf1782ao@members.dyndns.org/nic/update?system=dyndns&hostname=safrout.homelinux.net&myip="+i+"&wildcard=OFF&backmx=NO&offline=NO"
def compare():
  if x == i :
    print datetime.datetime.now(),"-->", i,"=", x
    exit
  else:
    url_new = urllib.urlopen(url)
    print datetime.datetime.now(), "ur IP was changed to ", url_new.read(), ", and it up2date now :)"
compare()
and the error looks like this

Code:
safrout@home IP-Update $ python ip_update.py
Traceback (most recent call last):
  File "ip_update.py", line 12, in ?
    compare()
  File "ip_update.py", line 10, in compare
    url_new = urllib.urlopen(url)
  File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
    return opener.open(url)
  File "/usr/lib/python2.3/urllib.py", line 181, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.3/urllib.py", line 281, in open_http
    if not host: raise IOError, ('http error', 'no host given')
IOError: [Errno http error] no host given
maybe it is a silly error but really i can't figure it out
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 12:43 PM
Help with small Python Script cmfarley19 Programming 8 05-02-2005 09:10 AM
how do I do this in Python? (simple sh script) johnMG Programming 6 12-22-2004 11:05 PM
Anyone have a HelloWorld Python Qt script? SheldonPlankton Programming 1 07-22-2004 03:52 PM
python script LinuxLala Programming 14 04-07-2004 07:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration