0

I want to automate setting working directory where used python script exist.

import os

workingDirectory = os.path.dirname(__file__)
os.chdir(workingDirectory)

When I run that code in ABAQUS, it doesn't work with error, "__file__ is not defined."

How can I solve it??

서보일
  • 25
  • 2
  • Does this answer your question? [python NameError: global name '\_\_file\_\_' is not defined](https://stackoverflow.com/questions/16771894/python-nameerror-global-name-file-is-not-defined) – ndclt Jan 12 '22 at 13:34

0 Answers0