[python-win32] AppData directory on Windows?

Kevin Walzer kw_win at wtwinsoftware.com
Thu Sep 1 14:39:48 CEST 2011


Hi,

I’m getting feedback from a Windows user that says my Tkinter app won’t write data to an app temporary directory. Here’s my code:

sys.stderr=open(os.path.join(os.path.expanduser('~'), 'Application Data', 'QuickWho', 'QuickWho_errors.txt'), 'w')

And here’s the error message:

Traceback (most recent call last):
  File "QuickWho.py", line 7, in <module>
  File "quickwho_main.pyc", line 28, in <module>
IOError: [Errno 2] No such file or directory: 'C:\\Users\\Softpedia\\Application Data\\QuickWho\\QuickWho_errors.txt'

Do I have the correct path to a user’s app data directory? I tested this without issue on Windows 7. I’m not supporting versions of Windows prior to 7, but I thought this would work on any version > Windows XP. Please advise. 

Thank you,
Kevin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110901/563b9313/attachment.html>


More information about the python-win32 mailing list