Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Checking if the computer is online
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="=?ISO-8859-1?Q?Mickel_Gr=F6nroos?=, post: 1727516"] OK, here's what I want to do: When the Tkinter application I am writing starts up, it checks if certain files on the web exists and if so, it downloads them to a local directory replacing possible earlier copies of these files. So, what I mean by checking if the computer is online is that I want to check if I can access these certain remote files with urllib.urlretrieve(). If I can, then I download them. If I can't, I assume the computer is not connected to the Internet and I skip the update phase. The problem with just running urllib.urlretrieve() is that the execution of the script halts as there is no timeout available for Python 2.2.2. (I tried timeoutsocket.py to get this done, but that only worked on Windows 2000, not Redhat Linux 7.0. I also tried upgrading to Python 2.3, but that caused some other problems, especially with the gettext module and with the fact that my ISO-8859-1 encoded files needed a "coding" line.) So that's that. Anybody still got a few lines of code that would get this done on Python 2.2.2 on Windows _and_ Linux? Cheers, /Mickel G. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Checking if the computer is online
Top