Skip to content

Instantly share code, notes, and snippets.

@SimonTheCoder
Created March 20, 2022 05:32
Show Gist options
  • Save SimonTheCoder/74948b022f016840e0dd9ad9be0e2223 to your computer and use it in GitHub Desktop.
Save SimonTheCoder/74948b022f016840e0dd9ad9be0e2223 to your computer and use it in GitHub Desktop.
Start a new terminal window from python
# def xterm():
# from tkinter import *
# import os
# root = Tk()
# termf = Frame(root, height=400, width=500)
# termf.pack(fill=BOTH, expand=YES)
# wid = termf.winfo_id()
# os.system('xterm -into %d -geometry 40x20 -sb &' % wid)
# root.mainloop()
import os
print(os.name)
if os.name == "nt":
ret = os.popen("start /wait cmd /c ipython3 ./angr_util.py -i -- hahahaha")
print(ret.read())
else:
ret = os.popen("gnome-terminal -- ipython3 ./angr_util.py -i -- hahahaha")
print(ret.read())
print("it's over.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment