当前位置:首页 » 编程语言 » python的wx

python的wx

发布时间: 2022-06-12 06:46:32

❶ 关于python 的wxphton gui设计里的

参考下面代码,OnClick里面可以获得button对象,然后取得其位置:
'''
Created on 2011-10-13

@author: legendxx
'''
import wx

class ButtonFrame(wx.Frame):
btnno=0
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Button Example',
size=(200, 200))
self.panel = wx.Panel(self, -1)
for i in range(0,3):
text="Button"+str(i+1)
button = wx.Button(self.panel, -1, text, pos=(50, 20+i*50))
self.Bind(wx.EVT_BUTTON, self.OnClick, button)
# self.button.SetDefault()

def OnClick(self, event):
btn=event.GetEventObject()
print btn.GetPosition()

info="button postion:"+str(btn.GetPosition())

wx.MessageBox( info,'postion Info',
wx.OK | wx.ICON_INFORMATION)
# self.AddBtn()

if __name__ == '__main__':
app = wx.PySimpleApp()
frame = ButtonFrame()
frame.Show()
app.MainLoop()

❷ python wx 怎么设置菜单

你可以使用tkinter这个python自带的gui库,完全跨平台,可以满足你的需求。 import tkinter 如果解决了您的问题请采纳! 如果未解决请继续追问

❸ python wx.frame 和wx.panel 的区别

wxApp -> wxFrame -> wxPanel -> wxSizer -> wxControl
Frame vs. Panel
Use a frame when you need a window for your application; Use a panel (within that frame) to place other widgets onto. Don't place (most) widgets right onto the frame itself; there are some problems with that. You can and often will use multiple panels within the same frame.
当需要为应用程序创建窗口时使用框架;要向上放置其他部件时使用框架内的面板。
别直接在框架上放置过多部件,那样会带来一些问题。
在同一个框架内可以使用多个面板。

❹ python中gui编程wx,事件函数怎样调用

可以用Bind方法
self.Bind(wx.EVT_BUTTON,self.OnAppend,button)

self是继承frame的类
OnAppend是定义的事件函数
button是在frame里增加的按钮

这里有详细介绍
http://study.163.com/course/courseMain.htm?courseId=1263029

❺ python wx.app有什么用

这是wx的应用程序对象,只有在这个对象创建以后,相应的UI对象才可以被正确初始化。
一般最后一句是 app.MainLoop(),形成消息循环,否则程序将直接退出。

❻ Python做wx公众号需要掌握什么知识

想做Python相关的公众号,那么一定要具备两方面的知识。
首先,对公众号运营方面的知识,相关的运营规则,发文技巧等等;
其次就是Python相关的知识,一定要有所了解。目前做Python公众号的人很多,但是做的特别好的没有几个,所以想要做好Python公众号首先一定要定好位。建议可以看一下优就业Python工程师 这个公众号。

❼ python wx怎么下载安装急求!!!

都有现成的安装包。你先装python ,然后去这里 http://sourceforge.net/projects/wxpython/files/wxPython/
下载对应你python版本的wxPython 然后安装,ok了。

❽ 通过自制的Python Wx问题,怎么解决

在github上下载了,安装了之后在idle上运行,好像是说Python不能上网。新手求助。现在问题已经解决,是ssl 证书的问题,不能用最新的
复制内容到剪贴板
代码:
sudo pip uninstall -y certifi

sudo pip install certifi==2015.04.28
>>> bot=Bot()
Traceback (most recent call last):
File "D:\Python34\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "D:\Python34\lib\site-packages\urllib3\connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "D:\Python34\lib\site-packages\urllib3\connectionpool.py", line 844, in _validate_conn
conn.connect()
File "D:\Python34\lib\site-packages\urllib3\connection.py", line 326, in connect
ssl_context=context)
File "D:\Python34\lib\site-packages\urllib3\util\ssl_.py", line 325, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "D:\Python34\lib\ssl.py", line 365, in wrap_socket
_context=self)
File "D:\Python34\lib\ssl.py", line 583, in __init__
self.do_handshake()
File "D:\Python34\lib\ssl.py", line 810, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python34\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "D:\Python34\lib\site-packages\urllib3\connectionpool.py", line 630, in urlopen
raise SSLError(e)
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python34\lib\site-packages\itchat\utils.py", line 124, in test_connect
r = requests.get(config.BASE_URL)
File "D:\Python34\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "D:\Python34\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Python34\lib\site-packages\requests\sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "D:\Python34\lib\site-packages\requests\sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "D:\Python34\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
You can't get access to internet or wechat domain, so exit.

