How to I access the filename with TkFileDialog?

2005-02-17 Thread imphasing
I'm writing a python program to open a file, and display it onscreen,
but I can't seem to find the var that "tkOpenFileName" returns to. It's
not much use if you can't get the filename you just chose, so there
must be a way to get it. Could anyone help me?

Thanks,
Alex

-- 
http://mail.python.org/mailman/listinfo/python-list


Using open() inside a subroutine

2005-02-17 Thread imphasing
Whenever I try to open a file inside a subroutine, like so:

def open():
filePath=askopenfilename()

fileOpen = open(filePath, "r")
fileContent = fileOpen.read()
fileOpen.close()

it tells me that "open() takes no arguments (2 given)"
Why is that? and how can I get around that so I can open a file in a
subroutine?

Thanks,
Alex

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using open() inside a subroutine

2005-02-17 Thread imphasing
DUH. Thanks.
can't beleive I missed that one...

Alex

-- 
http://mail.python.org/mailman/listinfo/python-list