Python 使用当前路径从终端打开 Pycharm
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39500438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Opening Pycharm from terminal with the current path
提问by handris
If you give in the command "atom ." in the terminal, the Atom editor opens the current folder and I am ready to code.
如果您输入命令“atom”。在终端中,Atom 编辑器打开当前文件夹,我可以开始编码了。
I am trying to achieve the same with Pycharm using Ubuntu: get the current directory and open it with Pycharm as a project.
我正在尝试使用 Ubuntu 与 Pycharm 实现相同的目标:获取当前目录并使用 Pycharm 作为项目打开它。
Is there way to achieve this by setting a bash alias?
有没有办法通过设置 bash 别名来实现这一点?
回答by masnun
PyCharm can be launched using the charm
command line tool (which can be installed while getting started with PyCharm the first time).
PyCharm 可以使用charm
命令行工具启动(可以在第一次开始使用 PyCharm 时安装)。
charm .
charm .
回答by Ashik
This worked for me:
这对我有用:
pycharm-community .
回答by wim
This works for me:
这对我有用:
alias atom_pycharm='~/pycharm/bin/pycharm.sh .'
Maybe you installed it to a different path, though - locate
your pycharm.sh
file and modify accordingly.
不过,也许您将它安装到了不同的路径 -locate
您的pycharm.sh
文件并相应地进行了修改。
You have the usual bash tricks: if you want to run in the background, append an &
, redirect stdout/stderr where you want etc.
你有常用的 bash 技巧:如果你想在后台运行,附加一个&
,将 stdout/stderr 重定向到你想要的地方等等。
回答by James Yang
For me its:
对我来说:
pycharm.bat .
pycharm.bat 。
but I had to add an Environment Variable first using the path where pycharm.bat is located. In my case it was:
但我必须首先使用 pycharm.bat 所在的路径添加一个环境变量。就我而言,它是:
C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\bin
C:\Program Files\JetBrains\PyCharm 社区版 2019.3.1\bin
(how to add an Environment Variable) Windows https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/
(如何添加环境变量)Windows https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/
Ubuntu https://hackprogramming.com/2-ways-to-permanently-set-path-variable-in-ubuntu/
Ubuntu https://hackprogramming.com/2-ways-to-permanently-set-path-variable-in-ubuntu/
I'm using Pycharm Community Edition 2019.3.1 and for the life of me I couldn't find the "Command line launcher" everyone else is talking about so I had to resort to this method.
我正在使用 Pycharm 社区版 2019.3.1,在我的一生中,我找不到其他人都在谈论的“命令行启动器”,所以我不得不求助于这种方法。
This was for Windows but hopefully it will give you some insight on figuring it out on Ubuntu!
这是针对 Windows 的,但希望它会给你一些关于在 Ubuntu 上解决它的见解!
回答by Sukhdew Gupta
Open your terminal and type:$ cd Desktop/pycharm-community
打开你的终端并输入:$ cd Desktop/pycharm-community