當前位置:首頁 » 編程語言 » 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自學網。

熱點內容
259pp頁面訪問升級 發布:2024-05-05 21:47:51 瀏覽:88
迅雷阻止上傳 發布:2024-05-05 21:26:19 瀏覽:913
資料庫運維題 發布:2024-05-05 21:21:47 瀏覽:961
RM魔塔編程 發布:2024-05-05 21:21:47 瀏覽:285
matlab獲取文件夾 發布:2024-05-05 21:12:24 瀏覽:291
一根式演算法 發布:2024-05-05 21:12:23 瀏覽:955
php無刷新 發布:2024-05-05 21:08:11 瀏覽:982
搭建一個流媒體伺服器 發布:2024-05-05 20:40:59 瀏覽:667
2017中超資料庫 發布:2024-05-05 20:37:25 瀏覽:379
編程包游戲 發布:2024-05-05 20:25:00 瀏覽:609