10-05-2021, 07:59 PM
Hi!
I am trying to get the directory in which my Python program is saved. However, using the following code, I always get back the AppData/Local/Temp folder. Is it possible in RoboDK to get my original directory? For my specific purpose, it is also okay to get the directory of where my RoboDK file is stored.
Example:
import os
DIR = os.path.dirname(os.path.realpath(__file__))
print(DIR)
Result:
C:\Users\MyName\AppData\Local\Temp
Thank you for your help!
I am trying to get the directory in which my Python program is saved. However, using the following code, I always get back the AppData/Local/Temp folder. Is it possible in RoboDK to get my original directory? For my specific purpose, it is also okay to get the directory of where my RoboDK file is stored.
Example:
import os
DIR = os.path.dirname(os.path.realpath(__file__))
print(DIR)
Result:
C:\Users\MyName\AppData\Local\Temp
Thank you for your help!