Guest User

Untitled

a guest
Mar 20th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. import wx
  2.  
  3. class MyFrame(wx.Frame):
  4. def __init__(self):
  5. wx.Frame.__init__(self, None,
  6. pos=wx.DefaultPosition, size=wx.Size(450,100),
  7. style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
  8. wx.CLOSE_BOX | wx.CLIP_CHILDREN, title="Python Assistan")
  9. panel = wx.Panel(self)
  10. my_sizer = wx.BoxSizer(wx.VERTICAL)
  11. lbl = wx.StaticText(panel)
  12. label="Hi I am Jarvis. How can I help you?"
  13. my_sizer.Add(lbl,0,wx.ALL, 5)
  14.  
  15. self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER, size=(400, 30))
  16. self.txt.SetFocus()
  17. self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
  18.  
  19. my_sizer.Add(self.txt, 0, wx.ALL, 5)
  20. panel.SetSizer(my_sizer)
  21.  
  22. self.Show()
  23.  
  24.  
  25. def OnEnter(self, event):
  26. line = self.txt.GetValue()
  27. line = line.lower()
  28.  
  29.  
  30. if __name__ == "__main__":
  31. app = wx.App(True)
  32. fraem = MyFrame()
  33. app.MainLoop()
  34.  
  35. $ pip install wxPython
  36. Collecting wxPython
  37. Using cached wxPython-4.0.1-cp27-cp27m-macosx_10_6_intel.whl
  38. Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from wxPython)
  39. Installing collected packages: wxPython
  40. Exception:
  41. Traceback (most recent call last):
  42. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/basecommand.py", line 215, in main
  43. status = self.run(options, args)
  44. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/commands/install.py", line 342, in run
  45. prefix=options.prefix_path,
  46. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/req/req_set.py", line 784, in install
  47. **kwargs
  48. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/req/req_install.py", line 851, in install
  49. self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  50. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
  51. isolated=self.isolated,
  52. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
  53. clobber(source, lib_dir, True)
  54. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/wheel.py", line 316, in clobber
  55. ensure_dir(destdir)
  56. File "/Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir
  57. os.makedirs(path)
  58. File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
  59. mkdir(name, mode)
  60. OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/wx'
Add Comment
Please, Sign In to add comment