1

I've used Tkinter or wxWidgets for some projects: this opens a new window in graphical mode (GUI) in which you can do what you want.

Can I ask Python to open a new text-mode window (let's say 80x25 terminal), independant from the terminal where I run myscript.py, in the same way that a Tkinter window is independant from the current terminal where I run myscript.py?

What do I want to achieve? Having a GUI, but in textmode! (this might sound tricky because G in GUI means graphical!)

Does tkInter, wxWidget, pyglet, etc. have a feature to open a text-mode terminal-look GUI? With 80x25 text display?

Basj
  • 41,386
  • 99
  • 383
  • 673
  • Does using xterm work for your purposes? http://stackoverflow.com/a/7331836/4131059 – Alex Huszagh Dec 20 '15 at 21:12
  • No it should be crossplatform (including Windows) – Basj Dec 20 '15 at 21:15
  • do you mean [curses](https://docs.python.org/2/library/curses.html) or [urwid](http://urwid.org/) ? – furas Dec 20 '15 at 21:21
  • Doesn't seem to work for Windows, see Requirements on http://urwid.org/ – Basj Dec 20 '15 at 21:30
  • 1
    You may have to do it differently on windows (maybe run 'start cmd.exe' but I'm not sure). But that's just a quick `if platform.system() == 'Windows'`. – tdelaney Dec 20 '15 at 22:29
  • Then I should re-phrase: does using the default command prompt and embedding it in a widget work for your application? – Alex Huszagh Dec 21 '15 at 00:46
  • If you're really just looking to make a cross platform text UI, is [asciimatics](https://github.com/peterbrittain/asciimatics) any use for you? – Peter Brittain Jul 25 '16 at 16:18

1 Answers1

0

For this you will need to make a seperate script but it works.

Use this code in your launcher script.

from sys import executable
from subprocess import Popen, CREATE_NEW_CONSOLE

Popen([executable, 'myscript.py'], creationflags=CREATE_NEW_CONSOLE)

input('Enter to exit from this launcher script...')

Source

Community
  • 1
  • 1
Jonah Fleming
  • 1,187
  • 4
  • 19
  • 31