On 2005-02-18, imphasing <[EMAIL PROTECTED]> wrote:
> 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?

Because you defined open() as taking no arguments.  You're
calling your own open() function, not the builtin one.

> and how can I get around that so I can open a file in a
> subroutine?

Don't call your function open().

-- 
Grant Edwards                   grante             Yow!  Th' MIND is the Pizza
                                  at               Palace of th' SOUL
                               visi.com            
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to