Re: PyObjC and Criollo HTTP server
Ronald Oussoren via Pythonmac-SIG <[email protected]> Thu, 9 Jan 2020 10:18:01 +0100
| Newsgroups | gmane.comp.python.apple |
|---|---|
| Message-ID | <[email protected]> |
> On 9 Jan 2020, at 00:23, Rand Dvorak <[email protected]> wrote: > > I got it working. Basically I have a main.py file in Resources that get loaded and run by PyRun_SimpleFile in applicationDidFinishLaunching. Control is then passed to the python interpreter. Notice the infinite loop at the bottom which is needed because the interpreter finishes executing the file and exits. It is needed to keep the python interpreter alive. I need a better solution to keep the interpreter alive because this eats up too much cpu. It was just a hack to prove that is what was happening. I’ve quickly scanned https://github.com/thecatalinstan/Criollo/wiki/Getting-Started and that seems to indicate that the webserver integrates with the regular Cocoa event loop. That means you’ll probably need to run the NSRunloop or CFRunloop. Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ _______________________________________________ Pythonmac-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG