Python 得到一个 python 脚本 运行 而另一个是 运行?

Python get a python script running while another is running?

我一直在努力做一个私人助理。几天前我做了一个闹钟,但它的工作原理就像是在测试日期是否与实际时间相同。我的问题是我也会在检查闹钟时使用主脚本。但是有没有办法做到这一点?像模块系统或其他东西?

两个解决方案,线程

https://en.wikibooks.org/wiki/Python_Programming/Threading

或者像 gevent 这样的异步

http://sdiehl.github.io/gevent-tutorial/