今天的python編輯器

骷髏解說發表於2020-10-18

我骷髏又回來了!
今天分享的是python編輯器。
“mainloop.py”

from tkinter import *
from tkinter.scrolledtext import ScrolledText
import os as o
import codesss as c
t = Tk()
t.title('Code for Python')
t.geometry('500x500')
def run():
    f = a.get(1.0,'end')
    c.on(f)
a = ScrolledText(t,font=('微軟雅黑',15))
a.grid(row=0,column=0)
w = Label(t,text='這是寫python程式碼的位置。',font=('微軟雅黑',10))
w.grid(row=0,column=1)
a.insert("end","print('Hello World!')\n")
b = Button(t, text='執行',command=run)
b.grid(row=1,column=1)
t.mainloop()

“steptoolone.py”

def on(ons):
    import tkinter as t  
    import os as o
    y = t.Tk()
    y.title('suscribe')
    def suscribe():
        ask = e.get()
        if '.py' in ask:
            ps = ask
            of = open(ps,'w')
            of.write(ons)
            of.close()
        else:
            ps = ask+'.py'
            of = open(ps,'w')
            of.write(ons)
            of.close()
        import codessss as cs 
        import code as c  
        a = c.compile_command(source=ps,filename=ps)
        cs.wand(a)
        o.system(ps) 
    l = t.Label(y, text='檔名:',font=('微軟雅黑',10))
    l.grid(row=0,column=0)
    e = t.Entry(y, font=('微軟雅黑',10))
    e.grid(row=0,column=1)
    b = t.Button(y, text='suscribe',font=('微軟雅黑',10),command=suscribe)
    b.grid(row=1,column=1)
    y.mainloop()

“steptooltwo.py”

def wand(magic):
    import tkinter as t 
    y = t.Tk()
    y.title('Run')
    l = t.Label(y, text=magic, font=('等線Light'))
    l.pack()

今天的文章分享到這裡,拜拜!

相關文章