能不能晒下各位用Python最好是wxpython做的界面,自己做的实在太丑了。。。
不好意思拿出来
能不能看看各位做的,给我点信心
[解决办法]
我就做过两个,界面也很简陋。第一次做的在这里:
http://code.google.com/p/lua-debugger/
后来那个在公司里用的,就不发了。
[解决办法]
看标题啊,lua debugger。我的图标都是抄的。比如工具栏的小图标都是从eclipse里找的。我是不会做UI的,搞点简单的东西都十分不爽。
[解决办法]
刚刚用Delphi写了一个Python的插件模块,现在可以用这个模块用Delphi的开发方式来写Python的GUI脚本了!
可以下载试试!地址
用法如下:
#-*-coding: gbk-*-from DxVcl import *class MainForm(Form): def __init__(self, Owner): self.Caption = "A Delphi Form..." self.SetBounds(10, 10, 500, 400) self.Btn = Button(self) self.Btn.SetProps(Parent=self, Caption="测试说明") self.Btn.SetBounds(10, 44, 100, 64) self.lblHello = Label(self) self.lblHello.SetProps(Parent=self, Caption="Hello World") self.lblHello.SetBounds(10, 10, 80, 24) self.OnClose = self.MainFormClose self.Btn.OnClick = self.BtnClick def BtnClick(self,Sender): self.Caption = "测试不得闲" ShowMessage(StrToHex(self.Caption)) ShowMessage(''.join(['16进制转换回来:',HexToStr(StrToHex(self.Caption))])) ShowMessage(IntToStr(234234)) def MainFormClose(self, Sender, Action): Action.Value = caFree class DxLogForm(Form): def __init__(self,Owner): self.Caption = '不得闲测试窗体' self.Position = 5 self.BorderStyle = 3 self.Width = 234 self.Height = 150 self.lb1 = Label(self) self.lb1.SetProps(Parent = self,Caption = '用户') self.lb1.SetBounds(40,16,28,13) self.EdtUser = Edit(self) self.EdtUser.SetProps(Parent = self,Text = 'dxsoft') self.EdtUser.SetBounds(77,13,121,21) self.lb2 = Label(self) self.lb2.SetProps(Parent = self,Caption = '密码') self.lb2.SetBounds(40,48,28,13) self.EdtPwd = Edit(self) self.EdtPwd.SetProps(Parent = self,Text = 'dxsoft',PasswordChar='*') self.EdtPwd.SetBounds(77,45,121,21) self.BtnLog = Button(self) self.BtnLog.SetProps(Parent = self,Caption = '登录') self.BtnLog.SetBounds(25,80,75,25) self.BtnLog.OnClick = self.BtnClick self.BtnCancel = Button(self) self.BtnCancel.SetProps(Parent = self,Caption = '取消') self.BtnCancel.SetBounds(141,80,75,25) self.BtnCancel.OnClick = self.BtnCancelClick def BtnClick(self,Sender): if self.EdtPwd.Text.decode('gbk') == '123': ShowMessage('登录成功,打开主窗体') #self.visible = false #打开另一个窗体 self.ModalResult = mrok else: ShowMessage('密码为123') def BtnCancelClick(self,Sender): self.Close() def dolog(): LogFrm = DxLogForm(None) m = LogFrm.ShowModal() == mrok LogFrm.Free() return mdef main(): FreeConsole() if dolog(): Application.Initialize() Application.Title = 'TestApp' f = MainForm(Application) f.Show() Application.Run() else: ShowMessage('用户取消了登录') if __name__=='__main__': main()
[解决办法]
具体说明参考这里
这里使用此模块实现了一个最最最简单的记事本
等有时间的时候,再写一个界面设计器,就完美了!
[解决办法]
都挺好的!
可以说,我基本没有开发过GUI程序。
[解决办法]
你去下载wxPython的Demo 里面有很多东西,看了你就有信心了。布局问题就练练各种sizer唄。
[解决办法]
你看看我博客里面的界面,我觉得还是挺好看的。
http://xiao1123.blog.163.com/
如果你也用boa的话,我们交流交流吧。