❾ python的 wxpython函数错误

>>> import Image
>>> dir(Image)
['ADAPTIVE', 'AFFINE', 'ANTIALIAS', 'BICUBIC', 'BILINEAR', 'CONTAINER', 'CUBIC', 'DEBUG', 'EXTENSION', 'EXTENT', 'FLIP_LEFT_RIGHT', 'FLIP_TOP_BOTTOM', 'FLOYDSTEINBERG', 'ID', 'Image', 'ImageMode', 'ImagePalette', 'ImagePointHandler', 'ImageTransformHandler', 'IntType', 'LINEAR', 'MESH', 'MIME', 'MODES', 'NEAREST', 'NONE', 'NORMAL', 'OPEN', 'ORDERED', 'PERSPECTIVE', 'QUAD', 'RASTERIZE', 'ROTATE_180', 'ROTATE_270', 'ROTATE_90', 'SAVE', 'SEQUENCE', 'StringType', 'TupleType', 'UnicodeStringType', 'VERSION', 'WEB', '_E', '_ENDIAN', '_ImageCrop', '_MAPMODES', '_MODEINFO', '_MODE_CONV', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_conv_type_shape', '_fromarray_typemap', '_getdecoder', '_getencoder', '_getscaleoffset', '_imaging_not_installed', '_initialized', '_show', '_showxv', '_wedge', 'blend', 'byteorder', 'composite', 'core', 'eval', 'fromarray', 'frombuffer', 'fromstring', 'getmodebandnames', 'getmodebands', 'getmodebase', 'getmodetype', 'init', 'isDirectory', 'isImageType', 'isNumberType', 'isSequenceType', 'isStringType', 'isTupleType', 'merge', 'new', 'open', 'os', 'preinit', 'register_extension', 'register_mime', 'register_open', 'register_save', 'string', 'sys', 'warnings']

我这边是1.1.7的版本,是没有的

❿ 用python可以做微信小程序吗

其实微信小程序作为一个前端的机制,Python并不能插上边。只不过可以作为后端接口为微信小程序提供数据服务而已。python可以做后端服务和小程序通讯,python可以写后端平台,提供api,微信小程序就用wx.request()调用这个api。

微信小程序主要的三大块wxml控制页面结构、wxss控制页面样式、js控制页面逻辑。

如果创建的是一个不需要后端服务器支持的微信小程序,那么与Python就没什么关系了。

如果需要后端传送接收处理数据,那么后端就还有Python的用武之地,可以用Python的Web框架写一个后端接口供小程序进行调用。

更多Python知识请关注Python自学网。

热点内容
数据库access2003 发布:2024-05-19 02:49:39 浏览:619
碧蓝航线pc挂机脚本 发布:2024-05-19 02:30:03 浏览:588
脚本fir 发布:2024-05-19 02:28:57 浏览:260
阿里云独享服务器 发布:2024-05-19 02:23:54 浏览:253
织梦源码ga 发布:2024-05-19 02:23:20 浏览:571
java文件名后缀 发布:2024-05-19 02:14:39 浏览:956
快手点榜脚本 发布:2024-05-19 02:08:44 浏览:163
pythonforinkeys 发布:2024-05-19 01:55:44 浏览:793
电脑如何局域网共享文件夹 发布:2024-05-19 01:25:01 浏览:69
手机存储越大性能越好吗 发布:2024-05-19 01:14:28 浏览:177