From eric at intellovations.com Thu Dec 3 13:43:28 2009 From: eric at intellovations.com (Eric Floehr) Date: Thu, 3 Dec 2009 07:43:28 -0500 Subject: [CentralOH] Code Like A Pythonista Message-ID: <34f468870912030443q5b9adbbbr29ee8536240ad75a@mail.gmail.com> All, I wanted to share a great resource for those both learning Python, and those who use it everyday. It is a nice summary of "the Python Way" and is filled with best-practices for aspiring and experienced developers alike. http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html The author is David Goodger, who is the person behind reStructuredText and DocUtils, so it's by someone who knows his stuff. This is definitely a reference to keep close by your side. See you Monday! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Thu Dec 3 15:48:35 2009 From: nick.albright at gmail.com (Nick Albright) Date: Thu, 3 Dec 2009 09:48:35 -0500 Subject: [CentralOH] Code Like A Pythonista In-Reply-To: <34f468870912030443q5b9adbbbr29ee8536240ad75a@mail.gmail.com> References: <34f468870912030443q5b9adbbbr29ee8536240ad75a@mail.gmail.com> Message-ID: <7ec143010912030648g4efe1b67se6fde7574cc7dc18@mail.gmail.com> Ooo! Along those lines, for those that know another language well but need a Quick Reference for the basic python statements, built in functions, etc.. the "Quick Reference" that is off the python site *rules*! Fav ever for any lang. = ) The 2.6 Quick Reference: http://rgruet.free.fr/PQR26/PQR2.6.html Or pick your fav python: http://rgruet.free.fr/#QuickRef Peace! -Nick On Thu, Dec 3, 2009 at 7:43 AM, Eric Floehr wrote: > All, > > I wanted to share a great resource for those both learning Python, and > those who use it everyday. It is a nice summary of "the Python Way" and is > filled with best-practices for aspiring and experienced developers alike. > > http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html > > The author is David Goodger, who is the person behind reStructuredText and > DocUtils, so it's by someone who knows his stuff. This is definitely a > reference to keep close by your side. > > See you Monday! > Eric > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- "I love deadlines - I love the whooshing noise they make as they go by." --Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtfm at columbus.rr.com Thu Dec 3 19:38:10 2009 From: rtfm at columbus.rr.com (Mike Schoenborn) Date: Thu, 03 Dec 2009 13:38:10 -0500 Subject: [CentralOH] Code Like A Pythonista In-Reply-To: <34f468870912030443q5b9adbbbr29ee8536240ad75a@mail.gmail.com> References: <34f468870912030443q5b9adbbbr29ee8536240ad75a@mail.gmail.com> Message-ID: <1259865490.8486.22.camel@egg> On Thu, 2009-12-03 at 07:43 -0500, Eric Floehr wrote: > I wanted to share a great resource for those both learning Python, and > those who use it everyday. Here's a site I (am embarassed to say) just discovered recently: http://stackoverflow.com/questions/tagged/python It's a great place to randomly browse around to learn things you didn't know you wanted to know... a real time killer, in a good way. From catherine.devlin at gmail.com Tue Dec 8 06:42:26 2009 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Tue, 8 Dec 2009 00:42:26 -0500 Subject: [CentralOH] reStructuredText talk notes Message-ID: <6523e39a0912072142x508a5695w63c4cff0d1fdd95@mail.gmail.com> Hey, everybody - thanks for being a great, inquisitive audience on Monday! My slides are at http://catherinedevlin.pythoneers.com/ (near the bottom, under "other talks" - it's the Ohio LinuxFest 2009 talk) The link to various docutils programs that I mentioned is in the slides after all: http://docutils.sourceforge.net/docs/user/links.html It mentions an rST to Windows Help converter: http://www.rutherfurd.net/software/rst2chm/ If you want mailing list support, you won't find a "reST mailing list" - instead, it's a Docutils mailing list: http://docutils.sourceforge.net/docs/user/mailing-lists.html -- - Catherine http://catherinedevlin.blogspot.com/ *** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org *** -------------- next part -------------- An HTML attachment was scrubbed... URL: From miles.groman at gmail.com Tue Dec 8 15:10:18 2009 From: miles.groman at gmail.com (m g) Date: Tue, 8 Dec 2009 09:10:18 -0500 Subject: [CentralOH] reStructuredText talk notes In-Reply-To: <6523e39a0912072142x508a5695w63c4cff0d1fdd95@mail.gmail.com> References: <6523e39a0912072142x508a5695w63c4cff0d1fdd95@mail.gmail.com> Message-ID: Thanks, and good presentation from what I saw. Storing documentation in plaintext was one of the few things from the Pragmatic Programmer that had stuck with me. I believe the book says something along the lines of "plaintext will never go out of style". I write everything at work in vim and save as a text file. It serves as a good common denomenator between .doc, .pdf, .html, etc On Tue, Dec 8, 2009 at 12:42 AM, Catherine Devlin wrote: > Hey, everybody - thanks for being a great, inquisitive audience on Monday! > > My slides are at http://catherinedevlin.pythoneers.com/ (near the bottom, > under "other talks" - it's the Ohio LinuxFest 2009 talk) > > The link to various docutils programs that I mentioned is in the slides > after all: > http://docutils.sourceforge.net/docs/user/links.html > It mentions an rST to Windows Help converter: > http://www.rutherfurd.net/software/rst2chm/ > > If you want mailing list support, you won't find a "reST mailing list" - > instead, it's a Docutils mailing list: > http://docutils.sourceforge.net/docs/user/mailing-lists.html > > -- > - Catherine > http://catherinedevlin.blogspot.com/ > *** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org *** > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From james at atlantixeng.com Tue Dec 8 16:27:53 2009 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 8 Dec 2009 10:27:53 -0500 Subject: [CentralOH] reStructuredText Talk Message-ID: <003a01ca781b$02fa2b00$08ee8100$@com> Special Thanks to Catherine for the presentation on Monday and traveling from Dayton. The presentation contained an excellent balance of high level overview and low level details. -James -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Tue Dec 8 17:03:41 2009 From: nick.albright at gmail.com (Nick Albright) Date: Tue, 8 Dec 2009 11:03:41 -0500 Subject: [CentralOH] reStructuredText Talk In-Reply-To: <003a01ca781b$02fa2b00$08ee8100$@com> References: <003a01ca781b$02fa2b00$08ee8100$@com> Message-ID: <7ec143010912080803l7f26afe4p130c79cda9249a10@mail.gmail.com> Hear hear! I felt I got alot out of it, and it was awesome to see the presentation change in real time. = ) Thanks Catherine! -Nick On Tue, Dec 8, 2009 at 10:27 AM, James - Atlantix wrote: > Special Thanks to Catherine for the presentation on Monday and traveling > from Dayton. The presentation contained an excellent balance of high level > overview and low level details. > > -James > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- "Common sense is the collection of prejudices acquired by age eighteen." -- Albert Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: From yanovich at cse.ohio-state.edu Wed Dec 9 04:40:05 2009 From: yanovich at cse.ohio-state.edu (Michael S. Yanovich) Date: Tue, 08 Dec 2009 22:40:05 -0500 Subject: [CentralOH] Python and Oracle Message-ID: <4B1F1C15.1040406@cse.ohio-state.edu> I've started a challenge in Python (I may have gotten myself in over my head) where I want to create a Python script that would access a *remote* Oracle database and provide the contents of a certain entry in the database. I've done some research on this and it seems that I would need either cx_Oracle or PyODBC. For cx_Oracle it looks like I need to have Oracle installed locally to use it. However, I have found some useful tutorials on using cx_Oracle that make it look easy for what I want to accomplish. As for PyODBC I would have to compile it locally and change my PATHs for Python to get this to work, but I'm not fully sure on how to go about using it to access a database. (It seems more intimidating) The server I would like to remotely connect to doesn't have a documented API, but it does have a publicly search-able database that anyone can connect to and browse. I know it is built on Oracle. I have determined this by the error messages and such the system throws at someone. I am assuming though that the information I am looking for is in a database. The database is: https://courses.osu.edu/psp/hcosuct/EMPLOYEE/HRMS/c/COMMUNITY_ACCESS.OSR_CAT_SRCH.GBL It can be access by going to http://buckeyelink.osu.edu/ and scrolling down to and clicking on "Course Catalog" under Academics and under Public Access. I know something of this nature can be done because a website has accomplished this using PHP and maybe something else. http://schedulizer.com/ My question to everyone is: Which route should I go cx_Oracle or PyODBC, or am I going about this all wrong? Or is there an easier way? -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5162 bytes Desc: S/MIME Cryptographic Signature URL: From jonebird at gmail.com Wed Dec 9 14:13:50 2009 From: jonebird at gmail.com (Jon Miller) Date: Wed, 9 Dec 2009 08:13:50 -0500 Subject: [CentralOH] Python and Oracle In-Reply-To: <4B1F1C15.1040406@cse.ohio-state.edu> References: <4B1F1C15.1040406@cse.ohio-state.edu> Message-ID: <589a24260912090513o4c115434u996924a7b846e834@mail.gmail.com> You may want to consider using an ORM package which will abstract a lot of the particular details around the particular flavor of RDBMS that you are connecting to. In helping others learn python, I usually end up introducing them to sqlalchemy (SA) and encourage them to take the time to learn it. IMO, it's worth climbing the moderate learning curve it possesses. Also, if you're not a fan of ORMs than you can still take advantage of the abstractions and consistency SA provides in it's SQL Expression Language. Here is a link to their documentation about Oracle support: http://www.sqlalchemy.org/docs/05/reference/dialects/oracle.html But to give a better "start here" link, I'd suggest the basic overview page: http://www.sqlalchemy.org/docs/05/intro.html#overview -- Jon Miller On Tue, Dec 8, 2009 at 10:40 PM, Michael S. Yanovich wrote: > I've started a challenge in Python (I may have gotten myself in over my > head) where I want to create a Python script that would access a *remote* > Oracle database and provide the contents of a certain entry in the database. > I've done some research on this and it seems that I would need either > cx_Oracle or PyODBC. > > For cx_Oracle it looks like I need to have Oracle installed locally to use > it. However, I have found some useful tutorials on using cx_Oracle that make > it look easy for what I want to accomplish. > > As for PyODBC I would have to compile it locally and change my PATHs for > Python to get this to work, but I'm not fully sure on how to go about using > it to access a database. (It seems more intimidating) > > The server I would like to remotely connect to doesn't have a documented > API, but it does have a publicly search-able database that anyone can > connect to and browse. I know it is built on Oracle. I have determined this > by the error messages and such the system throws at someone. I am assuming > though that the information I am looking for is in a database. > > The database is: > https://courses.osu.edu/psp/hcosuct/EMPLOYEE/HRMS/c/COMMUNITY_ACCESS.OSR_CAT_SRCH.GBL > > It can be access by going to http://buckeyelink.osu.edu/ and scrolling down > to and clicking on "Course Catalog" under Academics and under Public Access. > > I know something of this nature can be done because a website has > accomplished this using PHP and maybe something else. > http://schedulizer.com/ > > My question to everyone is: Which route should I go cx_Oracle or PyODBC, or > am I going about this all wrong? Or is there an easier way? > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From catherine.devlin at gmail.com Wed Dec 9 15:28:25 2009 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Wed, 9 Dec 2009 09:28:25 -0500 Subject: [CentralOH] Python and Oracle In-Reply-To: <4B1F1C15.1040406@cse.ohio-state.edu> References: <4B1F1C15.1040406@cse.ohio-state.edu> Message-ID: <6523e39a0912090628g76c37cd9o4882c55a379bc380@mail.gmail.com> On Tue, Dec 8, 2009 at 10:40 PM, Michael S. Yanovich < yanovich at cse.ohio-state.edu> wrote: > I've started a challenge in Python (I may have gotten myself in over my > head) where I want to create a Python script that would access a *remote* > Oracle database and provide the contents of a certain entry in the database. > I've done some research on this and it seems that I would need either > cx_Oracle or PyODBC. > > For cx_Oracle it looks like I need to have Oracle installed locally to use > it. That's true, but vastly easier than it sounds. You don't need Oracle server software, just client software. The Oracle 10g Express client is free and easy to install, and doesn't even have a terribly big footprint (for Oracle): http://www.oracle.com/technology/software/products/database/xe/index.html As for SQLAlchemy... it is a new set of things to learn, so it depends on how much you expect to muck around with databases (on this project and others). If just a touch, then it might not be worth your while to learn. If quite a bit, it's definitely worthwhile. PyODBC is extremely similar, since it's also a DB-API2 client. In that case, you'd have to worry about ODBC configuration. One feature that PyODBC provides (that cx_Oracle doesn't, because it wasn't written into the DB-API2 specification, though it really should have been) is accessing row results by their column names cursor.execute("select user_id, user_name from users") for row in cursor: print row.user_id, row.user_name (other DB-API2 packages return raw tuples, without any direct association to the column names, and you have to reference the cursor.description object) However, I have found some useful tutorials on using cx_Oracle that make it > look easy for what I want to accomplish. > I hope my PyOhio tutorial was among them! http://catherinedevlin.pythoneers.com/pyora_tutorial.tar.gz > The server I would like to remotely connect to doesn't have a documented > API, but it does have a publicly search-able database that anyone can > connect to and browse. I know it is built on Oracle. I have determined this > by the error messages and such the system throws at someone. I am assuming > though that the information I am looking for is in a database. > > The database is: > https://courses.osu.edu/psp/hcosuct/EMPLOYEE/HRMS/c/COMMUNITY_ACCESS.OSR_CAT_SRCH.GBL > > Ah, now you're going to need some cooperation from the owners of the database. If it is in Oracle, they'll have to permit Oracle*Net access (usually port 1521) from outside their organization; most organizations do not. You'll also need the address of the database hosting machine (not necessarily the same as the web server), a username/password on the database (many applications have *application* user accounts that are separate from *database* user accounts), and... yeah, lots of cooperation. If you're trying to access this data as a member of the anonymous public, you'll probably end up needing to write scripts against the web interface after all... in which case you won't be accessing the database directly, you'll be writing Windmill scripts or something, and you won't know or care whether the data is in Oracle, Tokyo Tyrant, or flat files. Or do SQL injection. :) But I tried a little of that, and it revealed that the application uses PeopleCode, so there's PeopleSoft running the app. (Which, I dearly hope, is armored against SQL injection.) I'd better stop hacking them now, at least not from a work address. PeopleSoft belongs to Oracle now, so it's likely that the underlying database is indeed Oracle. Good luck! -- - Catherine http://catherinedevlin.blogspot.com/ *** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org *** -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at developingchris.com Wed Dec 9 15:29:06 2009 From: chris at developingchris.com (Chris Chandler) Date: Wed, 9 Dec 2009 09:29:06 -0500 Subject: [CentralOH] Python and Oracle In-Reply-To: <4B1F1C15.1040406@cse.ohio-state.edu> References: <4B1F1C15.1040406@cse.ohio-state.edu> Message-ID: <95f91cc30912090629n2628943ale6708030b9c4332e@mail.gmail.com> How do you know that schedulizer is connecting directly to the database? I have a feeling they are parsing an api feed, given the way their FAQ reads about being able to be "out of sync" with the university for a matter of days. While its public information, that doesn't really mean that they'll give you a direct connection to their database. Thanks, Chris Chandler On Tue, Dec 8, 2009 at 10:40 PM, Michael S. Yanovich < yanovich at cse.ohio-state.edu> wrote: > I've started a challenge in Python (I may have gotten myself in over my > head) where I want to create a Python script that would access a *remote* > Oracle database and provide the contents of a certain entry in the database. > I've done some research on this and it seems that I would need either > cx_Oracle or PyODBC. > > For cx_Oracle it looks like I need to have Oracle installed locally to use > it. However, I have found some useful tutorials on using cx_Oracle that make > it look easy for what I want to accomplish. > > As for PyODBC I would have to compile it locally and change my PATHs for > Python to get this to work, but I'm not fully sure on how to go about using > it to access a database. (It seems more intimidating) > > The server I would like to remotely connect to doesn't have a documented > API, but it does have a publicly search-able database that anyone can > connect to and browse. I know it is built on Oracle. I have determined this > by the error messages and such the system throws at someone. I am assuming > though that the information I am looking for is in a database. > > The database is: > https://courses.osu.edu/psp/hcosuct/EMPLOYEE/HRMS/c/COMMUNITY_ACCESS.OSR_CAT_SRCH.GBL > > It can be access by going to http://buckeyelink.osu.edu/ and scrolling > down to and clicking on "Course Catalog" under Academics and under Public > Access. > > I know something of this nature can be done because a website has > accomplished this using PHP and maybe something else. > http://schedulizer.com/ > > My question to everyone is: Which route should I go cx_Oracle or PyODBC, or > am I going about this all wrong? Or is there an easier way? > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From catherine.devlin at gmail.com Mon Dec 14 23:39:09 2009 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Mon, 14 Dec 2009 17:39:09 -0500 Subject: [CentralOH] Fwd: Sprint to PyCon / Code on the Road / Snakes On a Bus In-Reply-To: <6523e39a0912110840k5ec5cbd3wda43457c96435797@mail.gmail.com> References: <6523e39a0912110840k5ec5cbd3wda43457c96435797@mail.gmail.com> Message-ID: <6523e39a0912141439s7171f77ek60ea352a0c81504a@mail.gmail.com> Hey, Michigan and Ohio Pythonistas... I wanted to float this idea by you and see if we have enough enthusiasm to send a bus to PyCon from our region. For instance, a bus could leave Detroit and scoop up folks in Toledo and Dayton then Cincinnati, and maybe a few more in Kentucky and Tennessee. Or Cleveland - Columbus - Cincinnati etc. Do you think we'd have the people to organize and populate it? Early-bird PyCon registration ends Jan. 6. Don't stall, you'll give the organizers ulcers. :) ---------- Forwarded message ---------- From: Catherine Devlin Date: Fri, Dec 11, 2009 at 11:40 AM Subject: Sprint to PyCon / Code on the Road / Snakes On a Bus To: cbc at unc.edu, aclark at aclark.net, Carl Karsten Cc: "Pycon-Organizers at Python.Org Pycon-Organizers" < Pycon-Organizers at python.org> To: usergroup leaders, and others... Road trip, anyone? Oops, I mean: ROOOOOOOOOAD TRIP, anyone? Imagine a busload of Pythonistas travelling from your city to PyCon, geeking out all the way. Do you like the idea? Would you like to try to make it happen? It's only an idea so far, but it doesn't have to stay that way. Of course, arranging carpooling for PyCon attendees is just common sense... but I'm thinking of something more grandiose, something that transforms a "trip" to PyCon into a *voyage* to PyCon. Something that would amount to a rolling sprint / Open Space session. Is this possible? To get a very rough idea, I got a quote from one bus company (http://usabuscharter.com). For a Feb 16 - 22 trip (enough for tutorial + conference, but not sprints). A 47-passenger bus with driver costs $6300 from Washington, DC ($134 @ round-trip if 47 passengers; $252 if 25) $6400 from Chicago ($136 / $ 256) $4895 from Raleigh, NC ($104 / $196) 47 passengers is as small as it generally gets for long trips. Keep in mind that you may be able to scoop up more passengers along your route. Reducing the trip from Feb 18 - 22 (missing tutorials) only cuts the bus cost to $5400/$5720/$4985. When comparing the cost to airline costs, remember that the bus eliminates airport parking and car rental. (Then again, since there's a Metro rail line from the airport to downtown, nobody should need to rent a car anyway.) Also, you can bring as many ounces of fluid as you darn will please. A more modest option would be to rent a 12-passenger van. In that case, I'm getting prices (for a heavily-insured rental) like $1100 ($92 @). Of course, in that case, you'd have to provide fuel and driving. Just remember to call it something impressive, like "the bus", "the Mighty Pythonic Express" or whatnot. Bonus points if you can find something alternatively-fueled, can paint it wacky colors, or whatnot. The point is to generate a trip that is a meeting, a rolling miniconference in its own right, something that people get excited about taking part in. Of course, if you have a potential sponsor company in your area that *owns* a bus, or a zepplin, then that would would be almost too good to be true! Size-wise, a minibus might be ideal, but minibus charters seem aimed at short-range trips rather than cross-country voyages. Anyway, poll your membership. See if there's interest in riding it and (more importantly) in helping organize it. Thanks! See you in Atlanta - by plane, bus, or llama caravan! -- - Catherine http://catherinedevlin.blogspot.com/ *** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org *** -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Thu Dec 17 22:09:30 2009 From: eric at intellovations.com (Eric Floehr) Date: Thu, 17 Dec 2009 16:09:30 -0500 Subject: [CentralOH] O'Reilly Learning Python Book In-Reply-To: <34f468870911161311w335adc8u8a5ffd0f41967d36@mail.gmail.com> References: <34f468870911161311w335adc8u8a5ffd0f41967d36@mail.gmail.com> Message-ID: <34f468870912171309o356dbd16nc5307520a95504b1@mail.gmail.com> To all who responded to this offer, thanks. It doesn't look like we were in the lucky few, but maybe next time. There is still our group's copy of Learning Python, 4th Edition which you may check out and review if you'd like. Best Regards, Eric On Mon, Nov 16, 2009 at 4:11 PM, Eric Floehr wrote: > All, > > Would anyone be interested in reviewing "Learning Python, 4th edition" on > oreilly.com? You will receive a free review copy. > > Only a few copies are available, so please respond quickly. > > Thanks, > Eric > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Sat Dec 19 23:53:06 2009 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 19 Dec 2009 17:53:06 -0500 Subject: [CentralOH] Eclipse / PyDev / Subclipse on the Mac Message-ID: <033934C4-5A43-4A0D-9E2E-E32AFDC74204@microenh.com> Does anyone have any experience configuring Eclipse as a Python development environment on the Mac? I'm using Snow Leopard (OSX 10.6.2) with MacPython 2.6.4, Eclipse 3.4.2 and PyDev 1.5.3. I'm trying to get Subclipse working (1.6 but I'm not sure the versions are there are a lot of Subclipse plugins with different version numbers). I can view repositories and check things in and out, but when I try to compare the local copy with the repository version, it fails with an error in PyMergeViewer: > java.lang.NullPointerException > at org.python.pydev.compare.PyMergeViewer.configureTextViewer(PyMergeViewer.java:141) > at org.eclipse.compare.contentmergeviewer.TextMergeViewer.createPart(TextMergeViewer.java:2180) > at org.eclipse.compare.contentmergeviewer.TextMergeViewer.createControls(TextMergeViewer.java:1672) > at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.buildControl(ContentMergeViewer.java:771) > at org.eclipse.compare.contentmergeviewer.TextMergeViewer.(TextMergeViewer.java:1311) > at org.python.pydev.compare.PyMergeViewer.(PyMergeViewer.java:56) > at org.python.pydev.compare.PyContentViewerCreator.createViewer(PyContentViewerCreator.java:18) > at org.eclipse.compare.internal.ViewerDescriptor.createViewer(ViewerDescriptor.java:60) and a bunch more. Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Mon Dec 21 16:04:41 2009 From: mark at microenh.com (Mark Erbaugh) Date: Mon, 21 Dec 2009 10:04:41 -0500 Subject: [CentralOH] Unit Testing Message-ID: <36B52969-490C-4F2C-92D9-E2E7F8586EDF@microenh.com> I've set up Eclipse (3.5) with PyDev (1.5.3) as a Python development environment. I put my project code in a source folder, src. I created another source folder, tests with unit tests. I can run each unit test individually using the test runner built into PyDev. Is there an automatic way to run all unit tests together with one command? Thanks, Mark From mark at microenh.com Thu Dec 24 18:36:19 2009 From: mark at microenh.com (Mark Erbaugh) Date: Thu, 24 Dec 2009 12:36:19 -0500 Subject: [CentralOH] meta class confusion with PyDev Message-ID: <02284C83-42E9-4D1C-B012-0C6B0EF0DC0B@microenh.com> I'm using PyDev 1.5.3 and if I'm not doing something wrong (which is likely), I've found a bug in it's parsing. I have a class with a metaclass. In the metaclass constructor, a couple of class variables are created and initialized. In PyDev, lines referencing these variables are flagged as an error with the message "Undefined variable from import". The code runs properly. I'm guessing that the PyDev parser isn't finding the fields that are dynamically added to the class definition. Is there a way that I can help it find them? It's been a while since I worked out the metaclass and I need to revisit how that all works together. The only think I know is that it works perfectly in applications. Mark From mark at microenh.com Wed Dec 30 15:16:08 2009 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 30 Dec 2009 09:16:08 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path Message-ID: I've installed MacPython 2.6.4 (from python.org) on my Mac with OS 10.6.2. If I right click on a .py file, I get an option to open the file with Idle, which is what I want. An Idle python shell window opens as well as an Idle window with my .py file. However, the directory containing the folder I just opened is not added to sys.path(). On other platforms, that directory is added to sys.path. I've not totally figured out how the Mac launches programs, such as Idle. Does anyone have any ideas on what I need to modify to add the current directory to sys.path()? Note that I would like this directory to be different, depending on where I open a .py file. I tend to do a lot of ad-hoc python scripting with little projects each in their own directory. Thanks and Happy New Year, Mark From miles.groman at gmail.com Wed Dec 30 15:40:29 2009 From: miles.groman at gmail.com (m g) Date: Wed, 30 Dec 2009 09:40:29 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path In-Reply-To: References: Message-ID: import sys import os sys.path.insert(0, os.getcwd()) Having that at the top of the python script would work but is probably less than ideal. From mark at microenh.com Wed Dec 30 17:56:09 2009 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 30 Dec 2009 11:56:09 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path In-Reply-To: References: Message-ID: <6A5553EC-76B1-4362-9C1F-3EC3002C72F6@microenh.com> On Dec 30, 2009, at 9:40 AM, m g wrote: > import sys > import os > > sys.path.insert(0, os.getcwd()) > > > Having that at the top of the python script would work but is probably > less than ideal. Thanks for the reply. Actually, another problem is the the current working directory is not set to the desired directory either. I found another thing. If I open a terminal window in the desired folder (I use a ShellHere utility I found somewhere) and launch Idle from the command line, the current directory is added to sys.path, but the current working directory is still not set to the current folder. I guess I'm kind of spoiled by Windows and Linux because that's what happens there: the directory containing the .py file is set to the current directory and that directory is added to sys.path. It''s very convenient for working with ad-hoc scripts. Mark From miles.groman at gmail.com Wed Dec 30 17:59:39 2009 From: miles.groman at gmail.com (m g) Date: Wed, 30 Dec 2009 11:59:39 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path In-Reply-To: <6A5553EC-76B1-4362-9C1F-3EC3002C72F6@microenh.com> References: <6A5553EC-76B1-4362-9C1F-3EC3002C72F6@microenh.com> Message-ID: You could always just set the PYTHONPATH environment variable too. From mark at microenh.com Wed Dec 30 19:10:13 2009 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 30 Dec 2009 13:10:13 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path In-Reply-To: References: <6A5553EC-76B1-4362-9C1F-3EC3002C72F6@microenh.com> Message-ID: <9953418A-0BC1-4265-9CD2-F176C160FDA5@microenh.com> On Dec 30, 2009, at 11:59 AM, m g wrote: > You could always just set the PYTHONPATH environment variable too. Thanks for the reply. I think that would only work if I always wanted the same directory in PYTHONPATH. I did a little more digging, but still don't know enough about the Mac launch process. Here's what I have found. If you view the contents of the IDLE Package (Mac Package, not a Python Package), in Contents/MacOS is a python script IDLE.py that apparently participates in the process. It runs the python script idlemain.py which is in the Contents/Resources folder. I've been able to walk through the process and see where idlemain.py is setting the current working directory (to my Documents folder). There are some notes in idlemain.py about what it is doing. What I haven't been able to find is how the .py file(s) that I want to open are passed to idle. They aren't in sys.argv passed to either IDLE.py or idlemain.py. They don't appear to be in environment variables. I'm thinking that if I can find the .py file that I want to start with, I could modify idlemain.py to set the current working directory to it's folder. Perhaps that's the rub, the files launched can't be found and why the launcher doesn't already do this. Mark From mark at microenh.com Wed Dec 30 20:17:48 2009 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 30 Dec 2009 14:17:48 -0500 Subject: [CentralOH] Idle MacPython 2.6.4 / sys.Path In-Reply-To: <9953418A-0BC1-4265-9CD2-F176C160FDA5@microenh.com> References: <6A5553EC-76B1-4362-9C1F-3EC3002C72F6@microenh.com> <9953418A-0BC1-4265-9CD2-F176C160FDA5@microenh.com> Message-ID: <504F4D1D-6CA0-41EC-87A4-E610EC32B6D6@microenh.com> On Dec 30, 2009, at 1:10 PM, Mark Erbaugh wrote: > I did a little more digging, but still don't know enough about the Mac launch process. Here's what I have found. > > If you view the contents of the IDLE Package (Mac Package, not a Python Package), in Contents/MacOS is a python script IDLE.py that apparently participates in the process. It runs the python script idlemain.py which is in the Contents/Resources folder. I've been able to walk through the process and see where idlemain.py is setting the current working directory (to my Documents folder). There are some notes in idlemain.py about what it is doing. > > What I haven't been able to find is how the .py file(s) that I want to open are passed to idle. They aren't in sys.argv passed to either IDLE.py or idlemain.py. They don't appear to be in environment variables. I'm thinking that if I can find the .py file that I want to start with, I could modify idlemain.py to set the current working directory to it's folder. Perhaps that's the rub, the files launched can't be found and why the launcher doesn't already do this. Well, I think I've figured out the root of the problem. The solution will be trickier . It looks like what Idle is doing on the Mac is binding a handler for an open file event. From the comments in the code (idlelib.macosxSupport), it looks like the Mac launcher uses this file open event to pass the files to be opened to Idle. I think the easiest solution would be to modify the code in macosxSupport to change the working directory to the directory of the first file it opens and to add that directory to sys.path. Of course, that requires modifying a "library" module, so my Idle won't be "standard". Mark