我想按照这个教程制作一个CLI应用程序。 https://trstringer.com/easy-and-nice-python-cli/ , 我的文件系统有以下结构。
├── README.md ├── install.sh ├── app ├── __init__.py ├── __main__.py ├── text.txt ├── text1.txt └── text2.json #the app.egg info was created automatically ├── app.egg-info ├── entry_points ├── SOURCES └── setup.py当我从终端调用该应用程序时,我得到了这个错误。 替换代码1】,即使它明显在目录中。 在我试图将脚本转换为CLI应用程序之前,我调用该文本文件的代码是有效的,不知道我是否必须将这些文本文件移到一个特定的目录中,或者明确说明我需要这些文件的地方。
Here setup.py :
from setuptools import setup
setup(
name = 'app',
version = '0.1.0',
packages = ['app'],
entry_points = {
'console_scripts': [
'app = app.__main__:some_function'
如果你需要更多关于代码的信息,或者对如何将我的Python脚本变成一个功能性的CLI应用有其他选择,请不要犹豫,让我知道