1.Python tkinter
tkinter模块是python 中的自带GUI模块(Lunix系统中需要自己用pip下载),可以快速的编写微型的GUI程序。用法简单易上手。通过自带的各种插件如插积木般拼凑出GUI界面,本文我用它作为开发IDE图形界面的模块。
注:#################GUI就是图形界面程序####################
2.C++
我用C++编写控制台程序,用来处理文件及cmd操作(用的也是标准库,不用下载安装任何第三方库文件)
所以只需要下载C++编译器,以及Python就可以开工了^_^
代码直接列上*_*
3.Python 代码
from tkinter import *
import tkinter.filedialog as ftk
import subprocess
from tkinter import messagebox
def Run():
file()
subprocess.Popen("maker.exe")
def bianyi():
def chu():
zi=zhiling.get()
f=open("zhiling.txt","w")
f.write(zi)
f.close()
w=Tk()
w.title("建立指令")
w.iconbitmap("Food.ico")
w.geometry("300x150")
w.config(background="black")
#tixing=Lable(w,text="请您输入创建的指令",bg="black",fg="#32CD32")
#tixing.pack()
zhiling=Entry(w,font=("微软雅黑",15),bg="black",fg="#008FFF")
zhiling.pack()
pan=Button(w,font=("微软雅黑",15),text="确定",bg="black",fg="#008FFF",command=chu)
pan.pack()
w.mainloop()
def out():
name = ftk.askopenfilename()
cheng = open(name)
wen = cheng.read()
cheng2=open("name.txt","w")
cheng2.write(name)
cheng.close()
cheng2.close()
text.delete("1.0","end")
text.insert("1.0", wen)
def file():
name2=ftk.asksaveasfilename()
cheng2=open(name2,"w")
chu=text.get("1.0",'end')
cheng2.write(chu)
cheng3 = open("name.txt", "w")
cheng3.write(name2)
cheng3.close()
cheng2.close()
def back():
text.edit_undo()
def regain():
text.edit_redo()
def show():
messagebox.showinfo(title='CYF', message='欢迎使用CYF IDLE 1.0,本产品由程煜峰开发')
def build():
subprocess.Popen("IDE.exe")
#main
root=Tk()
root1=Tk()
root.title("CYF-Pro IDLE")
root.geometry("600x450+100+200")
root.iconbitmap("Food.ico")
root.config(background="black")
##################################
root1.title("Creat Window")
root1.geometry("600x40+100+100")
root1.iconbitmap("Food.ico")
root1.config(background="black")
#root.attributes("-alpha",0.9)
#ico=tk.PhotoImage(file="Food.ico")
#wen=Label(root,font=("微软雅黑",15),bg="grey",fg="white",text="01")
#wen.pack()
text=Text(root,insertbackground="orange",font=("微软雅黑",15),bg="black",fg="#32CD32",height=1000,autoseparators=True,undo=True)
text.pack(fill=X)
anniu1=Button(root1,text="Open",font=("微软雅黑"),bg="black",fg="#008FFF",command=out)
anniu1.grid(row=0,column=0)
anniu2=Button(root1,text="Setting",font=("微软雅黑"),bg="black",fg="#008FFF",command=bianyi)
anniu2.grid(row=0,column=1)
anniu3=Button(root1,text="Save",font=("微软雅黑"),bg="black",fg="#008FFF",command=file)
anniu3.grid(row=0,column=2)
anniu4=Button(root1,text="Run",font=("微软雅黑"),bg="black",fg="#008FFF",command=Run)
anniu4.grid(row=0,column=3)
anniu5=Button(root1,text="Back",font=("微软雅黑"),bg="black",fg="#008FFF",command=back)
anniu5.grid(row=0,column=4)
anniu6=Button(root1,text="Regain",font=("微软雅黑"),bg="black",fg="#008FFF",command=regain)
anniu6.grid(row=0,column=5)
mmenu=Menu(root)
filemenu=Menu(mmenu,tearoff=True)
filemenu2=Menu(mmenu,tearoff=True)
filemenu.add_command(label=" 新建 ",command=build)
filemenu.add_command(label=" 打开 ",command=out)
filemenu.add_command(label=" 保存 ",command=file)
filemenu.add_command(label=" 退出 ",command=root.quit and root1.quit)
filemenu2.add_command(label=" 撤销 ",command= back)
filemenu2.add_command(label=" 恢复 ",command= regain)
mmenu.add_cascade (label="文件",menu=filemenu)
mmenu.add_cascade (label="编辑",menu=filemenu2)
mmenu.add_command (label="运行",command=Run)
mmenu.add_command (label="查看")
mmenu.add_command (label="帮助",command=show)
root.config (menu=mmenu)
root.mainloop()
root1.mainloop()
看似很简单&_&
4.C++代码
// g++.exe "C:/Users/Administrator/Documents/duck/aaa.cpp" -o "C:/Users/Administrator/Documents/duck/aaa.exe" -g3 -pipe -Wall -Wextra -lgraphics -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
string shuzu[100],wenjian;
string mingling,mingling2;
char c[100],a[100],b[100];
ifstream kaishi,name1,zhi;
zhi.open("zhiling2.txt");
zhi>>mingling2;
for(int i;i<=mingling2.length();i++)
{
b[i]=mingling2[i];
}
system(b);
kaishi.open("zhiling.txt");
for(int i;i<=100;i++)
{
kaishi>>shuzu[i];
if(shuzu[i]=="wen")
{
name1.open("name.txt");
name1>>wenjian;
shuzu[i]=wenjian;
}
if(shuzu[i]=="wen2")
{
name1.open("name.txt");
name1>>wenjian;
shuzu[i]=wenjian+".exe";
}
}
kaishi.close();
for(int i;i<=100;i++)
{
mingling=mingling+shuzu[i]+" ";
}
for(int i;i<=mingling.length();i++)
{
a[i]=mingling[i];
}
system(a);
wenjian+=".exe";
for(int i;i<=wenjian.length();i++)
{
c[i]=wenjian[i];
}
system("cls");
system(c);
return 0;
}
5.打包python文件
直接用pyinstaller打包成可执行文件即可,格式为pyinstaller python文件绝对路径,就完成了。
这里是我的成品链接可以下载使用=_=
https://download.youkuaiyun.com/download/dadongdong2008/88222325
*******谢谢大家阅读*******