I am doing simple file I/O. I have a Directory trait SaveDir
and a File trait SaveFile
. How to i access the directory path entered in the GUI, or the default? e.g., i would like to print it out, as in the following example.
Do i use get_value, e.g., SaveDir.get_value
? I can't figure it out...
Once I can access the value, I want to make a path string to i can open the file for writing, e.g. self.writefile = open(path,'w')
.
THanks, Cosmo
class ControlPanel(HasTraits):
SaveFile = Str("MyDAta")
SaveDir = Directory("C:/My Documents/Data")
view = View(Item('SaveFile',label='Save Filename',style='simple'),Item('SaveDir',label='Data Directory', style='simple'))
print SaveDir