Python Forum
setting working directory in pycharm
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setting working directory in pycharm
#1
parent/
    one/
        __init__.py
        sample1.py
    two/
        __init__.py
        sample.py
When i run the code through command prompt like <c:/users/parent> python two\sample.py,print(os.getcwd())gives "c:/users/parent".But when i run sample.py through Pycharm, print(os.getcwd())gives "c:/users/parent/two".Is there a way to set working directory in Pycharm so that in all instances it takes working directory as "c:/users/parent"
Reply


Messages In This Thread
setting working directory in pycharm - by saisankalpj - Dec-06-2018, 09:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  working directory if using windows path-variable chitarup 2 765 Nov-28-2023, 11:36 PM
Last Post: chitarup
  Help setting up Pycharm & Remote Pi PickyBiker 3 2,006 Sep-17-2021, 04:04 PM
Last Post: PickyBiker
  Setup working directory in IDLE Pavel_47 3 3,834 Mar-06-2021, 08:59 AM
Last Post: Pavel_47
  [PyCharm] Working with virtual environment AndrzejB 1 2,157 Jul-18-2020, 06:22 PM
Last Post: AndrzejB
  CWD (Current working directory) pcsailor 5 4,720 Nov-11-2018, 10:14 AM
Last Post: Larz60+
  Configuring interpretor in PyCharm: [Errno 2] No such file or directory BoaCoder3 0 8,085 Sep-15-2018, 01:21 PM
Last Post: BoaCoder3
  how to save python file to working directory rpdohm 3 6,054 Sep-14-2017, 06:16 PM
Last Post: rpdohm

Forum Jump:

User Panel Messages

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