wxpython浏览文件(需要代码)
任何人都可以发布一个简单的 wxpython 代码片段,允许用户浏览 *.html 文件,并让 python 程序获取用户浏览到的 .html 文件,并将其移动到我桌面上名为“user-”的文件夹中地点”?我真的需要帮助来制作此浏览功能..非常感谢任何帮助。提前谢谢! :)
Can anybody post up an easy code snippet for wxpython that allows the user to browse for a *.html file and have the python program take that .html file the user browsed to, and move it to a folder on my Desktop called "user-site"? I really need help making this browse feature.. any help is much appreciated. Thx in advance! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您还没有,请下载优秀的 wxPython 演示。在演示的“通用对话框”部分中,有一个 FileDialog 示例,向您展示如何执行第一部分。在以
if dlg.ShowModal() == wx.ID_OK:
开头的块中,您需要类似shutil.move(path, "C:\path\to\your\Desktop \用户站点")
。 (参见 shutil.move())If you don't already have it, download the excellent wxPython demo. In the Common Dialogs section of the demo there is a FileDialog example that shows you how to do the first part. In the block starting with
if dlg.ShowModal() == wx.ID_OK:
you'll need something likeshutil.move(path, "C:\path\to\your\Desktop\user-site")
. (See shutil.move())