Problem with "open"...

Michael Boyles mjboyles at voyager.vrve.iupui.edu
Mon Aug 16 18:25:51 CEST 1999


I am a very new user to python, but I thought I picked it up pretty
quickly. The code I have been using has been working for several
months now. I recently reorganized the modules (placement in the .py
file) and renamed some variables (nothing fancy) and I now get an
error from the following code:


class effect:
  ...
	
  def render():
    ...
    self.createViewFile("0000.vf")
    ...

  def createViewFile(self, filename):
    f = open(filename, "w")
    f.write("rview")
    f.close()
	
  ...

	
The error is on the "open" function. It reads:
	
  Exception in Tkinter callback
  Traceback (innermost last):
  File "/usr/local/lib/python1.5/lib-tk/Tkinter.py", line 726, in __call__
    return apply(self.func, args)
  File "/usr/people/mjboyles/effect/bin/effectGUI.py", line 156, in render
    self.menuListener.render()
  File "effect.py", line 423, in render
    f = open(("%s.vf" % name), 'w')
  TypeError: illegal argument type for built-in operation


Any suggestions? I have no idea about the error. When I try the
function during regular interperator mode from the prompt, it works
fine. Is there a description about the possible python errors
somewhere? 

Thanks in advance...
- Mike
   ___________________________________________________
 _/                                                   \_
|  Michael Boyles                  Research Programmer  |
|  Advanced Visualization Lab       Indiana University  |
|_ mjboyles at iupui.edu     www.vrve.iupui.edu/~mjboyles _|
  \___________________________________________________/





More information about the Python-list mailing list