How do I change directory back to my original working directory with Python?

前端 未结 6 828
梦谈多话
梦谈多话 2020-12-15 04:07

I have a function that resembles the one below. I\'m not sure how to use the os module to get back to my original working directory at the conclusion of the jar\'s execution

6条回答
  •  悲哀的现实
    2020-12-15 04:45

    You simply need to add the line:

    os.chdir(owd)
    

    Just a note this was also answered in your other question.

提交回复
热议问题