Equivalent to Unix eval in Windows

后端 未结 2 1417
轻奢々
轻奢々 2020-12-16 17:28

Was wondering how you\'d do the following in Windows:

From a c shell script (extension csh), I\'m running a Python script within an \'eval\' method so that the outpu

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 17:55

    If it's in cmd.exe, using a temporary file is the only option [that I know of]:

    python -c "print(\"Hi\")" > temp.cmd
    call temp.cmd
    del temp.cmd
    

提交回复
热议问题