从命令行(终端)启动Pycharm

113

我想尝试使用PyCharm进行Sage数学开发。通常我使用Eclipse进行Sage开发,但现在我想用PyCharm试试。

为了使用Sage环境变量启动Eclipse,在命令行中我通常会执行以下操作:

sage -sh
cd /path/to/eclipse
./eclipse

第一行加载sage环境变量,其余部分启动eclipse。如何在pyCharm中实现相同的功能?(注意,我在Mac和Ubuntu上使用sage进行开发;上述命令与两个操作系统都兼容)
1. 链接1 接近我正在寻找的解决方案,但我无法找到任何 pyCharm.sh 文件。
2. 链接2:Jetbrains也没有给出清晰的说明。

3
在 MacOS 中,你可以通过输入 "charm" 来启动 PyCharm,这与 Yonathan Simson 在 Ubuntu 中提到的行为相同。 - cndv
3
JeBrains没有提供如何做到这一点的说明,即便是两年后。这意味着,使用PyCharm来运行仅限sudo的脚本(例如鼠标钩子)并没有得到JB很好的记录。我并不感到印象深刻。 - code4life
4
有人知道2019年在Windows上如何做这件事吗? - Jesse Reza Khorasanee
23个回答

-1

通过终端(Linux)


使用Bash创建一个函数。
charm() { /usr/local/bin/charm; }
export charm

通过Pycharm

  1. 进入Pycharm
  2. 双击Shift键(Shift + Shift)
  3. 搜索创建命令行启动器
  4. 输入命令行启动器:/usr/local/bin/charm
  5. 点击确定

-1

这对我在我的2017年iMac macOS Mojave(版本10.14.3)上有效。

  1. 打开您的~/.bash_profile: nano ~/.bash_profile

  2. 添加别名: alias pycharm="open /Applications/PyCharm\ CE.app"

  3. 更新终端: source ~/.bash_profile

  4. 确认它是否有效: pycharm


-2

您可以使用 open 命令从Mac终端启动 Pycharm。只需键入 open /path/to/App

Applications$ ls -lrt PyCharm\ CE.app/
total 8
drwxr-xr-x@ 71 amit  admin  2414 Sep 24 11:08 lib
drwxr-xr-x@  4 amit  admin   136 Sep 24 11:08 help
drwxr-xr-x@ 12 amit  admin   408 Sep 24 11:08 plugins
drwxr-xr-x@ 29 amit  admin   986 Sep 24 11:08 license
drwxr-xr-x@  4 amit  admin   136 Sep 24 11:08 skeletons
-rw-r--r--@  1 amit  admin    10 Sep 24 11:08 build.txt
drwxr-xr-x@  6 amit  admin   204 Sep 24 11:12 Contents
drwxr-xr-x@ 14 amit  admin   476 Sep 24 11:12 bin
drwxr-xr-x@ 31 amit  admin  1054 Sep 25 21:43 helpers
/Applications$
/Applications$ open PyCharm\ CE.app/

在macOS 10.13.6上完美运行。 - Sathish

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接