Community
    • Login

    notepad++运行python 如何调用 cmder 或 git bash

    Scheduled Pinned Locked Moved General Discussion
    5 Posts 1 Posters 3.4k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wzz xxW Offline
      wzz xx
      last edited by wzz xx

      调用cmd的命令为 cmd /k python “$(FULL_CURRENT_PATH)” & PAUSE & EXIT
      成功运行
      安装cmder后,cmder可以正常使用,但是无法无法通过notepad调用 cmder /k python “$(FULL_CURRENT_PATH)” & PAUSE & EXIT

      更新一下进度,
      /k 的问题解决了,需要变更为 /START
      但是进入cmder后,显示 系统找不到指定的路径
      可以给些参考吗,应该是文件路径的问题,但是目前还有有尝试出有效的方法,不胜感激.

      1 Reply Last reply Reply Quote 0
      • wzz xxW Offline
        wzz xx
        last edited by

        再更新一下进度,有网友说, cmder用的是conemu,可以设置自身环境变量。
        有点不太明白,是需要在 Setting >> Startup >>Environment 里面进行设置的么

        1 Reply Last reply Reply Quote 0
        • wzz xxW Offline
          wzz xx
          last edited by

          刚才又尝试了下,
          cmd /k python “E:\cmder\test.py” & PAUSE & EXIT 这样执行是没有问题的
          cmder /START python “E:\cmder\test.py” & PAUSE & EXIT 这样执行报没有这样的目录
          所以, 运行 里 的命令 是 在cmder中执行的
          在cmder 中执行 python “E:\cmder\test.py” & PAUSE & EXIT 是没有问题的
          分析很可能是 /start 选项的语法问题 , 还没找到相关参考,待续

          1 Reply Last reply Reply Quote 0
          • wzz xxW Offline
            wzz xx
            last edited by

            折腾半天, 通过迂回的方式解决了
            cmder有 task(工作状态)的设定,
            notepad下 运行 命令为 cmder /task “Cmder as Admin”
            task 设定为 *cmd /k python “E:\cmder\test.py” & PAUSE & EXIT -new_console
            这样,点运行,会运行我指定的文件(缺点是不灵活,换了文件就要重新设定命令,目前还不知道 当前目录文件的变量是啥)

            1 Reply Last reply Reply Quote 0
            • wzz xxW Offline
              wzz xx
              last edited by

              问题解决,感谢百度贴吧的 千城真人 吧友 ,
              其原始命令为 C:\downloads\cmder_mini\Cmder.exe /task {cmd::Cmder}&"C:\npMingw64\mingw\bin\python3.exe $(FULL_CURRENT_PATH) &echo "
              因为设置过环境变量, 精简为 cmder /task {cmd::Cmder}&"python $(FULL_CURRENT_PATH) " (后引号前空格不能省)

              详情见链接 https://tieba.baidu.com/p/5877576881

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors