Re: [Pythonmac-SIG] Fwd: Preferred IDE
Does anyone know how customizable jedit is .. in Jython maybe? Alle jEdit plugins are written in Java, never used Jython, so I don't know if that would be a way. But at least on my Mac (Tiger) jEdit behaves rather clumsy and tends to crash; there are some GUI problems; some plugins won't load or work. Greetlings, HR ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Debugger (was: Preferred IDE)
A somewhat similar question: is there a good debugger for python? SPE comes with WinPdb, but I never used it. http://www.digitalpeers.com/pythondebugger/ There's also HAP (seems to be Win-only at the moment): https://sourceforge.net/projects/hapdebugger/ Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Mac Python IDE
Does anyone have any suggestions as to the best IDE for Python on OS X. I've been informed that PythonIDE has ceased development and that the cold is pretty old. Would you please read the ongoing thread Preferred IDE. Greetlings, HR ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Fwd: Preferred IDE
Other than whatever that issue was, though, TextWrangler/BBEdit is an *excellent* editor, so be sure to try it out yourself (this directed at Jerry and the OP) before dismissing it. I love TextWrangler for its open in another encoding feature, but hate it for some inconveniences (blocking eternally while it seems to suck even huge files completely into memory and parse them instead doing something in smaller chunks); never really tried to use it for Python. Greetlings, HR ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Preferred IDE
I would appreciate any recommendations as to which IDE to use on OS X. I understand that the MacPythonIDE has ceased development, and was advised to ask which IDE people are now using. I'm after something fairly lite. A module browser, basic file management etc. are all that are required, plus any other must have features that I don't know about, as I'm just getting into Python. You've a choice, and the *just right* Editor/IDE is something different for anyone: As we just sponsored him a Mac, Stani is working on SPE's Mac abilities, so SPE is probably your best choice: http://pythonide.stani.be/ (No real Mac app yet, but works; see Mac instructions) SPE includes some other helpful tools (wxGlade and XRC GUI designer, Kiki regex checker, Debugger) There's also DrPython (nice lightweight and extendable, but in some undefined state, esp. the important plugins): http://drpython.sourceforge.net/ (No real Mac app) A real Mac app (but I don't really like it) is PyOXIDE: http://www.gandreas.com/products_developer.html I never tried ActiveGrid IDE: http://sourceforge.net/projects/activegrid/ (Mac binary only for full Application Builder) Eric (I don't like it, but others do...): http://www.die-offenbachs.de/detlev/eric3.html Commercial IDE Komodo by ActiveState (based on Mozilla XUL): http://www.activestate.com/Products/Komodo/ Also commercial, but loved by some is Wing: http://wingware.com/ It should be possible to use Xcode also for Python, but I never tried it. There are also some general Editors out there (not written in Python) that support Python (and a lot more): - TextWrangler (little brother of BBEdit) http://www.barebones.com/products/textwrangler/index.shtml - jEdit http://www.jedit.org/ Indefinite overkill: Eclipse IDE (originally for Java, but with PyDev plugin for Python): http://www.eclipse.org http://www.pydev.sourceforge.net (I found Eclipse to big slow on my Mac.) HTH Greetlings, HR ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Interactive shell
than one way, but I think the most common is to create a file called .profile, and put it in your home directory. Put in this line: export PATH=$PATH:/usr/local/bin I'd use '.bashrc' or '.bash_profile', because 'export' is bash syntax -- '.profile' should be read by any shell, and tcsh (e.g. default in OSX 10.2) doesn't understand that. BTW this file lives in you home folder (~ = /Users/yourname). If you don't know how to edit 'invisible' files (file name starting with a dot): You can see them with 'ls -al' and rename them with 'mv .dotname othername' (then open with TextEdit and rename again afterwards). If you want to check which python you're using, try 'which python'. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] inputing multi-digit numbers
Title: Nachricht -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kirk DurstonSent: Thursday, November 10, 2005 2:00 AMTo: pythonmac-sig@python.orgSubject: [Pythonmac-SIG] inputing multi-digit numbers Im having a hard time figuring out how to input a list of numbers, each one of which can be 1, 2, or 3 digits in length. First, I select a column in an Excel file, and copy and past it into a Word file. I then save it as a text file. I then open a new window in Python and copy and paste the column of numbers from the text file into the window and save it as Function IDIn my main program, I typeinput=open('Function ID', 'r')x=input.readlines()input.close()print x Try open (or file)with mode 'rU' (universal newline support), apparently the \r is not recognized as \n Best regards,Henning Hraban RammSüdkurier Medienhaus / MediaProSupport/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] inputing multi-digit numbers
Thank you. That gives me something closer to a list, but the output is now: ['939\n', '936\n', '937\n', '885\n', '886\n', '887\n', '171\n', '19\n', ...] Question: how do I get rid of the \n attached to each member in my list? Choose: map(int(map(string.strip, yourlist)) (Python 2.2) [ int(x.strip()) for x in yourlist ] (Python 2.3) ( int(x.strip()) for x in yourlist ) (Python 2.4) Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Python OCR on the Mac?
A little googling turned up the following interesting-sounding open- source packages: Gamera project (Python-based OCR) http://ldp.library.jhu.edu/projects/gamera/ gocr http://jocr.sourceforge.net/ ocrad http://www.gnu.org/software/ocrad/ocrad.html I haven't tried any of these. The 'ocrad' software is available through DarwinPorts. I for one would be really, really interested in hearing from anyone who's tried one or more of these. Any comparison shoppers at work out there? I only tried GOCR about a year ago (compiled it myself without Fink or DarwinPorts, didn't try to access it with Python), and it worked, but the results were rather poor, similar to the results of older commercial OCR software some years ago. I don't have any experience with up-to-date OCR software. Perhaps I only didn't find the best parameters... Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Play Quicktime mov
Python by itself cannot. That's not true at all. Sorry, I shouldn't answer if I have no clue... ;-/ Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Active Directory authentication on Mac using Python
Because of the difficulty in getting python-ldap to build on Mac OS 10.4 Perhaps this helps: http://twistedmatrix.com/users/tv/ldap-intro/ldap-intro.html http://tv.debian.net/software/ldaptor/ (based on twisted, see http://twistedmatrix.com) Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Discussion of Python IDE's: strengths andweaknesses (long)
Thank you very much for this overview! I tried several IDEs about a month ago to find the suiting one for my little projects and made partly the same, partly different experiences. Several apps showed the same problem on my german Tiger: The text in interpreter windows is not readable (only top part of characters is shown); if I had an option to enable antialiasing, it showed up, but not every app provided that. (Perhaps an issue with some system preference?) Another common problem is non-working (or even crashing) drag-and-drop of files to the IDE's windows or dock icon. Several IDE's I didn't get to use Python 2.4.1 (and the new wxPython), AFAIR it was Boa and PyOxide. And I don't like how most Python editors (even if they use Scintilla) handle (or mostly not-handle) non-Python files - be it config, HTML, text or other-language files. 2. Spe, which also includes wxGlade and other tools. I like SPE on WinXP, even if it tends to run into exceptions after that you seem to be able to work, but you can't save anymore - very dangerous! Other non-options like printing behave the same. On OSX I don't like how SPE's windows are split (notebook tabs, but separate windows, focus change doesn't really work). There were a lot of development for a while, but lately Stani stays quiet - perhaps he choked on his debugger-integration plans. 3. Eric3 Again I didn't manage to let it use Python 2.4.1 Strangely the app starts only every second time. Some more: 7. Eclipse is a mighty Java IDE, or more an application framework that ships with a Java IDE, but there are also two or three Python modules (PyDev, TruStudio). Eclipse's interface has nothing to do with any OS's standards, but I think one will get used to it. But at least on my G4/400 it's just too slow (esp. startup), and I can't wrap my mind around it's concepts. Perhaps that's why I got lost in the preferences and didn't find source browser, code completion etc. 8. DrPython a rather nice little light-weight (wx)Python IDE, extensible with plugins (i.e. a lot of important features are outsourced to plugins), but most plugins are outdated, have bugs or don't work for other reasons. I think it would be suited to replace IDLE more than most other candidates, but needs a bit of work for all the nice features to actually work. There's no Mac bundle yet, you must run it from Terminal. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Eclipse + PyDev
I've tried to use PyDev, but apart from the speed issue, Eclipse's interface is so sprawling and unintuitive that I haven't even figured out how to get PyDev started. Perhaps I'm missing something, and if you find Eclipse a pleasant environment to work in, go for it. I tried Eclipse yesterday and today and needed a while until I got PyDev installed: You must add the update URL as new remote repository in the update wizard (see Help menu), it doesn't work to just copy the files; Eclipse3 seems to need a special (and missing) dotfile to recognize the new plugin. I didn't try to edit Python code yet, but I agree that the interface is rather non-intuitive and non-MacOSy, and I don't like that it needs very long to start (as every Java application on MacOS X, i.e. on my old G4/400), but perhaps the mightyness of Blackout, ehm, Eclipse is worth the hassle. (And I could use it for Perl, PHP, HTML etc. also) I just tried also Eric3 (seems to support only Apple's Python 2.3) and DrPython (starts fast, seems lean, has ugly icons), I will need some time to test them. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] python terminal font problem on Tiger
Hi there, I made the mistake to upgrade my home Mac to Tiger, and now I must wait for updates of several apps... :-( Anyway, I installed Py2.4, latest wx etc. and changed my PATH to execute Python 2.4 before the system's. That works so far. But I've the same problem with every IDE that I tried (SPE, Boa, Oxygene, IDLE, PythonIDE, Dabo): In the Python interpreter windows I see always only fragments of characters, looks like the automatically choosen font wouldn't fit and chars get truncated. Source code windows look fine. Does anyone else experience something similar? Are there workarounds? How can I influence the (automatically chosen) terminal font of these apps? Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Newbie....(for now)
Having not yet used wxPython, I'm not sure how native its apps look, but people seem to like its power. I very much like it on WinXP, and it works (and looks good) on OSX, but some advanced widgets don't work. see www.wxpython.org Best regards, Henning Hraban Ramm Sdkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] app on top
This might be an OS question, rather than a Python one, but I am wondering if there is a way to tell an application to be always on top (or in front) of other applications running. I'd like to create a GUI in python and it should stay on top of other background applications to which the GUI communicates. It's a GUI question - every GUI toolkit has its own stay on top method. You didn't specify which toolkit you're planning to use. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
RE: [Pythonmac-SIG] IDE recommendation
Does anyone have experience with jEdit? (www.jedit.org) It's an GPL'ed all purpose editor written in Java that claims to also support Python. I had no time to test it yet besides that it runs on MacOS X, but it's extremely configurable and enhanceable (plugins, macros etc.). Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] XML handler design
Hi there! I just wrote a SAX handler for XML files that describe a newspaper issue (list of pages etc.); I'd like to know if I could do it better. def startElement(self, name, attrs): call an own handler method named _start_Something for a Something element if it exists, to avoid a long list of 'if name== ...' self._queue.append(name) # keep the order of processed tags handler = str('_start_'+name) if hasattr(self, handler): self.__class__.__dict__[handler](self, attrs) # is there a better syntax for this? The different element handlers fill an array of custom Page objects (self.pages). One gets this array either directly as MyHandler.pages or via def getPages(self): return self.pages.getSortedArray() # no, it's not a plain array ;-) def getPage(self, no): return self.pages[no] Is that the right way to get data from a handler? Like in: parser = xml.sax.make_parser() parser.setFeature(xml.sax.handler.feature_namespaces, 0) pxh = MyHandler() parser.setContentHandler(pxh) parser.parse(dateiname) for p in pxh.getPages(): ... I guess it would be better (more logical) to get the data from the parser? Further, if I'd like to use it in a twisted driven asynchronous app, would I let the parser run in a thread? (Or how can I make the parser non-blocking?) Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
RE: [Pythonmac-SIG] XML handler design
David Reed wrote: There's probably a better mailing list with XML parsing experts. I'm certainly not an expert but have done a little XML parsing. I've always followed the pattern of using startElement, characters and endElement to grab all the data. In the startElement method you set a instance variable to keep track of the current tag you are processing. You use the characters method to build up the values and then in the endElement method you store the data in your data structure. See the pyxml HOWTO for an example - specifically this section: http://pyxml.sourceforge.net/topics/howto/node14.html Yes, sure. Thanks, but that's not what I wanted to know. Perhaps I wasn't clear enough. It's not really so much XML related... def startElement(self, name, attrs): self._queue.append(name) # keep the order of processed tags handler = str('_start_'+name) if hasattr(self, handler): self.__class__.__dict__[handler](self, attrs) Is there a better syntax for self.__class__.__dict__[handler]? And where should the output go to? All examples use print statements in the element handlers. I wrote those get... methods - but I guess they don't belong in the XML handler, but perhaps in the parser or somewhere else. It works, but I don't think it's good design. def getPages(self): return self.pages.getSortedArray() def getPage(self, no): return self.pages[no] parser = xml.sax.make_parser() parser.setFeature(xml.sax.handler.feature_namespaces, 0) pxh = MyHandler() parser.setContentHandler(pxh) parser.parse(dateiname) for p in pxh.getPages(): ... I should ask the last question on the twisted ML, I guess: Further, if I'd like to use it in a twisted driven asynchronous app, would I let the parser run in a thread? (Or how can I make the parser non-blocking?) Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
RE: [Pythonmac-SIG] GUI design tools
Based on the statement above it looks as if wxWindows is the more mature and stable GUI toolkit for cross-platform on OSX. Is it worth learning WX? or will PyQt catch up? or does anyone even know the answer to that? I guess you can use PyQt on OSX, I never tried it, but I need to develop also on WinXP, and Qt is commercial for Windows. Second, are there tools to interface directly to Cocoa or Carbon Look after PyObjC. Looks like one can use Xcode Tools to build a GUI. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] GUI design tools
I have experience with OOP, OOAD and have about 16 years experience writing various stand-alone, client/server and n-tier business applications. I am getting a handle on Python, and I have written a couple of faceless applications with it. As Bob wrote, wx seems to be the best cross-platform choice. Regarding 3-tier bussiness apps you should have a look at dabo (based on wx); it's not yet mature and esp. strange on OSX, but perhaps you can help them. Regarding client-server stuff I'd suggest twisted (huge framework of network stuff, event based). see http://www.wxpython.org/ http://www.dabodev.com/ http://twistedmatrix.com/ Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
RE: [Pythonmac-SIG] magic file info
/usr/bin/magic determines the file type heuristically by parsing /usr/share/file/magic and then reading a couple bytes out of the given file. This appears to be a direct Python translation of the file command, with an embedded copy of a magic table: http://www.demonseed.net/~jp/code/magic.py Thank you! I could have written a magic parser myself, but it's better if I don't need to. ;-) I only thought there would be a standard module that I overlooked. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] magic file info
I'm looking for a way to retrieve a file's type - not (only) Mac type/creator, but like what the shell command 'file' returns. Best regards, Henning Hraban Ramm Südkurier Medienhaus / MediaPro Support/Admin/Development Dept. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig