Python Forum
Importing files with Pycharm
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing files with Pycharm
#1
Hi all! I import easily files with Files|open. All of them fall on my screen as ordinary files, but all of them are outside the project. In order to put them inside my project, I use "new file", I type the name of the file, then "copy", then "paste".
I think there must be an easier way to transfer my files inside the project, avoiding typing the name of the file, copying and pasting. Can you give me this easier wy ?? Thanks
Reply
#2
Open the file you want to move in PyCharm, Make sure the file (or tab) is highlighted. From the menu bar, click on Refactor --> Move. Change the current directory to the directory you want. Click "OK". That's it. The file should be in the new directory/project.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
Thanks. I succeeded but with much work. I am with Linux. The name of the project being "SCRIPT", the destination must be: /home/sylvain/PycharmProjects/SCRIPT/script0
That for the only file: script0.py
Reply
#4
I must give the good way for moving files into the project, after they have been imported with ""File|Open":
1. Highliht the file you want to move into the project.
2. On the menu bar: Refactor|Move
3. In "To directory" change to have: /home/sylvain/PycharmProjects/NEW
NB: NEW is the name of the project
4. Click on OK
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Newbie question about switching between files - Python/Pycharm Busby222 3 606 Oct-15-2023, 03:16 PM
Last Post: deanhystad
  Can I get some clarification on importing functions from external files. wh33t 3 904 Feb-25-2023, 08:07 PM
Last Post: deanhystad
  Importing tensorflow into pycharm on mac jrs92 2 1,841 Aug-22-2020, 04:55 PM
Last Post: jrs92
  Error in importing package in pycharm fullstop 0 2,349 Dec-12-2019, 04:03 PM
Last Post: fullstop
  With pyCharm how to run(build) the whole(3 files) sylas 14 10,568 Apr-10-2017, 10:53 AM
Last Post: buran
  Importing files to other python scripts amilie1234 1 3,010 Feb-13-2017, 09:03 PM
Last Post: buran

Forum Jump:

User Panel Messages

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