Opening file problem in wxWindows program

David Ishee isheedm at yahoo.com
Thu Sep 14 09:52:34 EDT 2000


I am writing a program that uses wxWindows for the GUI in Windows NT
with Python 1.5.2. I am trying to open a file and read the contents
within this program and I'm having trouble. I have the statment:

usernameFile = open('usernames.dat', 'r')

However, I get an error message saying:

TypeError: illegal argument type for built-in operation

If I create a blank test script with this statement as the only line,
it works fine. If I enter the statement in the command line of the
interpreter, it works fine. What could be the problem with using it in
a script interspersed with wxWindows stuff?

I have imported these at the top of my script:

from wxPython.wx import *
from os import *
from string import *

Any ideas?

David



More information about the Python-list mailing list