Pregunta

I am trying to make an executable python program on MAC OSX. I used the build applet program and it runs, but I had some data printing in the shell window and the executable file does not open a window. Is there a way to open a shell window with an executable python program?

Thanks

¿Fue útil?

Solución

If you are using Automator to simply run your python script, and you really need it to open a shell window, here is a cheap hack:

Using a simple application with Run Shell Script action:

open -a Terminal /path/to/python/script.py

But if all your application is doing is printing output, all that output would be visible in the Console.app.

Otros consejos

Not sure about generating another shell window, but do you need to have an entire shell open? What about getting the information to the user in a different way, such as:

  • use another Toplevel window and insert the output into a Text or Listbox, rather than simply printing it. This could also make it easier for users to copy the output (if that's something they might find useful).

  • write out a data/log file.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top