Python Forum
How to get %appdata% directory?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get %appdata% directory?
#1
I tried to get %appdata% directory,
But failed.

Script,
import os
print os.getenv('APPDATA')
Error:
File "C:\Users\User\AppData\Local\Temp\atom_script_tempfiles\db861f50-55af-11eb-b27a-c3d006aa3aaa", line 4 print os.getenv('APPDATA') ^ SyntaxError: invalid syntax
Im trying to save a cache file in %appdata% directory!
Reply
#2
Owhh,
import os

direc =  os.getenv('APPDATA')
print(direc)
Py 2 and py 3 is different!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020