首页 > 解决方案 > Usage examples show input to a python function that isn't separated by commas?

问题描述

I am trying to get a bit of code that I found online to work with the usage examples given in the README.md file. The intention of the tools are to synthesize an audio scene out of separate events.I cannot figure out how to run the usage examples given, which are:

  * ./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

I've tried running these lines on the terminal (I am using PyCharm) but the error is that "simscene.py is not recognized as an internal or external command, operable program or batch file", even if I try to run "simscene.py" alone with no inputs.

I've been able to get the function simscene to run from another script by importing it, but then run into errors. It looks like the file simscene.py uses lines of argparse to prompt the user, but I can't seem to activate these prompts to start running.

How do the usage examples relay the specified inputs to the function, and how might I be able to run the usage examples?

The link to the entire project is here: https://bitbucket.org/mlagrange/simscene/src/master/python/

标签: pythonargparse

解决方案


It's probably asking you to run the file with the python interpreter, i.e. if you are in the directory,

python simscene.py -h

should probably run the first example. I assume they didn't include the python part, because people could have different variants (python3, numba, etc)


推荐阅读