ride tab editor 2.03 has been released
ride tab editor 2.03 has been released. ride tab editor features customizable instruments and an editable tool menu (alpha help would be nice). also included are some scripts showing how you can use the output files in csound. The 2 series is an expansion of ride guitar tab editor that managed to get over 2000 downloads. http://dexrowem.blogspot.com/search?q=ride+tab+editor -- http://mail.python.org/mailman/listinfo/python-list
problems getting os.system and wxmenu to read options from a file and then execute
I managed to get the program running and the menu options are appearing on the list but the programs are not running. I suspect it is my onexecutemethod # Get the GUI stuff import wx # We're going to be handling files and directories import os menufile = open('menufile.txt','r') # Set up some button numbers for the menu ID_ABOUT=101 ID_OPEN=102 ID_SAVE=103 ID_BUTTON1=300 ID_EXIT=200 #ID_TOOL = 400 class MainWindow(wx.Frame): def __init__(self,parent,title): # based on a frame, so set up the frame wx.Frame.__init__(self,parent,wx.ID_ANY, title) # Add a text editor and a status bar # Each of these is within the current instance # so that we can refer to them later. self.control = wx.TextCtrl(self, 1, style=wx.TE_MULTILINE) self.CreateStatusBar() # A Statusbar in the bottom of the window # Setting up the menu. filemenu is a local variable at this stage. filemenu= wx.Menu() # use ID_ for future easy reference - much better that "48", "404" etc # The & character indicates the short cut key filemenu.Append(ID_OPEN, "&Open"," Open a file to edit") filemenu.AppendSeparator() filemenu.Append(ID_SAVE, "&Save"," Save file") filemenu.AppendSeparator() filemenu.Append(ID_ABOUT, "&About"," Information about this program") filemenu.AppendSeparator() filemenu.Append(ID_EXIT,"E&xit"," Terminate the program") #add options from a text file idtool = 400 menuoptions = [] for line in menufile: t = line.split(' ') filemenu.Append(idtool, t[0], t[1]) menuoptions.append(t[1]) idtool += 1 # Creating the menubar. menuBar = wx.MenuBar() menuBar.Append(filemenu,"&File") # Adding the "filemenu" to the MenuBar self.SetMenuBar(menuBar) # Adding the MenuBar to the Frame content. # Note - previous line stores the whole of the menu into the current object # Define the code to be run when a menu option is selected wx.EVT_MENU(self, ID_ABOUT, self.OnAbout) wx.EVT_MENU(self, ID_EXIT, self.OnExit) wx.EVT_MENU(self, ID_OPEN, self.OnOpen) wx.EVT_MENU(self, ID_SAVE, self.OnSave) # just "pass" in our demo #add execute files from the text file list idtool = 400 for e in menuoptions: wx.EVT_MENU(self, idtool, self.OnExecute(idtool, e)) idtool += 1 ##print e # Set up a series of buttons arranged horizontally self.sizer2 = wx.BoxSizer(wx.HORIZONTAL) self.buttons=[] # Note - give the buttons numbers 1 to 6, generating events 301 to 306 # because IB_BUTTON1 is 300 for i in range(6): # describe a button bid = i+1 self.buttons.append(wx.Button(self, ID_BUTTON1+i, "Button &"+str(bid))) # add that button to the sizer2 geometry self.sizer2.Add(self.buttons[i],1,wx.EXPAND) # Set up the overall frame verically - text edit window above buttons # We want to arrange the buttons vertically below the text edit window self.sizer=wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.control,1,wx.EXPAND) self.sizer.Add(self.sizer2,0,wx.EXPAND) # Tell it which sizer is to be used for main frame # It may lay out automatically and be altered to fit window self.SetSizer(self.sizer) self.SetAutoLayout(1) self.sizer.Fit(self) # Show it !!! self.Show(1) # Define widgets early even if they're not going to be seen # so that they can come up FAST when someone clicks for them! self.aboutme = wx.MessageDialog( self, " A sample editor \n" " in wxPython","About Sample Editor", wx.OK) self.doiexit = wx.MessageDialog( self, " Exit - R U Sure? \n", "GOING away ...", wx.YES_NO) # dirname is an APPLICATION variable that we're choosing to store # in with the frame - it's the parent directory for any file we # choose to edit in this frame self.dirname = '' def OnAbout(self,e): # A modal show will lock out the other windows until it has # been dealt with. Very useful in some programming tasks to # ensure that things happen in an order that the programmer # expects, but can be very frustrating to the user if it is # used to excess! self.aboutme.ShowModal() # Shows it # widget / frame defined earlier so it can come up fast when needed def OnExit(self,e): # A modal with an "are you sure" check - we don't want to exit # unless the user confirms the selection in this case ;-) igot = self.doiexit.ShowModal() # Shows it if igot == wx.ID_YES: self.Close(True) # Closes out this simple application def OnOpen(se
Re: I strongly dislike Python 3
On Jun 27, 2:09 pm, "Martin v. Loewis" wrote: > > I agree that there may be not much reason to port custom proprietary > > apps that are working fine and which would hardly benefit from, let > > alone need, and new Py3 features. > > In the long run, there will be a benefit: at some point in the future > (surely years from now), /usr/bin/python will be Python 3. So scripts > that use /usr/bin/python (or "/usr/bin/env python") will stop working. > As a quick fix, it might then be possible to have them run with > /usr/bin/python2. Some time more into the future, this will also stop > working, as Python 2.x won't be available anymore in the OS > distributions. If the custom proprietary app is then still used, it > better be ported. > > The same happened with other kinds of deprecations and removals through > the life of 2.x. Some applications where tied to a specific Python > release, or to a specific feature that had been deprecated. These either > needed to be ported, or dropped. > > Regards, > Martin It should be easier to have a large number of python versions on one machine... I am realy fond of 2.5 so I am probily going to start compiling them or just include the python2.5 exe if I port stuff and settle it that way.. -- http://mail.python.org/mailman/listinfo/python-list
links button gone from python.org
I noticed that that the link to that section is gone. The page seems to be there when I use the url that is stored on my computer. Unrelated but I will mention that It is sad to see that dr dobs python newsletter has vanished, I enjoyed reading that from time to time. -- http://mail.python.org/mailman/listinfo/python-list
Re: myths about python 3
On Jan 27, 2:56 pm, John Nagle wrote: > Daniel Fetchinson wrote: > > Hi folks, > > > I was going to write this post for a while because all sorts of myths > > periodically come up on this list about python 3. I don't think the > > posters mean to spread false information on purpose, they simply are > > not aware of the facts. > > > My list is surely incomplete, please feel free to post your favorite > > misconception about python 3 that people periodically state, claim or > > ask about. > > Myths about Python 3: > > 1. Python 3 is supported by major Linux distributions. > > FALSE - most distros are shipping with Python 2.4, or 2.5 at best. > > 2. Python 3 is supported by multiple Python implementations. > > FALSE - Only CPython supports 3.x. Iron Python, Unladen Swallow, > PyPy, and Jython have all stayed with 2.x versions of Python. > > 3. Python 3 is supported by most 3rd party Python packages. > > FALSE - it's not supported by MySQLdb, OpenSSL, feedparser, etc. > > Arguably, Python 3 has been rejected by the market. Instead, there's > now Python 2.6, Python 2.7, and Python 2.8. Python 3 has turned into > a debacle like Perl 6, now 10 years old. > > That's the reality, Python 3 fanboys. > > John Nagle I am seeing alot of bleeding edge linux distro's with 2.5 and 2.6 I would perfer they stayed with 2.4 or 2.5 .. or if there is a version that I can come up with a convincing cross- platform os.startfile I would want to use a vmware version of that linux. ___ http://dextracker.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: myths about python 3
On Jan 27, 8:42 am, Lie Ryan wrote: > On 01/28/10 01:32, Jean-Michel Pichavant wrote: > > > > > Daniel Fetchinson wrote: > Hi folks, > > I was going to write this post for a while because all sorts of myths > periodically come up on this list about python 3. I don't think the > posters mean to spread false information on purpose, they simply are > not aware of the facts. > > My list is surely incomplete, please feel free to post your favorite > misconception about python 3 that people periodically state, claim or > ask about. > > 1. Print statement/function creates incompatibility between 2.x and > 3.x! > > Certainly false or misleading, if one uses 2.6 and 3.x the > incompatibility is not there. Print as a function works in 2.6: > > Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) > [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > > >>> print( 'hello' ) > > hello > > >>> print 'hello' > > hello > 2. Integer division creates incompatibility between 2.x and 3.x! > > Again false or misleading, because one can get the 3.x behavior with > 2.6: > > Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) > [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > > >>> 6/5 > > 1 > > >>> from __future__ import division > >>> 6/5 > > 1.2 > > Please feel free to post your favorite false or misleading claim about > python 3! > > >>> Well, I see two false or misleading claims just above - namely that > >>> the two claims above are false or misleading. They tell just half of > >>> the story, and that half is indeed easy. A Python 3 program can be > >>> unchanged (in the case of print) or with only trivial modifications > >>> (in the case of integer division) be made to run on Python 2.6. > > >> Okay, so we agree that as long as print and integer division is > >> concerned, a program can easily be written that runs on both 2.6 and > >> 3.x. > > >> My statements are exactly this, so I don't understand why you disagree. > > >>> The other way around this is _not_ the case. > > >> What do you mean? > > >>> To say that two things are > >>> compatible if one can be used for the other, but the other not for the > >>> first, is false or misleading. > > >> I'm not sure what you mean here. Maybe I didn't make myself clear > >> enough, but what I mean is this: as long as print and integer division > >> is concerned, it is trivial to write code that runs on both 2.6 and > >> 3.x. Hence if someone wants to highlight incompatibility (which surely > >> exists) between 2.6 and 3.x he/she has to look elsewhere. > > >> Cheers, > >> Daniel > > > How would you write in python 2.6 > > > if print: > > print('Hello') > > > --- > > > def myPrint(*args): > > for arg in args: > > sys.stdout.write(str(arg)) > > > print = myPrint > > > JM > > from __future__ import print_function > > if print: > print('Hello') > > def myPrint(*args): > for arg in args: > sys.stdout.write(str(arg)) > > print = myPrint I can't say that I am that keen on 2.6 all my favorite graphics libraries are in 2.5. If there was money involved I would probably think y'all were doing it to stay employed so I am thinking I should wait till 3.4 and 3.5 to get involved with this but much sooner than python 4.0. I did notice that I had trouble compiling a library because some version of microsoft c is no longer available...sort of forced migration. __ http://dextracker.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Author of a Python Success Story Needs a Job!
On Dec 28, 1:32 am, Andrew Jonathan Fine wrote: > To whom it may concern, > > I am the author of "Honeywell Avoids Documentation Costs with Python > and other Open Standards!" > > I was laid off by Honeywell several months after I had made my > presentation in the 2005 Python Conference. > > Since then I have been unable to find work either as a software > engineer or in any other capacity, even at service jobs. I've sent > resumes and have been consistently ignored. > > What I have been doing in the meantime is to be a full time homemaker > and parent. As a hobby to keep me sane, I am attempting to retrain > part time at home as a jeweler and silversmith, and I sometimes used > Python for generating and manipulating code for CNC machines. > > For my own peace of mind, however, I very much want to be doing > software work again because I feel so greatly ashamed to have > dedicated my life to learning and working in the field only to now > find myself on the scrap heap. > > I find it highly ironic that my solution is still being advertised on > the Python web site but that I, the author of that solution, am now a > long term unemployment statistic. > > Please, if there is anyone out there who needs a highly creative and > highly skilled software designer for new and completely original work, > then for the love of God I implore you to contact me. > > A mind is a terrible thing to waste. > > Sincerely, > > Andrew Jonathan Fine > BEE, MSCS, 15 years experience, 5 in Python, the rest in C/C++, > about 1/3 embedded design and device drivers, and 2/3 in applications. I do the dex tracker project but I have never made anything more than some advertising money from it. I would welcome some help it is possible that it could be a little bit more commercial available on cd produced on demand but I don't see it being a very large thing. It does count as experience though on a resume http://dextracker.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??
On Dec 16, 3:02 pm, "eric_dex...@msn.com" wrote: > On Dec 16, 10:36 am, Paul Boddie wrote: > > > > > On 16 Des, 17:03, "eric_dex...@msn.com" wrote: > > > > #this should be a cross platform example of os.startfile ( startfile ) > > > #for windows and linux. this is the first version and > > > #linux, mac, other os's commands for exceptions to the > > > #rule would be appreciated. at some point this will be > > > #in the dex tracker project. > > > You could look at the desktop package for something similar: > > >http://pypi.python.org/pypi/desktop > > > The desktop.open function supports a few extra workarounds, mostly > > because it pre-dates xdg-open. > > > Paul > > "Since desktop environments like KDE and GNOME provide mechanisms for > running > browsers and editors according to the identified type of a file or > resource, > just as Windows "runs" files or resources, it is appropriate to have a > module > which accesses these mechanisms. It is this kind of functionality that > the > desktop package aims to support. Note that this approach is arguably > better" > > I am concerned this means I cant do something like associate python > files with python in artistx (ubuntu). It just associates text files > with editors?? It does look like a cool package and I will look into > that further. I suppose I could test the extension.. if '.py' in filename and then default to xdg-open if it isn't seems realy messy though. __ http://dextracker.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??
On Dec 16, 10:36 am, Paul Boddie wrote: > On 16 Des, 17:03, "eric_dex...@msn.com" wrote: > > > #this should be a cross platform example of os.startfile ( startfile ) > > #for windows and linux. this is the first version and > > #linux, mac, other os's commands for exceptions to the > > #rule would be appreciated. at some point this will be > > #in the dex tracker project. > > You could look at the desktop package for something similar: > > http://pypi.python.org/pypi/desktop > > The desktop.open function supports a few extra workarounds, mostly > because it pre-dates xdg-open. > > Paul "Since desktop environments like KDE and GNOME provide mechanisms for running browsers and editors according to the identified type of a file or resource, just as Windows "runs" files or resources, it is appropriate to have a module which accesses these mechanisms. It is this kind of functionality that the desktop package aims to support. Note that this approach is arguably better" I am concerned this means I cant do something like associate python files with python in artistx (ubuntu). It just associates text files with editors?? It does look like a cool package and I will look into that further. -- http://mail.python.org/mailman/listinfo/python-list
Re: python and command shell on Windows
On Dec 16, 11:58 am, josu wrote: > Hi > > I am trying to execute a windows command based on a shell by mean of > python. I have proven subprocess > > test=subprocess.Popen > (['shell_command'],shell=True,stdin=PIPE,stdout=PIPE) > > Initally, all seems ok, but, after seconds the python shell is frozen. > > Does someone know alternative ways valid for windows OS? > > Thanks in advance > > josu os.startfile() works you will find the pipe commands are different on unix and windows anyway. -- http://mail.python.org/mailman/listinfo/python-list
I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??
#this should be a cross platform example of os.startfile ( startfile ) #for windows and linux. this is the first version and #linux, mac, other os's commands for exceptions to the #rule would be appreciated. at some point this will be #in the dex tracker project. import os import subprocess def startfile(filename) try: os.startfile(filename) except: subprocess.Popen(['xdg-open', filename]) ___ http://dextracker.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: HTMLgen???
On Oct 15, 2:58 am, an...@vandervlies.xs4all.nl wrote: > Hi, > Does HTMLgen (Robin Friedrich's) still exsist?? And, if so, where can it > be found? > > -- > Andre van der Vlies > Certifiable Linux/UNIX engineer (CLUE) > Homepage:http://vandervlies.xs4all.nl/~andre > Books:http://www.lulu.com/andre14 > Key fingerprint = 397C 7479 67DB 9306 23DC B423 7B58 CD5A 6EFF 5CF8 > -- > "Programming isn't a craft, it's an art." > () ascii ribbon campaign - against html e-mail > /\ - against microsoft attachments > ^[^#] > -- http://gentoo-portage.com/dev-python/htmlgen looks like it does I am not sure if this is the version you are after -- http://mail.python.org/mailman/listinfo/python-list
is anyone using text to speech to read python documentation
I wrote a small pre-processor for python documentation and I am looking for advice on how to get the most natural sounding reading. I uploaded an example of a reading of lxml documentation as a podcast1 http://dexrow.blogspot.com/2009/06/python-voice-preprocessor.html. -- http://mail.python.org/mailman/listinfo/python-list
save error with embedded python 2.5
I seem to be getting one extra value when I create my values with for yy in range(1, maxy): for xx in range(1, maxx): count = count + 1 #squaret.append[count] squaret.append( square(xx * 20, yy * 20)) and saving boxes with if squaresave.state == '1': outfile = open('grid.dat','w') count = 0 for s in squaret: count = count + 1 outfile.write(s.state) outfile.write(' ') if count == maxy: outfile.write('\n') count = 0 thanks for any help in advance I am using python 2.5 embeded into pycap.. the rest of the source is available at http://dexrowem.blogspot.com/2009/04/pycap-drum-machine-or-piano-roll-beta.html if needed.. -- http://mail.python.org/mailman/listinfo/python-list
pycap (popcap gaming lib w python 2.5) mouse question
anyone use pycap based on popcap gaming lib.. http://www.farbs.org/pycap.html?? (not to be confused with the other pycap) I was trying to figure out why the mouse works in the example I didn't see any python code for it but It seem to have an effect in the example.. -- http://mail.python.org/mailman/listinfo/python-list
Re: Which Version of wxPython for Win XP
On Feb 19, 8:22 am, "W. eWatson" wrote: > I'm going to try out wxPython 2.8.92 for py25. It seems like the ansi > version is the choice for me. The other choice has unicode. Do I care? > -- > W. eWatson > > (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) > Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet > > Web Page: There is a good chance you don't care... I think the other is for internationalization... best to look.. It would be easier to answer the question if you said what you are going to do with it, and who needed to use your software. It's even possible that you might want to try pygame depending on what you want to use it for and who the audience is (and how good thier computers are) http://pypi.python.org/simple/Dex%20Tracker/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting in to metaprogramming
On Nov 27, 9:56 pm, "Hendrik van Rooyen" wrote: > "Steven D'Aprano" > > >GUI designer. You write a program to let the user create code by clicking > >buttons, dragging objects, drawing lines, etc. The GUI designer may use > >classes, but the purpose of those classes is to generate source code. > > Yikes, this is getting hairy- If "the problem" is to generate source code, > then you have to generate source code... > > >Testing code speed... you might have some functions with a loop, and you > >want to unroll the loop as an optimization. If you have one function, you > >can unroll it yourself. If you have a hundred such functions, you might > >want to write a program to do it. (Yes, I'm stretching...) > > Ok this one I'll buy - I can't think of a way to do this dynamically in a > class and get runnable code back. (but maybe I'm just not trying hard enough.) > > > > >Don't like that Python doesn't optimize tail-recursion? Then write a > >source-code analyzer that detects tail-recursion and re-writes the > >function using a while loop. > > This is like TJR's example (I think) > > > > > > >>> Thinking further back, when I was young and programming in Apple's > >>> Hypercard 4GL, I used to frequently use Hypercard scripts to generate > >>> new Hypercard scripts. That was to work around the limitations of the > >>> scripting language. > > >> What sort of stuff did you do, and would having had simple OO available > >> have rendered it unnecessary? > > >It's been 20-odd years, and the examples were pretty trivial... I don't > >really recall exactly, but it would have been something like this: > > >* design a GUI involving lots of buttons on screen, each one with quite > >similar but not identical code; > > >* since Hypercard didn't have a layout manager, write a script to > >generate each button, place it where needed, and set the button's code. > > >Hypercard did have a message passing hierarchy (like inheritance for > >objects), so often you could take the button's code and place it in a > >higher level of the hierarchy (the card, the background, the stack), but > >there were odd cases where that wasn't enough. > > >Another example: Hypercard had a very limited number of GUI elements > >(text fields and buttons, basically) but I designed a slider control > >using a few buttons, each button with a custom script. To avoid needing > >to create and place the buttons by hand each time I wanted a slider, I > >had a script that did it for me. The script not only created the buttons, > >but it created the scripts used by the buttons. This wasn't as difficult > >as it sounds -- it was basically taking a template and doing some text > >replacements, then telling the button to use it as a script. > > Ok I think I am beginning to get the picture - when you have to do stuff > that the language does not directly support, then you use the simple > available elements, and create source code that strings them together > to make more complex stuff. -in this case its probably not trivial to > do it at run time. > > The "make the source code" then run it, introduces a kind of compiler > stage. > > For an old assembler programmer, this is starting to sound like macros. > > So a different meta law would read like: > > One uses Code Generation Techniques when the language does not > have macros. > > *ducks* > > - Hendrik- Hide quoted text - > > - Show quoted text - I have been converting stuff like sound 100, 1 exc... and just writing like 100, 1 for a number of languages and then just loading it into a spreadsheet so that I can save little pieces of songs exc.. I can even use different compilers or libraries that way.. I have started doing that for quickbasic, qbasic, free basic, qb64, c++ All I do is use strings and '\n'.. I get to use a large number of older sounds and effects (for basic) on newer compilers that have aditional options.. It just looks like another music tracker.. I am not sure if that fits what you are trying to do though. -- http://mail.python.org/mailman/listinfo/python-list