Opening Files from Command Line
You can open an arbitrary file, folder, or project for editing in PyCharm from the command line, optionally specifying where the caret should rest after opening the file.
- In the command line, run the following command:
<PyCharm> [--line <number>] path
Alternatively, you can use the following syntax:
<PyCharm> path:<number>
The command options are as follows:
Option | Description |
---|---|
| The platform-specific PyCharm launcher. On macOS and Linux, it is recommended to use the command-line launcher created during the PyCharm installation, or create one manually by selecting on the PyCharm main menu. Refer to Besides working from within PyCharm, you can perform the following actions from the command line: for details. On Windows, it is recommended to add the path to the PyCharm executable to the |
| The path to the file or the folder to be opened.
|
| (optional) The line number, on which the caret should rest after opening the file. |
Examples
- Syntax
-
pycharm.exe --line <number> path
- Alternative syntax
-
pycharm.exe path:<number>
- Examples
-
pycharm.exe --line 3 C:\MyProject\scripts\numbers.js pycharm.exe C:\MyProject\scripts\numbers.js:3
- Syntax
-
pycharm --line <number> path
- Alternative syntax
-
pycharm path:<number>
- Example
-
pycharm --line 3 ~/MyProject/scripts/numbers.js pycharm ~/MyProject/scripts/numbers.js:3