【发布时间】:2020-08-04 21:51:39
【问题描述】:
我正在尝试获取一些我在网上找到的代码来处理 README.md 文件中给出的使用示例。这些工具的目的是从单独的事件中合成音频场景。我不知道如何运行给出的使用示例,它们是:
* ./simscene.py -h
Displays command line syntax and option descriptions.
* ./simscene.py example/sound/ output/ 10 -e example/forest_events.xls -b example/forest_backgrounds.xls -N 10 -v
Creates wavefiles and plots of 10 instances of scenes for which events are described in example/forest_events.xls and
background sounds in example/forest_backgrounds.xls
我尝试在终端上运行这些行(我正在使用 PyCharm),但错误是“simscene.py 未被识别为内部或外部命令、可运行程序或批处理文件”,即使我尝试单独运行“simscene.py”,无需输入。
我已经能够通过导入函数 simscene 从另一个脚本运行它,但随后遇到错误。看起来文件 simscene.py 使用 argparse 行来提示用户,但我似乎无法激活这些提示以开始运行。
用法示例如何将指定的输入传递给函数,以及我如何能够运行用法示例?
整个项目的链接在这里: https://bitbucket.org/mlagrange/simscene/src/master/python/
【问题讨论】:
-
使用
python或python3运行python 文件。它不是可执行文件。 -
这种运行脚本的方式适用于 Unix,而不是 Windows。