728x90
test.yaml
0.00MB
yml_sample4.pyw
0.00MB
import yaml
import wx
import os,sys
doc = yaml.load(open('test.yaml', 'r'))
strs = doc['strs']
for s in strs:
print(s) # a, b, c
if __name__ == '__main__':
app = wx.PySimpleApp()
dlg = wx.SingleChoiceDialog(None,
'What version of Python are you using?',
'Single Choice',
strs,
wx.CHOICEDLG_STYLE)
if dlg.ShowModal() == wx.ID_OK:
response = dlg.GetStringSelection()
print(response)
dlg.Destroy()
app.MainLoop()
결과
728x90
'개발자 모드 > 파이썬(python)' 카테고리의 다른 글
파이썬 yml / SingleChoiceDialog / 조건문 (0) | 2021.05.20 |
---|---|
파이썬 UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 23: illegal multibyte sequence 에러 시... (0) | 2021.05.20 |
파이썬 wx.SingleChoiceDialog 예제 (1) | 2021.05.19 |
파이썬 wxPython 설치 하는법 (0) | 2021.05.19 |
파이썬 module 응용하기 (0) | 2021.05.19 |