Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增功能:如根目录没有对应的启动脚本,执行默认命令 #54

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

yunluo
Copy link

@yunluo yunluo commented Aug 27, 2023

当根目录不存在以下文件

  • _pystand_static.int
  • pystand.int
  • pystand.py
  • pystand.pyw
    且存在app目录时,会尝试运行以下python代码
    from app import run
    run()
    以上代码失败会弹窗报错

image
↑正常启动
image
↑不存在启动脚本也不存在app模块时报错
image
↑导入app模块但无run函数,启动报错

@yunluo
Copy link
Author

yunluo commented Aug 27, 2023

以上其实就是一个commit,只是手贱写错字导致的多次提交

@Sadwy
Copy link

Sadwy commented Aug 27, 2023

我想要请教一个问题:

  1. 当run函数位于app文件夹里时, run函数还能够调用site-packages文件夹里的第三方模块吗? 我记得python里不能调用父文件夹中的模块.
    1.1. 看到你的截图里调用了os模块, 请问你将该模块放在app文件夹里了, 还是放在site-packages文件夹里?

@yunluo
Copy link
Author

yunluo commented Aug 27, 2023

我想要请教一个问题:

  1. 当run函数位于app文件夹里时, run函数还能够调用site-packages文件夹里的第三方模块吗? 我记得python里不能调用父文件夹中的模块.
    1.1. 看到你的截图里调用了os模块, 请问你将该模块放在app文件夹里了, 还是放在site-packages文件夹里?

你搞错了, 我的程式入口还是根目录, app只是我的一个包, run函数虽然是在run目录里面, 但是inport app 执行run 的还是在根目录,这个其实就是类似你在根目录写一个只有inport app app.run()的 int脚本

image
↑ 如图,app目录下目前只有__init__.py文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants