Python and Intranet issues

rcw5459 at *nospam*njit.edu rcw5459 at *nospam*njit.edu
Mon Aug 19 14:29:56 EDT 2002


I'm trying to set up a webpage on my company's intranet site that grabs
images and info(via .txt file) from the local network.  I'm using a CGI
script (in Python, of course) to generate the HTML.  I've tested the script
out with the images and txt files on the web server, and it worked
beautifully.  Unfortunately once I moved the files onto the network (the
directory has read permissions set for all users), Bad Stuff happened.

The images were loaded fine...but I'm getting errors when tying to read the
text file.  At first I used open('\\blah\blahblah\info.txt', 'r') to try to
get the info, but I was getting errors (no such file or directory).  I've
also tried several variations including:
open('\\\\blah\\blahblah\\info.txt', 'r') and 
open('file:///\\\\blah\\blahblah\\info.txt', 'r').  

Then, after some snooping around, I discovered the urlopen() command.  After
attempting this in several different ways I received more "No such file or
directory" errors.

Can anyone tell me the correct syntax (or correct command, if I'm using the
wrong ones) to use when trying to read a file off the network?  

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse at newsone.net



More information about the Python-list mailing list