On Fri, 2005-01-07 at 02:06, Josh wrote:
> Peter,
>
> Thank you for the rookie correction. That was my exact problem. I
> changed the address to use forward slashes and it works perfect. I did
> not know that a backslash had special meaning within a string, but now
> I do! Thanks again
There's an
Josh wrote:
He is the function where I am making the call. If I change the open
statment to another file, say "c:\test.txt", a file I know exists, it
will error out stating the file does not exist. Thanks
def GetStartVars(self):
try:
DOWNFILE = open("c:\fixes.txt","r")
Josh, it's surprising that th
Micheal,
Thanks for the advice as the programming I am doing will be run on both
Windows and Linux based PC's, that being the main reason for my venture
into Python. I'm glad to see that people are willing to help out even
the newbie's.
Josh
--
http://mail.python.org/mailman/listinfo/python-l
Sorry, the BASE variable should be 'C:\\' on Windows:
>>> BASE = 'C:\\'
>>> import os
>>> os.path.join(BASE, 'foo', 'bar', 'baz')
'C:\\foo\\bar\\baz'
--
http://mail.python.org/mailman/listinfo/python-list
You can use the os module to build path names in a platform-independent
manner. On my Linux box, I can type
>>> BASE = '/'
>>> import os
>>> os.path.join(BASE, 'foo', 'bar', 'baz')
'/foo/bar/baz'
On a Windows machine, you get
>>> BASE = 'C:'
>>> import os
>>> os.path.join(BASE, 'foo', 'bar', 'b
Josh <[EMAIL PROTECTED]> wrote:
...
> He is the function where I am making the call. If I change the open
> statment to another file, say "c:\test.txt", a file I know exists, it
Are you sure a file exist whose name is, c, colon, tab, e, s, t ...?
\t is an escape sequence and it means TAB (char
Josh wrote:
Peter,
Thank you for the rookie correction. That was my exact problem. I
changed the address to use forward slashes and it works perfect. I did
not know that a backslash had special meaning within a string, but now
I do! Thanks again
you may want to check "python gotchas" to avoid
other
Peter,
Thank you for the rookie correction. That was my exact problem. I
changed the address to use forward slashes and it works perfect. I did
not know that a backslash had special meaning within a string, but now
I do! Thanks again
Josh
--
http://mail.python.org/mailman/listinfo/python-list
He is the function where I am making the call. If I change the open
statment to another file, say "c:\test.txt", a file I know exists, it
will error out stating the file does not exist. Thanks
Josh
def GetStartVars(self):
try:
DOWNFILE = open("c:\fixes.txt","r")
except IOError:
print "Failed to o
Josh wrote:
I am having a problem with Python. I am new to Python as a programming
language, but I do have experience in other languages. I am
experiencing strange problems with File handling and wonder if anyone
else has seen this or knows what I am doing wrong. I am simply trying
to open a file f
I don't think we can help if you don't post some of your code.
Regards,
Arjen
Josh wrote:
Hi,
I am having a problem with Python. I am new to Python as a programming
language, but I do have experience in other languages. I am
experiencing strange problems with File handling and wonder if anyone
else
Title: RE: File Handling Problems Python I/O
[Josh]
#- able to do so without a problem, but here's the catch: The open
#- statement is only working on certain files. I open a simple text file
#- say file1.txt without any issues, but I change the open statement to
#- another text file a
12 matches
Mail list logo