예제 #1
0
def save2(c=0):
    try:
        global cfile
        filename = cfile
        fi = open(filename, "w")
        fi.write(txt.get("1.0", END))
        fi.close()
    except:
        print("error bad file")
예제 #2
0
def esave2(c=0):
    try:
        global cfile
        filename=fi.asksaveasfilename(title = "Select file to save",filetypes = (("python 3.5 files","*.py"),("all files","*.*")))
        fi=open(filename,"w")
        fi.write(ccdoe.encypt(e,txt.get("1.0",END)))
        fi.close()
    except:
        print("error bad file")
예제 #3
0
def run(x=0, d=2):
    global cfile
    fi = open("runaction.py", "w")
    fi.write(txt.get("1.0", END))
    fi.close()
    r = open("runaction.py", "r")
    exec(r.read())

    txt2.insert(END, "run:" + t.asctime() + cfile)
    r.close()
예제 #4
0
def run():

    fi = open("runaction.py", "w")
    fi.write(txt.get("1.0", END))
    fi.close()
    r = open("runaction.py", "r")
    exec(r.read())

    txt2.insert(END, "run:" + t.asctime() + r.name)
    r.close()
예제 #5
0
def upload(destpath, srcpath):
    if not os.path.exists(srcpath):
        print("ERROR: No this file!\n")
        message = messagebox.showwarning(title="warning",
                                         message="ERROR: No this file!")
        pass
    sfp = open(srcpath, "r", encoding="utf-8")
    contents = sfp.read()
    sfp.close()

    createfile(destpath)
    fd = open(destpath, mode="w", encoding="utf-8")
    fd.write(contents)
    fd.close()
예제 #6
0
def createfile(path):  # 创建文件

    fd = open(path, mode="w", encoding="utf-8")
    fd.close()
    return fd