I am trying to save some names and values from 6 texboxes, 2 are Strings and 4 are Integers, in .txt or .doc but it is not working
I am using python 3.4 in windows 8.1, can somebody help me, I have not being able to find any info or example in python 3.4 to save whatever I write in those 6 texboxes I have a button to call the function mSave
I have the following code to save but is not working
def mSave():
filename = asksaveasfilename(defaultextension='.txt',
filetypes=(('Text files', '*.txt'),
('Python files', '*.py *.pyw'),
('All files', '*.*')))
if filename:
with open(filename, 'w') as stream:
stream.write(self.gettext())
Python says
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python34\lib\idlelib\run.py", line 121, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
File "C:\Python34\lib\queue.py", line 175, in get
raise Empty
queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1533, in __call__
return self.func(*args)
File "C:\\ManualTab.py", line 608, in mSave
filename = asksaveasfilename(defaultextension='.txt',
NameError: name 'asksaveasfilename' is not defined
pleae help