I am working with Python 3.4.
When I use IDLE and start typing, e.g.,
my_main_folder = "C:/Us"
in the editor window, and then press Ctrl + Space
, IDLE offers me all subfolders of C:
, and if I press Tab
, the string is completed to "C:/Users"
.
That means that IDLE (or Python Shell) is able to recognize a string as a path.
How to make PyCharm (Community edition) do that?
Its not able in Community Edition Pycharm. But it can be done in Professional Edition Pycharm. I would suggest you to move to Professional Edition.
BUT,There is a work around for it in Community Edition.
Place caret in such place and press Alt+Enter -- see if you will have "Inject language or reference" option in appeared menu. If it's present -- use it and choose "File Reference" there.
Otherwise: select desired file in Project View panel and use "Copy Reference" -- it will copy a file path relative to the project root -- you may only need to add leading "/"...