libertynsa.blogg.se

Python text editor and shell in one
Python text editor and shell in one












python text editor and shell in one

'ts':, // start and stop timestamps for session 'sessionid': str, // UUID4 for the session Ncalls tottime percall cumtime percall filename:lineno(function)Ĩ2/1 0.068 0.001 14.579 14.579, // Environment that xonsh was started with Here is some profiling output (pruned for readability), it seems that xonsh spends at least 10 seconds in time.sleep:ĩ8465 function calls (95969 primitive calls) in 14.570 seconds

python text editor and shell in one

It always takes between 12 and 15 seconds. If you want more tutorials like this tell me what here.įull Code: import sys v=sys.version() if "2.7" in v: from Tkinter import * import tkFileDialog elif "3.3" in v or "3.4" in v: from tkinter import * import tkinter.tkFileDialog root=Tk("Text Editor") text=Text(root) id() def saveas(): global text t = text.get("1.0", "end-1c") savelocation=tkFileDialog.asksaveasfilename() file1=open(savelocation, "w+") file1.write(t) file1.close() button=Button(root, text="Save", command=saveas) id() def FontHelvetica(): global text nfig(font="Helvetica") def FontCourier(): global text nfig(font="Courier") font=Menubutton(root, text="Font") id() nu=Menu(font, tearoff=0) font=nu Helvetica=IntVar() arial=IntVar() times=IntVar() Courier=IntVar() _checkbutton(label="Courier", variable=Courier, command=FontCourier) _checkbutton(label="Helvetica", variable=helvetica, command=FontHelvetica) root.I tried xonsh on my 2011 Intel Atom netbook running Archlinux today and noticed the very slow startup times.

python text editor and shell in one

Under the last line you added, add this: def FontHelvetica(): global text nfig(font="Helvetica") def FontCourier(): global text nfig(font="Courier") font=Menubutton(root, text="Font") id() nu=Menu(font, tearoff=0) font=nu helvetica=IntVar() courier=IntVar() _checkbutton(label="Courier", variable=courier, command=FontCourier) _checkbutton(label="Helvetica", variable=helvetica, command=FontHelvetica)Ĭongratulations! You have finished a very simple text editor.














Python text editor and shell in one