Inheritance problem. Creating an instance.
#!/usr/bin/env python # -*- coding: utf-8 -*- # Name: Sleepy Hollow # Author: .nu import wx import os import sys NEW_ID = 1; OPEN_ID = 2; SAVE_ID = 3; SAVE_AS_ID = 4; QUIT_ID = 5; UNDO_ID = 6; REDO_ID = 7; HELPME_ID = 8; ABOUT_ID = 9; OPTIONS_ID = 10 APP_NAME = 'Sleepy Hollow' class SleepyHollow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(600, 400)) self.SetTitle(APP_NAME) # create sizers self.vbox = wx.BoxSizer(wx.VERTICAL) # create instance of the NoteBook class, then put a tab on it self.notebook = NoteBook(self) self.notebook.createTab() # Create items(statusbar, number panel, etc) self.statusbar = self.CreateStatusBar() #self.statusbar.Hide() #wx.EVT_KEY_UP(self.textarea, self.key_press) # Call methods that can be turned on/off through options self.statusbar_toggle(self, 0) #self.hbox.Add(self.textarea, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) #self.vbox.Add(self.hbox, 1, wx.EXPAND, 0) #self.SetAutoLayout(True) self.Layout() ## Menu self.menubar = wx.MenuBar() self.SetMenuBar(self.menubar) self.file = wx.Menu() self.new = wx.MenuItem(self.file, NEW_ID, 'new') self.file.AppendItem(self.new) self.open = wx.MenuItem(self.file, OPEN_ID, '&Open\tCtrl+O') self.file.AppendItem(self.open) self.file.AppendSeparator() self.save = wx.MenuItem(self.file, SAVE_ID, '&Save\tCtrl+S') self.file.AppendItem(self.save) self.saveas = wx.MenuItem(self.file, SAVE_AS_ID, '&Save as\tCtrl+Shift+s') self.file.AppendItem(self.saveas) self.file.AppendSeparator() self.quit = wx.MenuItem(self.file, QUIT_ID, '&Quit') self.file.AppendItem(self.quit) self.edit = wx.Menu() self.undo = wx.MenuItem(self.edit, UNDO_ID, '&Undo\tCtrl+z') self.edit.AppendItem(self.undo) self.redo = wx.MenuItem(self.edit, REDO_ID, '&Redo\tCtrl+Shift+z') self.edit.AppendItem(self.redo) self.edit.AppendSeparator() self.options = wx.MenuItem(self.edit, OPTIONS_ID, '&Options\tCtrl+p') self.edit.AppendItem(self.options) self.help = wx.Menu() self.helpme = wx.MenuItem(self.help, HELPME_ID, '&Help\tF1') self.help.AppendItem(self.helpme) self.about = wx.MenuItem(self.help, ABOUT_ID, '&About\tF2') self.help.AppendItem(self.about) self.menubar.Append(self.file, '&File') self.menubar.Append(self.edit, '&Edit') self.menubar.Append(self.help, '&Help') # bind items to functions self.Bind(wx.EVT_MENU, self.New, id=NEW_ID) self.Bind(wx.EVT_MENU, self.Open, id=OPEN_ID) self.Bind(wx.EVT_MENU, self.Save, id=SAVE_ID) self.Bind(wx.EVT_MENU, self.Saveas, id=SAVE_AS_ID) self.Bind(wx.EVT_MENU, self.Undo, id=UNDO_ID) self.Bind(wx.EVT_MENU, self.Redo, id=REDO_ID) self.Bind(wx.EVT_MENU, self.Helpme, id=HELPME_ID) self.Bind(wx.EVT_MENU, self.About, id=ABOUT_ID) self.Bind(wx.EVT_MENU, self.Quit, id=QUIT_ID) self.Bind(wx.EVT_MENU, self.Options, id=OPTIONS_ID) ## Random variables self.fileName = '' self.dirName = '' self.tempFileName = '' self.tempDirName = '' self.oldPos = -1 self.show_position(self) ## Menu Methods def New(self, event): self.popup(self, "Would you like to save this file before starting a new one?", "Save?", wx.YES | wx.NO | wx.ICON_QUESTION) #self.textarea.SetValue('') self.notebook.createTab() def Open(self, event): open_dialog = wx.FileDialog(self, "Open", self.dirName, self.fileName, "Text Files (*.txt)|*.txt|All Files|*.*", wx.OPEN) # If open_dialog opens, try to get dirName and fileName, and open it in the textarea if (open_dialog.ShowModal() == wx.ID_OK): try: self.tempDirName =
make a folder to .nsi file(which finally will convert to .exe) use python
Has any python liberary can make a folder to .nsi file? Thanks -- http://mail.python.org/mailman/listinfo/python-list
how to sync file on client and server
I want to sync the file foder in different server,and I can't use ftp protocl. I try to sync files during defferent server and not use username and password to login. Anyone has good ideas? -- http://mail.python.org/mailman/listinfo/python-list
Re: pylagiarism -- Need help now! Please provide code...
Haha. Best listserv ever. I've been on this list a day, and run me over with a lawnmower if I've written more than 200 lines of Python code, but this list is totally worth it. -- http://mail.python.org/mailman/listinfo/python-list
Re: pylagiarism -- Need help now! Please provide code...
Lol. Lol. Lol. It just keeps on givin'. From: Anoop Thomas Mathew To: Simon Cropper Cc: python-list@python.org Sent: Tuesday, August 14, 2012 12:11 AM Subject: Re: pylagiarism -- Need help now! Please provide code... On 14 August 2012 12:04, Simon Cropper wrote: Hi Everyone, > >I just had a great idea for a new python module. I haven't bothered googling >it or doing any research. > >I need help putting together some code; today preferably, my boss is on my >back. Can someone please contribute a functioning module showing me how to do >it? > >Once I have all your submissions, I will compile a functioning package, which >I hope to sell. Don't worry, no one will be at risk of being sued, I don't >intend to credit you with the code and you will not know anything about what I >have done because I don't intend to post and feedback to the list. Licenses >are not a problem either, I don't believe in them and even if you find out I >have plagiarized your stuff you have bub-kiss chance of suing me as I am in >another jurisdiction. > >So, now you know where I am coming from, I would like to thank you for all >your help. Remember though, I need help now, so please stop what you are doing >and submit something quickly. I'm waiting... > >Still waiting... > >Hey, stop reading and get on with writing some code, I don't have all day! Let the boss wait. Learn some mailing list etiquette first. It will help you for sure. > >-- >Simon > >Disclaimer :) Please don't flame me, I have written this with my tongue in my >cheek and a light hearted take on some people request for assistance on a >range of mail lists. It was not meant to target anyone in particular only to >exaggerate how some people's requests appear to lurkers and contributors on >many fora I frequent. >-- >http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Data cleaning workouts
List folk, I am a newbie trying to get used to Python. I was wondering if anyone knows of web resources that teach good practices in data cleaning and management for statistics/analytics/machine learning, particularly using Python. Ideally, these would be exercises of the form: here is some horrible raw data --> here is what it should look like after it has been cleaned. Guidelines about steps that should always be taken, practices that should be avoided; basically, workflow of data analysis in Python with special emphasis on the cleaning part. -- http://mail.python.org/mailman/listinfo/python-list
Re: Data cleaning workouts
Thanks. I will try the SciPy list. It was a bit of a hail mary anyway. Pretty sure elevated Python types don't actually get their hands dirty with data. ;) - Original Message - From: rusi To: python-list@python.org Cc: Sent: Thursday, August 23, 2012 11:01 PM Subject: Re: Data cleaning workouts On Aug 23, 12:52 pm, Fg Nu wrote: > List folk, > > I am a newbie trying to get used to Python. I was wondering if anyone knows > of web resources that teach good practices in data cleaning and management > for statistics/analytics/machine learning, particularly using Python. > > Ideally, these would be exercises of the form: here is some horrible raw data > --> here is what it should look like after it has been cleaned. Guidelines > about steps that should always be taken, practices that should be avoided; > basically, workflow of data analysis in Python with special emphasis on the > cleaning part. Since no one has answered, I suggest you narrow your searching from 'python' to 'scipy' (or 'numpy'). Also perhaps ipython. And then perhaps try those specific mailing lists/fora. Since I dont know this area much, not saying more. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.
- Original Message - From: Tim Chase To: Ian Kelly Cc: Python Sent: Saturday, September 29, 2012 9:12 AM Subject: Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. On 09/28/12 22:25, Ian Kelly wrote: > On Fri, Sep 28, 2012 at 8:17 PM, Tim Chase On 09/28/12 19:31, iMath wrote: > write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. >> >> r = re.compile( >> "800-555-1212|" >> "555-1212|" >> r"\(800\) 555-1212" >> ) > > Mine is simpler and faster. > > r = re.compile("") doh! «smacks forehead» Yours is FAR more efficient, and much more readable than mine. iMath's teacher will be pleased :-) -tkc lulz. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list