简体   繁体   English

如何从另一个目录执行python脚本

[英]How can I execute python scripts from another directory

I am trying to follow a bad instructions website and because of that i'm getting troubles in executing scripts. 我试图遵循一个错误的说明网站,因此我在执行脚本时遇到了麻烦。

The website URL: http://www.tripleoxygen.net/wp/2014/01/sagemcom-modem-fst-2764-gv-power-box-gvt-desbloqueio/ 网站网址: http : //www.tripleoxygen.net/wp/2014/01/sagemcom-modem-fst-2764-gv-power-box-gvt-desbloqueio/

The following commands is the ones i'm getting trouble with: 以下命令是我遇到的问题:

./unlocker.py --mode=install

The steps i'm doing: 我正在做的步骤:

Open CMD
D:(my flash drive directory)
python
unlocker.py --mode=install

What I get: 我得到的是:

File "<stdin>", line 1
SyntaxError: can't assign to operator

but I don't think i'm executing the script, because there is no stdin in the file... So what I'm asking is: 但是我不执行脚本,因为文件中没有标准输入...所以我要问的是:

Are my steps wrong? 我的步骤错了吗?

How can I execute the script correctly from another directory? 如何从另一个目录正确执行脚本?

Thanks in advance. 提前致谢。

That website doesn't say to start python then enter unlocker.py . 该网站没有说要启动python,然后输入unlocker.py It says to type ./unlocker.py from the command prompt, not the Python prompt. 它说从命令提示符而不是Python提示符键入./unlocker.py You may need to do python unlocker.py , but again, you're doing that from the command prompt. 您可能需要执行python unlocker.py ,但是同样,您需要在命令提示符下执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从 cloud composer DAG 中执行 python 脚本吗? - Can I execute python scripts from within a cloud composer DAG? 在Fabric中,如何从另一个python文件执行任务? - In Fabric, how can I execute tasks from another python file? 如何让 Python 脚本在 Windows 10 上打开并执行? - How can I get Python scripts to open and execute on Windows 10? 如何使用 python 将 email 从一个目录移动到另一个目录 - How can I move an email from a directory to another using python 如何从另一个目录运行 Python pipenv? - How can I run a Python pipenv from another directory? 如何在另一个目录中运行 python 脚本,而不将脚本写入磁盘? - How to run python scripts in another directory, without writing scripts to disk? php从另一个目录执行python脚本 - php execute a python script from another directory 如何对目录中的所有文件执行 python 脚本 - How can I execute a python script on all files in a directory 如何使用 Anaconda 的 Python 版本执行 Python 脚本? - How can I execute Python scripts using Anaconda's version of Python? Selenium,使用Python,如何简化脚本,以便可以从其他python脚本运行它们? - Selenium, with Python, how to simplify scripts so that I can run them from other python scripts?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM