Python Forum
how to save python file to working directory
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to save python file to working directory
#1
I am using Bash terminal and my working directory is /home/rpdohm. I am using IDLE to create my python script and when I save my python script (i.e. Test.py) I have no clue where to save it to because it only gives me the standard computer folders such as C:\My Documents, etc. I do not know how to find /home/rpdohm folder to save my python script. I want to run my python script from Bash using the command python3 test.py but of course it cannot find it since it is not in my working directory. I do have the shebang in the first line of python script as well.

I appreciate any help, I recently started learning Python and just in last few weeks have been working with the Bash terminal and have been stuck on this for days....
Reply
#2
IDLE is by far the worst IDE for anything. If you use the terminal, then you might know the benefits of terminal over a GUI IDE? You can use any IDE not just IDLE. I use just Vim and execute the script on the terminal split by Tmux.
Quote:I want to run my python script from Bash using the command python3 test.py but of course it cannot find it since it is not in my working directory.
Personally i would get a different IDE or just use a text editor.

I would recommend the IDE Geany. Like a lot of IDE/text editors , Geany has an embedded terminal in it you can run the script from.
Recommended Tutorials:
Reply
#3
Here's a comparative list of python IDE's. This is usually a personal choice, so I'd try a few (bunch)
until I find the one I like best. https://wiki.python.org/moin/IntegratedD...vironments

Don't pay attention to the updated column (it's rarely updated ) for instance it shows PyCharm's last
update as 2014. But it's updated on a regular basis.
Reply
#4
I appreciate it guys, I will take a look at some other IDE's and let you know how I make out.

Cheers, Ryan
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Open/save file on Android frohr 0 334 Jan-24-2024, 06:28 PM
Last Post: frohr
  working directory if using windows path-variable chitarup 2 740 Nov-28-2023, 11:36 PM
Last Post: chitarup
  how to save to multiple locations during save cubangt 1 557 Oct-23-2023, 10:16 PM
Last Post: deanhystad
  change directory of save of python files akbarza 3 891 Jul-23-2023, 08:30 AM
Last Post: Gribouillis
  save values permanently in python (perhaps not in a text file)? flash77 8 1,243 Jul-07-2023, 05:44 PM
Last Post: flash77
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 3,380 Jun-27-2023, 01:17 PM
Last Post: diver999
  Save and Close Excel File avd88 0 3,074 Feb-20-2023, 07:19 PM
Last Post: avd88
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 1,003 Jan-23-2023, 04:56 AM
Last Post: deanhystad
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,130 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Save multiple Parts of Bytearray to File ? lastyle 1 960 Dec-10-2022, 08:09 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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