From godber at gmail.com Sun Oct 3 23:08:22 2010 From: godber at gmail.com (Austin Godber) Date: Sun, 3 Oct 2010 17:08:22 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing Message-ID: I am playing with Windmill, which is browser automated testing in Python. Anyone interested in seeing an Austin's Thing Of the Month lightining talk about it this month? Austin From godber at gmail.com Sun Oct 3 23:35:23 2010 From: godber at gmail.com (Austin Godber) Date: Sun, 3 Oct 2010 17:35:23 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: References: Message-ID: Or pyccuracy, if I can get that working. Basically I need to start writing some tests for the Crunch.io dashboard, and I am looking at testing frameworks. I think I like Pyccuracy better, but have been having trouble getting it working. Austin On Sun, Oct 3, 2010 at 5:08 PM, Austin Godber wrote: > I am playing with Windmill, which is browser automated testing in > Python. ?Anyone interested in seeing an Austin's Thing Of the Month > lightining talk about it this month? > > Austin > From issac.kelly at gmail.com Mon Oct 4 00:07:52 2010 From: issac.kelly at gmail.com (Issac Kelly) Date: Sun, 3 Oct 2010 18:07:52 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: References: Message-ID: <-2915570156355067826@unknownmsgid> I am. How does it compare to selenium? Issac Kelly On Oct 3, 2010, at 5:08 PM, Austin Godber wrote: > I am playing with Windmill, which is browser automated testing in > Python. Anyone interested in seeing an Austin's Thing Of the Month > lightining talk about it this month? > > Austin > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh From godber at gmail.com Mon Oct 4 01:14:43 2010 From: godber at gmail.com (Austin Godber) Date: Sun, 3 Oct 2010 19:14:43 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: <-2915570156355067826@unknownmsgid> References: <-2915570156355067826@unknownmsgid> Message-ID: It is very similar to selenium, though has a few differences like integration with firebug for debugging, its IDE runs in any browser and an interactive python shell ... the full feature list is here: http://www.getwindmill.com/features I really want to use a BDD type framework that drives an actual browser ... like pyccuracy ... but I still can't get the darn thing to run. I don't think I have tried on anything but linux at this point. I use their recommended installation method (git checkout, then link into your site-packages directory), then I follow this quick start: http://github.com/heynemann/pyccuracy/wiki/Quick-Start It gets so far along, but then when it comes to actually clicking the button it just doesn't manage to wait for the next page to load ... it doesn't look like it actually does the POST even. I may end up using Lettuce ... http://lettuce.it/recipes/django-lxml.html It has the BDD workflow that I am looking for but unfortunately it simulates a browser rather than using a real one. Austin Austin On Sun, Oct 3, 2010 at 6:07 PM, Issac Kelly wrote: > I am. How does it compare to selenium? > > Issac Kelly > > On Oct 3, 2010, at 5:08 PM, Austin Godber wrote: > >> I am playing with Windmill, which is browser automated testing in >> Python. ?Anyone interested in seeing an Austin's Thing Of the Month >> lightining talk about it this month? >> >> Austin >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > From josh at globalherald.net Mon Oct 4 01:15:04 2010 From: josh at globalherald.net (Joshua Kramer) Date: Sun, 03 Oct 2010 19:15:04 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: References: <-2915570156355067826@unknownmsgid> Message-ID: <4CA90E78.3020607@globalherald.net> Here's another test framework. I've never used it, but it looks interesting: http://funkload.nuxeo.org/ From nick.albright at gmail.com Mon Oct 4 04:03:42 2010 From: nick.albright at gmail.com (Nick Albright) Date: Sun, 3 Oct 2010 22:03:42 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: References: Message-ID: I would *Love* to see some automated browser testing!! (talked about/demonstrated :) Double Count Me In! -Nick On Sun, Oct 3, 2010 at 5:08 PM, Austin Godber wrote: > I am playing with Windmill, which is browser automated testing in > Python. Anyone interested in seeing an Austin's Thing Of the Month > lightining talk about it this month? > > Austin > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Oct 4 14:01:23 2010 From: eric at intellovations.com (Eric Floehr) Date: Mon, 4 Oct 2010 08:01:23 -0400 Subject: [CentralOH] Austin's Thing Of the Month - Windmill - Automated in Browser Testing In-Reply-To: References: Message-ID: Triple count me in. And while I think this would make a great "thing of the month", I also think it would be great to expand to a full overview some month! -Eric On Sun, Oct 3, 2010 at 10:03 PM, Nick Albright wrote: > I would *Love* to see some automated browser testing!! (talked > about/demonstrated :) > > Double Count Me In! > -Nick > > > On Sun, Oct 3, 2010 at 5:08 PM, Austin Godber wrote: > >> I am playing with Windmill, which is browser automated testing in >> Python. Anyone interested in seeing an Austin's Thing Of the Month >> lightining talk about it this month? >> >> Austin >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh >> > > > > -- > Please note that as of 1/20 I no longer have a land phone line, only my > cell. > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Oct 4 15:20:33 2010 From: eric at intellovations.com (Eric Floehr) Date: Mon, 4 Oct 2010 09:20:33 -0400 Subject: [CentralOH] Soliciting talks Message-ID: All, I am soliciting talks for COhPy ... if you have found something interesting about Python and want to talk about it, let me know! Also, I have found talking about a topic is a great way to learn about the topic to a level you might not otherwise. Also, it's great practice for learning how to speak to a group and communicate your idea clearly, which are great professional skills to have! Next month's meeting will be at TechColumbus, but I'm also looking for venues for 2011 to host COhPy. If you know of any business, restaurant, other location that can host 20-25 people in a quiet room with power and a wall to project on to (and even better a projector), please let me know! Best Regards, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From godber at gmail.com Mon Oct 4 15:32:26 2010 From: godber at gmail.com (Austin Godber) Date: Mon, 4 Oct 2010 09:32:26 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: I would be willing to do an overview of python testing and skip the thing of the month this month if you guys would like. I spent all day yesterday looking at a bunch of testing stuff. I could cover more than just web automation ... unit tests, code checking and coverage ... Take a look at this: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy I could do a quick overview of the types of testing ... and then cherry pick a few from different categories above and do a brief intro on each. Austin On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr wrote: > All, > I am soliciting talks for COhPy ... if you have found something interesting > about Python and want to talk about it, let me know! ?Also, I have found > talking about a topic is a great way to learn about the topic to a level you > might not otherwise. > Also, it's great practice for learning how to speak to a group and > communicate your idea clearly, which are great professional skills to have! > Next month's meeting will be at TechColumbus, but I'm also looking for > venues for 2011 to host COhPy. ?If you know of any business, restaurant, > other location that can host 20-25 people in a quiet room with power and a > wall to project on to (and even better a projector), please let me know! > Best Regards, > Eric > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From eric at intellovations.com Mon Oct 4 15:50:13 2010 From: eric at intellovations.com (Eric Floehr) Date: Mon, 4 Oct 2010 09:50:13 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: Austin, I would be fine with you taking all of the Nov/Dec meeting and skipping the "thing of the month". You know that I can talk, and my Django talk could certainly be long :-). Also, there are rumors of Tommy's Pizza and beer... -Eric On Mon, Oct 4, 2010 at 9:32 AM, Austin Godber wrote: > I would be willing to do an overview of python testing and skip the > thing of the month this month if you guys would like. I spent all day > yesterday looking at a bunch of testing stuff. I could cover more > than just web automation ... unit tests, code checking and coverage > ... > > Take a look at this: > > http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy > > I could do a quick overview of the types of testing ... and then > cherry pick a few from different categories above and do a brief intro > on each. > > Austin > > On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr > wrote: > > All, > > I am soliciting talks for COhPy ... if you have found something > interesting > > about Python and want to talk about it, let me know! Also, I have found > > talking about a topic is a great way to learn about the topic to a level > you > > might not otherwise. > > Also, it's great practice for learning how to speak to a group and > > communicate your idea clearly, which are great professional skills to > have! > > Next month's meeting will be at TechColumbus, but I'm also looking for > > venues for 2011 to host COhPy. If you know of any business, restaurant, > > other location that can host 20-25 people in a quiet room with power and > a > > wall to project on to (and even better a projector), please let me know! > > Best Regards, > > Eric > > > > _______________________________________________ > > CentralOH mailing list > > CentralOH at python.org > > http://mail.python.org/mailman/listinfo/centraloh > > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From godber at gmail.com Mon Oct 4 16:02:31 2010 From: godber at gmail.com (Austin Godber) Date: Mon, 4 Oct 2010 10:02:31 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: Oh, it wasn't clear that we had a talk for October already. I must not have been paying attention. I can do the testing overview at November's meeting. I can cook up a non-testing related thing of the month for October. Actually, are people interested in virtualenv (and virtualenv wrapper)? If you are answering "I don't know what that is" ... then your answer should be "Yes". I could give a quick primer on using virtualenv. In a nutshell, virtualenv allows you to maintain a sane python environment. Austin On Mon, Oct 4, 2010 at 9:50 AM, Eric Floehr wrote: > Austin, > I would be fine with you taking all of the Nov/Dec meeting and skipping the > "thing of the month". ?You know that I can talk, and my Django talk could > certainly be long :-). ?Also, there are rumors of Tommy's Pizza and beer... > -Eric > > On Mon, Oct 4, 2010 at 9:32 AM, Austin Godber wrote: >> >> I would be willing to do an overview of python testing and skip the >> thing of the month this month if you guys would like. ?I spent all day >> yesterday looking at a bunch of testing stuff. ?I could cover more >> than just web automation ... unit tests, code checking and coverage >> ... >> >> Take a look at this: >> >> http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy >> >> I could do a quick overview of the types of testing ... and then >> cherry pick a few from different categories above and do a brief intro >> on each. >> >> Austin >> >> On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr >> wrote: >> > All, >> > I am soliciting talks for COhPy ... if you have found something >> > interesting >> > about Python and want to talk about it, let me know! ?Also, I have found >> > talking about a topic is a great way to learn about the topic to a level >> > you >> > might not otherwise. >> > Also, it's great practice for learning how to speak to a group and >> > communicate your idea clearly, which are great professional skills to >> > have! >> > Next month's meeting will be at TechColumbus, but I'm also looking for >> > venues for 2011 to host COhPy. ?If you know of any business, restaurant, >> > other location that can host 20-25 people in a quiet room with power and >> > a >> > wall to project on to (and even better a projector), please let me know! >> > Best Regards, >> > Eric >> > >> > _______________________________________________ >> > CentralOH mailing list >> > CentralOH at python.org >> > http://mail.python.org/mailman/listinfo/centraloh >> > >> > >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From yanovich.1 at osu.edu Mon Oct 4 16:05:49 2010 From: yanovich.1 at osu.edu (Michael S. Yanovich) Date: Mon, 04 Oct 2010 10:05:49 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: <4CA9DF3D.7010409@osu.edu> I am definitely interested in a talk about VirtualEnv. On 10/04/2010 10:02 AM, Austin Godber wrote: > Oh, it wasn't clear that we had a talk for October already. I must > not have been paying attention. I can do the testing overview at > November's meeting. I can cook up a non-testing related thing of the > month for October. Actually, are people interested in virtualenv (and > virtualenv wrapper)? If you are answering "I don't know what that is" > ... then your answer should be "Yes". I could give a quick primer on > using virtualenv. In a nutshell, virtualenv allows you to maintain a > sane python environment. > > Austin > > On Mon, Oct 4, 2010 at 9:50 AM, Eric Floehr wrote: >> Austin, >> I would be fine with you taking all of the Nov/Dec meeting and skipping the >> "thing of the month". You know that I can talk, and my Django talk could >> certainly be long :-). Also, there are rumors of Tommy's Pizza and beer... >> -Eric >> >> On Mon, Oct 4, 2010 at 9:32 AM, Austin Godber wrote: >>> >>> I would be willing to do an overview of python testing and skip the >>> thing of the month this month if you guys would like. I spent all day >>> yesterday looking at a bunch of testing stuff. I could cover more >>> than just web automation ... unit tests, code checking and coverage >>> ... >>> >>> Take a look at this: >>> >>> http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy >>> >>> I could do a quick overview of the types of testing ... and then >>> cherry pick a few from different categories above and do a brief intro >>> on each. >>> >>> Austin >>> >>> On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr >>> wrote: >>>> All, >>>> I am soliciting talks for COhPy ... if you have found something >>>> interesting >>>> about Python and want to talk about it, let me know! Also, I have found >>>> talking about a topic is a great way to learn about the topic to a level >>>> you >>>> might not otherwise. >>>> Also, it's great practice for learning how to speak to a group and >>>> communicate your idea clearly, which are great professional skills to >>>> have! >>>> Next month's meeting will be at TechColumbus, but I'm also looking for >>>> venues for 2011 to host COhPy. If you know of any business, restaurant, >>>> other location that can host 20-25 people in a quiet room with power and >>>> a >>>> wall to project on to (and even better a projector), please let me know! >>>> Best Regards, >>>> Eric >>>> >>>> _______________________________________________ >>>> CentralOH mailing list >>>> CentralOH at python.org >>>> http://mail.python.org/mailman/listinfo/centraloh >>>> >>>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> http://mail.python.org/mailman/listinfo/centraloh >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh >> >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 899 bytes Desc: OpenPGP digital signature URL: From nick.albright at gmail.com Mon Oct 4 16:26:22 2010 From: nick.albright at gmail.com (Nick Albright) Date: Mon, 4 Oct 2010 10:26:22 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: Yeah, I'd love to see it expanded to a session as well. = ) Peace, -Nick On Mon, Oct 4, 2010 at 9:50 AM, Eric Floehr wrote: > Austin, > > I would be fine with you taking all of the Nov/Dec meeting and skipping the > "thing of the month". You know that I can talk, and my Django talk could > certainly be long :-). Also, there are rumors of Tommy's Pizza and beer... > > -Eric > > > On Mon, Oct 4, 2010 at 9:32 AM, Austin Godber wrote: > >> I would be willing to do an overview of python testing and skip the >> thing of the month this month if you guys would like. I spent all day >> yesterday looking at a bunch of testing stuff. I could cover more >> than just web automation ... unit tests, code checking and coverage >> ... >> >> Take a look at this: >> >> http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy >> >> I could do a quick overview of the types of testing ... and then >> cherry pick a few from different categories above and do a brief intro >> on each. >> >> Austin >> >> On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr >> wrote: >> > All, >> > I am soliciting talks for COhPy ... if you have found something >> interesting >> > about Python and want to talk about it, let me know! Also, I have found >> > talking about a topic is a great way to learn about the topic to a level >> you >> > might not otherwise. >> > Also, it's great practice for learning how to speak to a group and >> > communicate your idea clearly, which are great professional skills to >> have! >> > Next month's meeting will be at TechColumbus, but I'm also looking for >> > venues for 2011 to host COhPy. If you know of any business, restaurant, >> > other location that can host 20-25 people in a quiet room with power and >> a >> > wall to project on to (and even better a projector), please let me know! >> > Best Regards, >> > Eric >> > >> > _______________________________________________ >> > CentralOH mailing list >> > CentralOH at python.org >> > http://mail.python.org/mailman/listinfo/centraloh >> > >> > >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh >> > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Oct 4 16:37:44 2010 From: eric at intellovations.com (Eric Floehr) Date: Mon, 4 Oct 2010 10:37:44 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: Austin, Yeah, my bad. I mentioned it at the September meeting, but haven't gotten the Meetup written. -Eric On Mon, Oct 4, 2010 at 10:02 AM, Austin Godber wrote: > Oh, it wasn't clear that we had a talk for October already. I must > not have been paying attention. I can do the testing overview at > November's meeting. I can cook up a non-testing related thing of the > month for October. Actually, are people interested in virtualenv (and > virtualenv wrapper)? If you are answering "I don't know what that is" > ... then your answer should be "Yes". I could give a quick primer on > using virtualenv. In a nutshell, virtualenv allows you to maintain a > sane python environment. > > Austin > > On Mon, Oct 4, 2010 at 9:50 AM, Eric Floehr > wrote: > > Austin, > > I would be fine with you taking all of the Nov/Dec meeting and skipping > the > > "thing of the month". You know that I can talk, and my Django talk could > > certainly be long :-). Also, there are rumors of Tommy's Pizza and > beer... > > -Eric > > > > On Mon, Oct 4, 2010 at 9:32 AM, Austin Godber wrote: > >> > >> I would be willing to do an overview of python testing and skip the > >> thing of the month this month if you guys would like. I spent all day > >> yesterday looking at a bunch of testing stuff. I could cover more > >> than just web automation ... unit tests, code checking and coverage > >> ... > >> > >> Take a look at this: > >> > >> http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy > >> > >> I could do a quick overview of the types of testing ... and then > >> cherry pick a few from different categories above and do a brief intro > >> on each. > >> > >> Austin > >> > >> On Mon, Oct 4, 2010 at 9:20 AM, Eric Floehr > >> wrote: > >> > All, > >> > I am soliciting talks for COhPy ... if you have found something > >> > interesting > >> > about Python and want to talk about it, let me know! Also, I have > found > >> > talking about a topic is a great way to learn about the topic to a > level > >> > you > >> > might not otherwise. > >> > Also, it's great practice for learning how to speak to a group and > >> > communicate your idea clearly, which are great professional skills to > >> > have! > >> > Next month's meeting will be at TechColumbus, but I'm also looking for > >> > venues for 2011 to host COhPy. If you know of any business, > restaurant, > >> > other location that can host 20-25 people in a quiet room with power > and > >> > a > >> > wall to project on to (and even better a projector), please let me > know! > >> > Best Regards, > >> > Eric > >> > > >> > _______________________________________________ > >> > CentralOH mailing list > >> > CentralOH at python.org > >> > http://mail.python.org/mailman/listinfo/centraloh > >> > > >> > > >> _______________________________________________ > >> CentralOH mailing list > >> CentralOH at python.org > >> http://mail.python.org/mailman/listinfo/centraloh > > > > > > _______________________________________________ > > CentralOH mailing list > > CentralOH at python.org > > http://mail.python.org/mailman/listinfo/centraloh > > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yanovich.1 at osu.edu Tue Oct 5 08:51:33 2010 From: yanovich.1 at osu.edu (Michael S. Yanovich) Date: Tue, 05 Oct 2010 02:51:33 -0400 Subject: [CentralOH] Parsing PDF's Message-ID: <4CAACAF5.70401@osu.edu> I have a very large PDF (roughly 500 pages!) that has a long table of information. I'd like to be able to parse the PDF and create some statistics about such things as how many times does something in a row occur through out the document and more. I've looked into PDFMiner, which is a great tool. However, it's not that I want to just output the PDF to plain text, html, or xml. The output for html and xml is very ugly for this pdf and the plain-text seems manageable but it would be very time-consuming to right the code I want. The way PDFMiner organizes the my PDF into plain text is it makes lists of the values for each column and then moves on to the next page. So I could in theory, hoping everything matches up go through and assume that the first value for column A will always match the first value for column B. But this could get tricky when getting towards then end since the last page is only half filled. I'm basically wondering if there exists something *like* BeautifulSoup for PDFs? I am basically looking for something that can take a PDF create a pythonic type object and I can go through and play with each page and break the elements down further and examine them. Preferably in a more user-friendly way than PDFMiner. Any ideas? Michael S. Yanovich -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 899 bytes Desc: OpenPGP digital signature URL: From james at atlantixeng.com Tue Oct 5 17:16:45 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 5 Oct 2010 11:16:45 -0400 Subject: [CentralOH] Parsing PDF's Message-ID: <003201cb64a0$536c42e0$fa44c8a0$@com> One suggestion is to build your own regular expressions & use a tool such as RegexBuddy, which I've found to be very helpful. -James -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Tue Oct 5 20:16:41 2010 From: nick.albright at gmail.com (Nick Albright) Date: Tue, 5 Oct 2010 14:16:41 -0400 Subject: [CentralOH] Parsing PDF's In-Reply-To: <4CAACAF5.70401@osu.edu> References: <4CAACAF5.70401@osu.edu> Message-ID: Hello! I've done some stuff with PDFs, and I think I've used pyPdf to parse out info before, and love ReportLab Toolkit for generating PDFs. I hope that helps! -Nick On Tue, Oct 5, 2010 at 2:51 AM, Michael S. Yanovich wrote: > I have a very large PDF (roughly 500 pages!) that has a long table of > information. I'd like to be able to parse the PDF and create some > statistics about such things as how many times does something in a row > occur through out the document and more. > > I've looked into PDFMiner, which is a great tool. However, it's not that > I want to just output the PDF to plain text, html, or xml. The output > for html and xml is very ugly for this pdf and the plain-text seems > manageable but it would be very time-consuming to right the code I want. > > The way PDFMiner organizes the my PDF into plain text is it makes lists > of the values for each column and then moves on to the next page. So I > could in theory, hoping everything matches up go through and assume that > the first value for column A will always match the first value for > column B. But this could get tricky when getting towards then end since > the last page is only half filled. > > I'm basically wondering if there exists something *like* BeautifulSoup > for PDFs? I am basically looking for something that can take a PDF > create a pythonic type object and I can go through and play with each > page and break the elements down further and examine them. Preferably in > a more user-friendly way than PDFMiner. > > Any ideas? > > Michael S. Yanovich > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at atlantixeng.com Wed Oct 6 02:38:26 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 5 Oct 2010 20:38:26 -0400 Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010 Message-ID: <000401cb64ee$cb155cc0$61401640$@atlantixeng.com> I am having some real problems getting proven, existing code written in Python 2.5 to work with Excel 2010 and Windows 7. It is a bit of a nightmare. For example, the code below works in 2003/2007 Office/Excel, but not in 2010! import win32com.client from win32com.client import gencache gencache.EnsureModule('{91D6BD00-246D-11D2-8643-3AE4EC000000}', 0, 3, 7) ? This code references the CLSID of Excel; this is for consistent opening of the app global x1 x1 = win32com.client.Dispatch('Excel.Application') x1.Workbooks.Open('C:/DROPBOX/My Dropbox/LIBRARIES/Python/PADS_Project/test_excel.xls') Right now I am trying to find the CLSID for Excel by calling Microsoft, it has only cost an hour and 4 tech support people to get where someone can go look up the number. I hope they can find it. Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at atlantixeng.com Wed Oct 6 03:14:00 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 5 Oct 2010 21:14:00 -0400 Subject: [CentralOH] Click To Run Technology Microsoft -- Python Problems -- COM/OLE Message-ID: <008f01cb64f3$c2e243b0$48a6cb10$@com> It turns out that newer Microsoft products employ "click to run" technology that actually creates a virtual hard disk where components of the software are installed on a JIT basis. This causes problems with add on software, such as Python / VBA, etc. I've received good treatment from Microsoft tech support and am now downloading a version of Office which does not have this click to run technology. The previous version did create a phantom "Q" drive on my system. Has anyone else had Python quite accessing Excel or Word due to these issues? Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Wed Oct 6 05:20:13 2010 From: eric at intellovations.com (Eric Floehr) Date: Tue, 5 Oct 2010 23:20:13 -0400 Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010 In-Reply-To: <000401cb64ee$cb155cc0$61401640$@atlantixeng.com> References: <000401cb64ee$cb155cc0$61401640$@atlantixeng.com> Message-ID: I've heard a rumor that Python works better, generally, on non-Windows platforms. ;-) But, granted, Office and most games work better on Windows. I choose Python! On Tue, Oct 5, 2010 at 8:38 PM, James - Atlantix wrote: > I am having some real problems getting proven, existing code written in > Python 2.5 to work with Excel 2010 and Windows 7. It is a bit of a > nightmare. > > > > For example, the code below works in 2003/2007 Office/Excel, but not in > 2010! > > > > import win32com.client > > from win32com.client import gencache > > gencache.EnsureModule('{91D6BD00-246D-11D2-8643-3AE4EC000000}', 0, 3, 7) > ? This code references the CLSID of Excel; this is for consistent opening > of the app > > global x1 > > x1 = win32com.client.Dispatch('Excel.Application') > > x1.Workbooks.Open('C:/DROPBOX/My > Dropbox/LIBRARIES/Python/PADS_Project/test_excel.xls') > > > > Right now I am trying to find the CLSID for Excel by calling Microsoft, it > has only cost an hour and 4 tech support people to get where someone can go > look up the number. I hope they can find it. > > > > Thanks, > > > > James > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From josh at globalherald.net Wed Oct 6 06:01:39 2010 From: josh at globalherald.net (Joshua Kramer) Date: Wed, 06 Oct 2010 00:01:39 -0400 Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010 In-Reply-To: References: <000401cb64ee$cb155cc0$61401640$@atlantixeng.com> Message-ID: <4CABF4A3.2060708@globalherald.net> Actually, you may want to investigate using IronPython and direct interfaces to Excel objects instead of using - *shudder* - COM objects. IronPython provides a native Python implementation on top of .NET, so you get all of the benefits that come with .NET. (And if the me of 7 years ago would see the me of now noting the benefits of .NET I would slap me silly!) On 10/05/2010 11:20 PM, Eric Floehr wrote: > I've heard a rumor that Python works better, generally, on non-Windows > platforms. ;-) > > But, granted, Office and most games work better on Windows. > > I choose Python! > > > On Tue, Oct 5, 2010 at 8:38 PM, James - Atlantix > > wrote: > > I am having some real problems getting proven, existing code > written in Python 2.5 to work with Excel 2010 and Windows 7. It is > a bit of a nightmare. > > For example, the code below works in 2003/2007 Office/Excel, but > not in 2010! > > import win32com.client > > from win32com.client import gencache > > gencache.EnsureModule('{91D6BD00-246D-11D2-8643-3AE4EC000000}', 0, > 3, 7) ? This code references the CLSID of Excel; this is for > consistent opening of the app > > global x1 > > x1 = win32com.client.Dispatch('Excel.Application') > > x1.Workbooks.Open('C:/DROPBOX/My > Dropbox/LIBRARIES/Python/PADS_Project/test_excel.xls') > > Right now I am trying to find the CLSID for Excel by calling > Microsoft, it has only cost an hour and 4 tech support people to > get where someone can go look up the number. I hope they can find it. > > Thanks, > > James > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Wed Oct 6 14:51:31 2010 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 6 Oct 2010 08:51:31 -0400 Subject: [CentralOH] Soliciting talks In-Reply-To: References: Message-ID: On Oct 4, 2010, at 9:20 AM, Eric Floehr wrote: > All, > > I am soliciting talks for COhPy ... if you have found something interesting about Python and want to talk about it, let me know! Also, I have found talking about a topic is a great way to learn about the topic to a level you might not otherwise. > > Also, it's great practice for learning how to speak to a group and communicate your idea clearly, which are great professional skills to have! > > Next month's meeting will be at TechColumbus, but I'm also looking for venues for 2011 to host COhPy. If you know of any business, restaurant, other location that can host 20-25 people in a quiet room with power and a wall to project on to (and even better a projector), please let me know! > > Best Regards, > Eric I'm spending more of my Python development time with Eclipse and PyDev (at the expense of Idle). The Eclipse / PyDev combination works well, and I'm not yet using all the features. If there's interest, I could put on a demo / talk. Or perhaps we could have several people demonstrate their favorite IDE. I'd like to see a demo of Wing. Mark From Bryan.Harris at udri.udayton.edu Wed Oct 6 16:43:07 2010 From: Bryan.Harris at udri.udayton.edu (Harris, Bryan W.) Date: Wed, 6 Oct 2010 10:43:07 -0400 Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010 References: <000401cb64ee$cb155cc0$61401640$@atlantixeng.com> Message-ID: James, Are you trying to open an excel window or trying to read excel spreadsheets? If you're trying to read spreadsheets: Try xlrd and xlwt. http://www.python-excel.org/ It works with both xls and xlsx formats. And it's cross platform. And it doesn't require excel to be on the system at all. It doesn't need win32 com at all. Bryan ________________________________ From: centraloh-bounces+harrisbw=notes.udayton.edu at python.org on behalf of James - Atlantix Sent: Tue 10/5/2010 8:38 PM To: centraloh at python.org Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010 I am having some real problems getting proven, existing code written in Python 2.5 to work with Excel 2010 and Windows 7. It is a bit of a nightmare. For example, the code below works in 2003/2007 Office/Excel, but not in 2010! import win32com.client from win32com.client import gencache gencache.EnsureModule('{91D6BD00-246D-11D2-8643-3AE4EC000000}', 0, 3, 7) ? This code references the CLSID of Excel; this is for consistent opening of the app global x1 x1 = win32com.client.Dispatch('Excel.Application') x1.Workbooks.Open('C:/DROPBOX/My Dropbox/LIBRARIES/Python/PADS_Project/test_excel.xls') Right now I am trying to find the CLSID for Excel by calling Microsoft, it has only cost an hour and 4 tech support people to get where someone can go look up the number. I hope they can find it. Thanks, James -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 5585 bytes Desc: not available URL: From mark at microenh.com Sat Oct 9 06:38:39 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 9 Oct 2010 00:38:39 -0400 Subject: [CentralOH] Delegate Property Message-ID: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> Is there a way to delegate a read/write property in a class instance to a read/write property in a different class's instance that is a data member of the class? The only way I can think of is to assign the property getter and setter, but with some ways of creating properties, getters and setters aren't easily gotten. i.e. class W(object): def a(): #@NoSelf doc = """Docstring""" #@UnusedVariable def fget(self): return self._a def fset(self, value): self._a = value def fdel(self): del self._a return locals() a = property(**a()) def __init__(self): self._a = 10 class B(object): def __init__(self): self.w = W() I would like to have an 'a' property on B such that when read they read the a from the contained self.w and when written they write that a. In this example, the property is just using a local variable, but in a real-world case, the property could be doing some computations. Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Sat Oct 9 14:45:50 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 9 Oct 2010 08:45:50 -0400 Subject: [CentralOH] __slots__ Message-ID: <5836A7D6-3630-411C-947D-8F9525633A0E@microenh.com> If a class has no data members, does it make sense to include a __slots__ = () statement in the class declaration? Thanks, Mark From mark at microenh.com Sat Oct 9 15:22:27 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 9 Oct 2010 09:22:27 -0400 Subject: [CentralOH] Delegate Property In-Reply-To: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> References: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> Message-ID: <20BC0966-279B-42A6-B4B2-09AEC065E3D7@microenh.com> On Oct 9, 2010, at 12:38 AM, Mark Erbaugh wrote: > Is there a way to delegate a read/write property in a class instance to a read/write property in a different class's instance that is a data member of the class? The only way I can think of is to assign the property getter and setter, but with some ways of creating properties, getters and setters aren't easily gotten. > > i.e. > > class W(object): > def a(): #@NoSelf > > def fget(self): > return self._a > > def fset(self, value): > self._a = value > > def fdel(self): > del self._a > > return locals() > > a = property(**a()) > > def __init__(self): > self._a = 10 > > > I would like to have an 'a' property on B such that when read they read the a from the contained self.w and when written they write that a. In this example, the property is just using a local variable, but in a real-world case, the property could be doing some computations. I've come up with at least one solution that seems to work: class B(object): def __init__(self): self.w = A() def a(): #@NoSelf fget = lambda self : self.w.a fset = lambda self,v : self.w.a.__set__(v) return (fget, fset) a = property(*a()) Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Sat Oct 9 14:57:39 2010 From: eric at intellovations.com (Eric Floehr) Date: Sat, 9 Oct 2010 08:57:39 -0400 Subject: [CentralOH] __slots__ In-Reply-To: <5836A7D6-3630-411C-947D-8F9525633A0E@microenh.com> References: <5836A7D6-3630-411C-947D-8F9525633A0E@microenh.com> Message-ID: Mark, My understanding of slots is by doing that you would accomplish two main things: 1. Decrease instance storage space (because no __dict__), which could make a big difference if you are creating LOTS of instances. 2. Because there is no __dict__ you lose all the dynamic attribute capabilities of Python (which is certainly an acceptable tradeoff for improved memory management). So yes, it makes sense, as long as you understand what you are trading off and what you are gaining. -Eric On Sat, Oct 9, 2010 at 8:45 AM, Mark Erbaugh wrote: > If a class has no data members, does it make sense to include a __slots__ = > () statement in the class declaration? > > Thanks, > Mark > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Sat Oct 9 15:57:08 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 9 Oct 2010 09:57:08 -0400 Subject: [CentralOH] __slots__ In-Reply-To: References: <5836A7D6-3630-411C-947D-8F9525633A0E@microenh.com> Message-ID: <75364983-C699-4E13-99B0-3C9E3CE66904@microenh.com> On Oct 9, 2010, at 8:57 AM, Eric Floehr wrote: > My understanding of slots is by doing that you would accomplish two main things: > > 1. Decrease instance storage space (because no __dict__), which could make a big difference if you are creating LOTS of instances. > 2. Because there is no __dict__ you lose all the dynamic attribute capabilities of Python (which is certainly an acceptable tradeoff for improved memory management). > > So yes, it makes sense, as long as you understand what you are trading off and what you are gaining. > Eric, Thanks. In the particular case, there could be 100 or more instances and dynamic attributes are not needed. FWIW, the class is a generic descriptor used to add dynamic properties do a larger class. If anyone is interested, I can post the code (it's around 200 lines). Mark From mark at microenh.com Mon Oct 11 03:13:24 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sun, 10 Oct 2010 21:13:24 -0400 Subject: [CentralOH] Testing Seams Message-ID: <5A40FAF0-AD70-4D15-8F2E-B749A5546517@microenh.com> Greetings, I've come up with a scheme for inserting a test seam into some Python code that seems to work. Here's a simplified example showing the concept. module under test: # -------------------- # mut.py import setup # defines A def function(): return setup.A # ------------------- During development the value of setup.A will change. Here's the unit test code # ----------------- import unittest import setup setup.A = 10 import mut ... self.asertEquals(10, mut.function()) # ---------------- Of course, in reality, function() does something more complex. The 'trick' to the above code is that setup is only loaded the first time it is imported (in the unit test module). The changes made to setup will be seen when setup is imported in mut.py Is this an appropriate testing seam? Mark From samus at codeargyle.com Tue Oct 12 19:24:59 2010 From: samus at codeargyle.com (Sam Corder) Date: Tue, 12 Oct 2010 13:24:59 -0400 Subject: [CentralOH] Delegate Property In-Reply-To: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> References: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> Message-ID: Properties really shouldn't be doing calculations. It hides the complexity of an object. Instead you lean toward explicit method invocations with names that imply some work is being done such as calculate_sales_tax. Conversely if your object is more just a data structure without behavior it would be acceptable to have a sales_tax property where the value was just stored and retrieved. It is a Single Responsibility Principle (SRP) violation to be both data structure and behavior oriented. On Sat, Oct 9, 2010 at 12:38 AM, Mark Erbaugh wrote: > Is there a way to delegate a read/write property in a class instance to a > read/write property in a different class's instance that is a data member of > the class? The only way I can think of is to assign the property getter and > setter, but with some ways of creating properties, getters and setters > aren't easily gotten. > > i.e. > > class W(object): > def a(): #@NoSelf > doc = """Docstring""" #@UnusedVariable > > > def fget(self): > return self._a > > > def fset(self, value): > self._a = value > > > def fdel(self): > del self._a > > > return locals() > > > a = property(**a()) > > def __init__(self): > self._a = 10 > > > > > class B(object): > > > def __init__(self): > self.w = W() > > > I would like to have an 'a' property on B such that when read they read the > a from the contained self.w and when written they write that a. In this > example, the property is just using a local variable, but in a real-world > case, the property could be doing some computations. > > Thanks, > Mark > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Tue Oct 12 20:29:41 2010 From: mark at microenh.com (Mark Erbaugh) Date: Tue, 12 Oct 2010 14:29:41 -0400 Subject: [CentralOH] Delegate Property In-Reply-To: References: <5FE2D403-2013-4A6D-8A00-FD09BFF49DD6@microenh.com> Message-ID: <4BD4A47B-A925-45BB-8617-FD0EED23ED99@microenh.com> On Oct 12, 2010, at 1:24 PM, Sam Corder wrote: > Properties really shouldn't be doing calculations. It hides the complexity of an object. Instead you lean toward explicit method invocations with names that imply some work is being done such as calculate_sales_tax. Conversely if your object is more just a data structure without behavior it would be acceptable to have a sales_tax property where the value was just stored and retrieved. It is a Single Responsibility Principle (SRP) violation to be both data structure and behavior oriented. > > On Sat, Oct 9, 2010 at 12:38 AM, Mark Erbaugh wrote: > Is there a way to delegate a read/write property in a class instance to a read/write property in a different class's instance that is a data member of the class? The only way I can think of is to assign the property getter and setter, but with some ways of creating properties, getters and setters aren't easily gotten. > > i.e. > > class W(object): > def a(): #@NoSelf > doc = """Docstring""" #@UnusedVariable > > def fget(self): > return self._a > > def fset(self, value): > self._a = value > > def fdel(self): > del self._a > > return locals() > > a = property(**a()) > > def __init__(self): > self._a = 10 > > > > class B(object): > > def __init__(self): > self.w = W() > > > > I would like to have an 'a' property on B such that when read they read the a from the contained self.w and when written they write that a. In this example, the property is just using a local variable, but in a real-world case, the property could be doing some computations. > Sam, Thanks for the comments. You are correct about the SRP. I think my comment about 'doing some computations' may have been misleading. In this particular instance the 'computations' are strictly maintaining a persistent copy of the data using SQLAlchemy. Would that still violate SRP? My goal was that client code could just access the property (read and write) and not worry about how the value was maintained. The client can just set the property when it wants to store the value and get the property when it wants to retrieve the value. The details of the database and persistence are hidden from the client. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.scites at railcar88.com Wed Oct 13 12:34:01 2010 From: scott.scites at railcar88.com (Scott Scites) Date: Wed, 13 Oct 2010 06:34:01 -0400 Subject: [CentralOH] Python DoJoe - Hacker Session Notes - 10-12-10 Message-ID: Morgan Goose and I explored Fabric (http://docs.fabfile.org/0.9.2/), Pyjamas (http://pyjs.org/) and Awesome (http://awesome.naquadah.org/) this morning. It was good to meet Morgan and see the good things he is doing with Fabric as a project contributor and user. I'm already looking forward to next week:) Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.scites at railcar88.com Wed Oct 13 12:34:01 2010 From: scott.scites at railcar88.com (Scott Scites) Date: Wed, 13 Oct 2010 06:34:01 -0400 Subject: [CentralOH] Python DoJoe - Hacker Session Notes - 10-12-10 Message-ID: Morgan Goose and I explored Fabric (http://docs.fabfile.org/0.9.2/), Pyjamas (http://pyjs.org/) and Awesome (http://awesome.naquadah.org/) this morning. It was good to meet Morgan and see the good things he is doing with Fabric as a project contributor and user. I'm already looking forward to next week:) Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.scites at railcar88.com Wed Oct 13 12:34:01 2010 From: scott.scites at railcar88.com (Scott Scites) Date: Wed, 13 Oct 2010 06:34:01 -0400 Subject: [CentralOH] Python DoJoe - Hacker Session Notes - 10-12-10 Message-ID: Morgan Goose and I explored Fabric (http://docs.fabfile.org/0.9.2/), Pyjamas (http://pyjs.org/) and Awesome (http://awesome.naquadah.org/) this morning. It was good to meet Morgan and see the good things he is doing with Fabric as a project contributor and user. I'm already looking forward to next week:) Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Wed Oct 13 15:29:39 2010 From: eric at intellovations.com (Eric Floehr) Date: Wed, 13 Oct 2010 09:29:39 -0400 Subject: [CentralOH] Group Library Message-ID: Hey everyone, The library our group has of O'Reilly books has been a very popular resource. I think everyone who has used it has benefited. I regularly get asked questions like "What books do you recommend to [learn/grow/do X] in Python?" I would love to be able to respond better to those questions based on your real world experience with the books. Soooo... if you have checked out a book from the library, please consider posting a message to the list with your impressions, or even a full review. Anything that would help guide people in their book selection. And if you think it is particularly crafty, also consider posting the review on the O'Reilly web site. This will help keep the books coming! We have a new non-Python-specific book for our library this month: "Beautiful Visualization". It looks awesome! Thanks so much! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Wed Oct 13 15:34:26 2010 From: eric at intellovations.com (Eric Floehr) Date: Wed, 13 Oct 2010 09:34:26 -0400 Subject: [CentralOH] Book checkout system Message-ID: All, I currently keep who has checked out our library's books on scraps of paper, and honestly, I haven't done a good job of keeping track of the books we do have. I generally answer "lots of good O'Reilly Python books" when asked. It would be WONDERFUL, if someone is interested in cutting their teeth on a project, to have a simple library system for the COhPy website. It doesn't have to be fancy... just a way for an admin to add and remove books, a way for folks to see the books in the library and which are checked out, and a way for books to be "checked out" (simple info like name, email, and phone is fine). I know that Scott has been planning on hacking the COhPy website, and Nick has done some initial groundwork. Please contact me, Scott, or Nick if you are interested in adding that functionality. Thanks!! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Wed Oct 13 15:58:54 2010 From: nick.albright at gmail.com (Nick Albright) Date: Wed, 13 Oct 2010 09:58:54 -0400 Subject: [CentralOH] Group Library In-Reply-To: References: Message-ID: It has been many moons, but I know I loved the Python in a Nutshell book. Great for people who are experience programmers, and just need to get up on the language specifics. After I had a basic hold of syntax and such, the most used reference was the "Python Quick Reference": http://rgruet.free.fr/PQR26/PQR2.6.html I'm madly in love with that page.. And then for the gritty details, can't go wrong with the python module/library docs online. That's all I got! -Nick "You ask for book, I give you book + web!" On Wed, Oct 13, 2010 at 9:29 AM, Eric Floehr wrote: > Hey everyone, > > The library our group has of O'Reilly books has been a very popular > resource. I think everyone who has used it has benefited. > > I regularly get asked questions like "What books do you recommend to > [learn/grow/do X] in Python?" I would love to be able to respond better to > those questions based on your real world experience with the books. > > Soooo... if you have checked out a book from the library, please consider > posting a message to the list with your impressions, or even a full review. > Anything that would help guide people in their book selection. > > And if you think it is particularly crafty, also consider posting the > review on the O'Reilly web site. This will help keep the books coming! > > > We have a new non-Python-specific book for our library this month: > "Beautiful Visualization". It looks awesome! > > > Thanks so much! > Eric > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davelist at mac.com Wed Oct 13 23:05:58 2010 From: davelist at mac.com (davelist at mac.com) Date: Wed, 13 Oct 2010 17:05:58 -0400 Subject: [CentralOH] Group Library In-Reply-To: References: Message-ID: On Oct 13, 2010, at 9:29 AM, Eric Floehr wrote: > Hey everyone, > > The library our group has of O'Reilly books has been a very popular resource. I think everyone who has used it has benefited. > > I regularly get asked questions like "What books do you recommend to [learn/grow/do X] in Python?" I would love to be able to respond better to those questions based on your real world experience with the books. > > Soooo... if you have checked out a book from the library, please consider posting a message to the list with your impressions, or even a full review. Anything that would help guide people in their book selection. > > And if you think it is particularly crafty, also consider posting the review on the O'Reilly web site. This will help keep the books coming! > > > We have a new non-Python-specific book for our library this month: "Beautiful Visualization". It looks awesome! > > > Thanks so much! > Eric I haven't checked them out from the group, but here are my favorite Python books for programmers with knowledge of other languages: Learning Python - great for getting started with doing things the Python way Python Cookbook - read after Learning Python for more of the Python way of doing things Python in a Nutshell - great reference Python Essential Reference - great reference We use Zelle's Python Programming : An Introduction to Computer Science to teach our introductory programming course (intended for those without programming experience) at Capital University. Dave Reed From catherine.devlin at gmail.com Mon Oct 18 17:06:17 2010 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Mon, 18 Oct 2010 11:06:17 -0400 Subject: [CentralOH] Southwest Ohio GiveCamp this weekend Message-ID: Just a quick reminder... http://southwestohiogivecamp.org/ Hope to see some of you there - remember to register! I want to make sure we have enough Pythonistas to form at least one strong Python-writing team. -- - Catherine http://catherinedevlin.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wam at wamber.net Mon Oct 18 17:35:08 2010 From: wam at wamber.net (William McVey) Date: Mon, 18 Oct 2010 11:35:08 -0400 Subject: [CentralOH] Southwest Ohio GiveCamp this weekend In-Reply-To: References: Message-ID: See ya there. - - William On Mon, Oct 18, 2010 at 11:06 AM, Catherine Devlin wrote: > Just a quick reminder... > > http://southwestohiogivecamp.org/ > > Hope to see some of you there - remember to register!? I want to make sure > we have enough Pythonistas to form at least one strong Python-writing team. > > -- > - Catherine > http://catherinedevlin.blogspot.com > > -- > You received this message because you are subscribed to the Google Groups > "CincyPy" group. > To post to this group, send email to cincypy at googlegroups.com. > To unsubscribe from this group, send email to > cincypy+unsubscribe at googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/cincypy?hl=en. > From microenh at hughes.net Mon Oct 18 01:03:37 2010 From: microenh at hughes.net (Mark Erbaugh) Date: Sun, 17 Oct 2010 19:03:37 -0400 Subject: [CentralOH] Regular Expression and String Format Expression Message-ID: <74827B79-7E04-4C93-B875-A6B505DC7556@hughes.net> I'm working on some code allows the user to configure certain input and output formats. For example, an account number consists of up to three integers (L1, L2 and L3). Using a regular expression, the user can configure how those three values are entered, i.e. 11-22-3333 or 3333.2211 or whatever they want. Currently, I'm requiring the user to enter another string which is applied to Python's % (string format) operator to determine how to display an account number. The user is required to enter matching regular expression and string formats. For example, if the format is 11-22-3333, the user could enter a regular expression of r'(?P\d\d)-(?P\d\d)-(?P\d\d\d\d)$' and a format string of '%(L1)02d-%(L2)02d-%(L3)04d' Is there a way to automatically create the string format expression from the regular expression or vice versa? Mark From james at atlantixeng.com Tue Oct 19 07:08:31 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 19 Oct 2010 01:08:31 -0400 Subject: [CentralOH] PyInstaller & Py2EXE Message-ID: <000d01cb6f4b$acf52b50$06df81f0$@atlantixeng.com> Hi All; I have been converting a PyQt4 GUI into an .exe with both PyInstaller and Py2EXE. They both work. The PyInstaller program runs a bit faster, although hardly noticeable. My question is does anyone have real experience getting images to show up in the .exe version? For example, I have a few .png images that show up just fine when running the python version of the code. However, upon conversion to exe, I cannot get the .png files to show up in the .exe version. There is a lot of documentation on the internet about this, and have tried several suggestions, including the qtplugins issue, but to no avail. Some of these issues are why Andrea Gavanna made GUI2EXE (http://code.google.com/p/gui2exe/ ) however there seems to be some issues with it but I have not officially tried this yet. (It has been enough effort to create builds in both PyInstaller and Py2EXE.) Any help on this matter is greatly appreciated; I have a nearly professional looking GUI that is missing its bells and whistles due to the graphics not showing up in the .exe distributable. Thanks, James For Reference: http://www.pyinstaller.org/ http://www.py2exe.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.scites at railcar88.com Tue Oct 19 12:17:51 2010 From: scott.scites at railcar88.com (Scott Scites) Date: Tue, 19 Oct 2010 06:17:51 -0400 Subject: [CentralOH] Pyjamas Blog Application - Blogjamas Message-ID: During the Pyjamas presentation, I mentioned that I had been working on an example application of Pyjamas on App Engine. Here's the code: http://bitbucket.org/railcar88/pyjamas_blog/src and here's the live application on app engine (it probably won't stay there permanently): http://www.blogjamas.appspot.com Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Tue Oct 19 22:33:55 2010 From: mark at microenh.com (Mark Erbaugh) Date: Tue, 19 Oct 2010 16:33:55 -0400 Subject: [CentralOH] Namespaces Message-ID: Assume I have a objecy named obj in a module, module.py, in a package named package. As I understand there are essentially three ways to access obj in a client module: import package.module then everywhere func is used, it must be called using package.module.obj or from package.module import obj then everywhere obj is used, it can be called using just obj. or from package.module import * again everywhere obj is used, it can be called using just obj, but I have read the cautions about using wild imports, so I'm discounting this option. or import package.module as pm then everywhere obj is used, it can be called using pm.obj What are the pros and cons and recommended best practices? Thanks, Mark From nick.albright at gmail.com Tue Oct 19 22:51:49 2010 From: nick.albright at gmail.com (Nick Albright) Date: Tue, 19 Oct 2010 16:51:49 -0400 Subject: [CentralOH] Namespaces In-Reply-To: References: Message-ID: Hola! Yeah, I avoid #3 (import *) all together. Can easily lead to clashes/things you don't want happening, happening. :) I tend to use #2 and #4 depending on the case. If I'm only using 1 function from that module, I'll just import that. If I'm going to be using a series of functions, then I'll give it a quickly typed name, and use that. And #1 is just a long hand version of #4, and I like shorthand. = ) Those be what little thoughts I have! -Nick On Tue, Oct 19, 2010 at 4:33 PM, Mark Erbaugh wrote: > Assume I have a objecy named obj in a module, module.py, in a package named > package. > > As I understand there are essentially three ways to access obj in a client > module: > > import package.module > > then everywhere func is used, it must be called using package.module.obj > > or > > from package.module import obj > > then everywhere obj is used, it can be called using just obj. > > or > > from package.module import * > > again everywhere obj is used, it can be called using just obj, but I have > read the cautions about using wild imports, so I'm discounting this option. > > or > > import package.module as pm > > then everywhere obj is used, it can be called using pm.obj > > > > What are the pros and cons and recommended best practices? > > > Thanks, > Mark > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From godber at gmail.com Tue Oct 19 23:51:23 2010 From: godber at gmail.com (Austin Godber) Date: Tue, 19 Oct 2010 17:51:23 -0400 Subject: [CentralOH] Namespaces In-Reply-To: References: Message-ID: I tend to agree with Nick though I like the explicitness of #1. I have just been reading some old code today and I wish it had all been done like #1, it would have helped my brain quickly understand exactly what was going on without jumping around. Actually, I think I would avoid #4 too, just to save myself the mental substitution of the real package.module. It may save you a bit of effort when you write it, but if you ever have to go back and read it again, #1 will make understanding it easier. Austin On Tue, Oct 19, 2010 at 4:51 PM, Nick Albright wrote: > Hola! > Yeah, I avoid #3 (import *) all together. ?Can easily lead to clashes/things > you don't want happening, happening. :) > I tend to use #2 and #4 depending on the case. ?If I'm only using 1 function > from that module, I'll just import that. ?If I'm going to be using a series > of functions, then I'll give it a quickly typed name, and use that. ?And #1 > is just a long hand version of #4, and I like shorthand. = ) > Those be what little thoughts I have! > ?-Nick > > On Tue, Oct 19, 2010 at 4:33 PM, Mark Erbaugh wrote: >> >> Assume I have a objecy named obj in a module, module.py, in a package >> named package. >> >> As I understand there are essentially three ways to access obj in a client >> module: >> >> import package.module >> >> then everywhere func is used, it must be called using package.module.obj >> >> or >> >> from package.module import obj >> >> then everywhere obj is used, it can be called using just obj. >> >> or >> >> from package.module import * >> >> again everywhere obj is used, it can be called using just obj, but I have >> read the cautions about using wild imports, so I'm discounting this option. >> >> or >> >> import package.module as pm >> >> then everywhere obj is used, it can be called using pm.obj >> >> >> >> What are the pros and cons and recommended best practices? >> >> >> Thanks, >> Mark >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > > > > -- > Please note that as of 1/20 I no longer have a land phone line, only my > cell. > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From pcarswell.1 at gmail.com Wed Oct 20 15:00:12 2010 From: pcarswell.1 at gmail.com (Peter Carswell) Date: Wed, 20 Oct 2010 09:00:12 -0400 Subject: [CentralOH] Book checkout system In-Reply-To: References: Message-ID: Hi, Eric, I still have one of the O'Reilly books at home. I will bring it in next meeting. pete On Wed, Oct 13, 2010 at 9:34 AM, Eric Floehr wrote: > All, > > I currently keep who has checked out our library's books on scraps of > paper, and honestly, I haven't done a good job of keeping track of the books > we do have. I generally answer "lots of good O'Reilly Python books" when > asked. > > It would be WONDERFUL, if someone is interested in cutting their teeth on a > project, to have a simple library system for the COhPy website. > > It doesn't have to be fancy... just a way for an admin to add and remove > books, a way for folks to see the books in the library and which are checked > out, and a way for books to be "checked out" (simple info like name, email, > and phone is fine). > > > I know that Scott has been planning on hacking the COhPy website, and Nick > has done some initial groundwork. Please contact me, Scott, or Nick if you > are interested in adding that functionality. > > > Thanks!! > Eric > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Wed Oct 20 15:11:22 2010 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 20 Oct 2010 09:11:22 -0400 Subject: [CentralOH] Grayson's Book on Tkinter Message-ID: Python and Tkinter Programming by John Grayson seems to be one (if not the only) book exclusively on the subject. Though it's still in print, it is from ten years ago. Do people think this would still be a worthwhile addition to a Python library? FWIW, I've been doing some GUI development with Tkinter and it is still quite usable. Does COhPy have this book in our library? Mark From pcarswell.1 at gmail.com Wed Oct 20 15:17:49 2010 From: pcarswell.1 at gmail.com (Peter Carswell) Date: Wed, 20 Oct 2010 09:17:49 -0400 Subject: [CentralOH] Grayson's Book on Tkinter In-Reply-To: References: Message-ID: I agree, and think that it would be good to add it to the library. I have used Tkinter to put together some interfaces in a very short time. pete On Wed, Oct 20, 2010 at 9:11 AM, Mark Erbaugh wrote: > Python and Tkinter Programming by John Grayson seems to be one (if not the > only) book exclusively on the subject. Though it's still in print, it is > from ten years ago. > > Do people think this would still be a worthwhile addition to a Python > library? FWIW, I've been doing some GUI development with Tkinter and it is > still quite usable. > > Does COhPy have this book in our library? > > Mark > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Wed Oct 20 21:46:16 2010 From: eric at intellovations.com (Eric Floehr) Date: Wed, 20 Oct 2010 15:46:16 -0400 Subject: [CentralOH] Fwd: [opensource-announce] Why Python? [10/21/2010] In-Reply-To: <20101020192726.GA1882@matt-arch> References: <20101020192726.GA1882@matt-arch> Message-ID: This Thursday, October 21 at 7pm in the Ohio Union Senate Chamber, Michael Yanovich and Morgan Goose will be discussing some of the advantages of Python, in terms of ease of use and enjoyability. They will be introducing the simplicity and beauty of the basic language constructs, illustrating some of the key differences between Python and other languages such as Java and C++, and demonstrating the power of the Python Standard Library. By the end of the meeting, you should see why Python is good for new and experienced programmers alike. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From mark at microenh.com Wed Oct 20 21:55:54 2010 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 20 Oct 2010 15:55:54 -0400 Subject: [CentralOH] Changing Exception Raised Message-ID: I am developing some utility routines for parsing user input data. I would like all my routines to raise the same exception, i.e. ValueError, if the input data is invalid. In some cases, I can use routines already in the standard Python library. For example, decimal.Decimal() will take a string as input, so this is satisfactory to parse my input; however, decimal.Decimal() raises decimal.InvalidOperation if the string cannot be parsed. I could write code to catch the InvalidOperation exception and raise a ValueError, but I wonder if there is a better/more elegant way? Mark import decimal def str_to_decimal(x): """ convert do Decimal x - input returns Decimal raises ValueError if x is not valid format for Decimal """ try: return decimal.Decimal(x) except decimal.InvalidOperation: raise ValueError -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Wed Oct 20 22:22:49 2010 From: eric at intellovations.com (Eric Floehr) Date: Wed, 20 Oct 2010 16:22:49 -0400 Subject: [CentralOH] Changing Exception Raised In-Reply-To: References: Message-ID: Mark, I think that way is pretty elegant. I don't know of a better way. Since you don't care, you could just do a naked "except:" which will catch everything and re-emit as a ValueError. I get bit by Decimal a lot because for purity it doesn't accept floats. In that case, a TypeError is raised. -Eric On Wed, Oct 20, 2010 at 3:55 PM, Mark Erbaugh wrote: > I am developing some utility routines for parsing user input data. I would > like all my routines to raise the same exception, i.e. ValueError, if the > input data is invalid. In some cases, I can use routines already in the > standard Python library. For example, decimal.Decimal() will take a string > as input, so this is satisfactory to parse my input; however, > decimal.Decimal() raises decimal.InvalidOperation if the string cannot be > parsed. I could write code to catch the InvalidOperation exception and > raise a ValueError, but I wonder if there is a better/more elegant way? > > Mark > > import decimal > > def str_to_decimal(x): > """ > convert do Decimal > > > x - input > returns Decimal > raises ValueError if x is not valid format for Decimal > """ > try: > return decimal.Decimal(x) > except decimal.InvalidOperation: > raise ValueError > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Wed Oct 20 22:47:13 2010 From: mark at microenh.com (Mark Erbaugh) Date: Wed, 20 Oct 2010 16:47:13 -0400 Subject: [CentralOH] Changing Exception Raised In-Reply-To: References: Message-ID: <10822284-FCC5-4CC7-88D8-EBB0D0CA891F@microenh.com> I didn't realize that other invalid inputs raised different exceptions. Thus, as you suggest, the naked except is probably safer. Mark On Oct 20, 2010, at 4:22 PM, Eric Floehr wrote: > Mark, > > I think that way is pretty elegant. I don't know of a better way. Since you don't care, you could just do a naked "except:" which will catch everything and re-emit as a ValueError. > > I get bit by Decimal a lot because for purity it doesn't accept floats. In that case, a TypeError is raised. > > -Eric > > > On Wed, Oct 20, 2010 at 3:55 PM, Mark Erbaugh wrote: > I am developing some utility routines for parsing user input data. I would like all my routines to raise the same exception, i.e. ValueError, if the input data is invalid. In some cases, I can use routines already in the standard Python library. For example, decimal.Decimal() will take a string as input, so this is satisfactory to parse my input; however, decimal.Decimal() raises decimal.InvalidOperation if the string cannot be parsed. I could write code to catch the InvalidOperation exception and raise a ValueError, but I wonder if there is a better/more elegant way? > > Mark > > import decimal > > def str_to_decimal(x): > """ > convert do Decimal > > x - input > returns Decimal > raises ValueError if x is not valid format for Decimal > """ > try: > return decimal.Decimal(x) > except decimal.InvalidOperation: > raise ValueError > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Fri Oct 22 00:31:45 2010 From: eric at intellovations.com (Eric Floehr) Date: Thu, 21 Oct 2010 18:31:45 -0400 Subject: [CentralOH] AMS Short Course on Using Python in Climate and Meteorology Message-ID: * I was super excited to find out that the American Meteorological Society is putting on a two-day Python course before their huge annual meeting, which this coming year will be in Seattle. I just had to share :-)... AMS Short Course on Using Python in Climate and Meteorology, 22?23 January 2011, Seattle, WA * The AMS Short Course on Using Python in Climate and Meteorology will be held on January 22?23, 2011 preceding the 91st AMS Annual Meeting in Seattle, WA. Preliminary programs, registration, hotel, and general information will be posted on the AMS Web site ( http://www.ametsoc.org/MEET/annual/index.html) at a later date. In recent years the use of Python in the climate and meteorological communities has seen a sharp increase. Many powerful tools have been developed in Python and have reach maturity, such as, for example the Climate Data Analysis Tools (CDAT). In parallel the success of Intergovernmental Panel on Climate Change, Fourth Assessment report (IPCC AR4) has led to new technologies relying heavily on the Python programming language for their user interface (e.g. the Earth System Grid). Unfortunately both these communities still have deep roots into FORTRAN programming, and the transition to the next generation of tools isn?t necessarily easy. The goal of the course is to help the student to become familiar with Python programming in general and Python tools in the climate/meteorological communities in particular. It should help ?demystify? Python and ?object-oriented? programming. But the course is also targeting users with Python experience. It aims at helping more experienced programmers to sharpen their skills and discover new tools and techniques they can bring back into their every-day work. The course will be divided into 4 parts. The first part will present the Python programming language. The second part will introduce users to the most advanced Python-based set of tools available to the community: CDAT. The third part will demonstrate how to use Python to access one of the most extensive data resources available: the Earth System Grid. The last part will be a case study of integrative atmospheric science modeling and analysis using Python. The course format consists of two days of lectures mixed with hands on laboratory session with exercises that can be completed any time during the conference. The person responsible for the course is Charles Doutriaux, Program for Climate Model Diagnosis and Intercomparison (PCMDI), at Lawrence Livermore National Laboratory. Students will be on their own for lunch both days. Students should bring a fully-charged laptop with wireless card to the course. For more information please contact Charles Doutriaux at PCMDI, L-103, LLNL, 7000 East ave, Livermore, CA, 94550 (tel: 925-422-1487; email: doutriaux1 at llnl.gov ). (9/10) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Fri Oct 22 00:59:13 2010 From: nick.albright at gmail.com (Nick Albright) Date: Thu, 21 Oct 2010 18:59:13 -0400 Subject: [CentralOH] AMS Short Course on Using Python in Climate and Meteorology In-Reply-To: References: Message-ID: Nice! = ) -Nick On Thu, Oct 21, 2010 at 6:31 PM, Eric Floehr wrote: > * > I was super excited to find out that the American Meteorological Society is > putting on a two-day Python course before their huge annual meeting, which > this coming year will be in Seattle. I just had to share :-)... > > > AMS Short Course on Using Python in Climate and Meteorology, 22?23 January > 2011, Seattle, WA * > The AMS Short Course on Using Python in Climate and Meteorology will > be held on January 22?23, 2011 preceding the 91st AMS Annual Meeting in > Seattle, WA. Preliminary programs, registration, hotel, and general > information will be posted on the AMS Web site ( > http://www.ametsoc.org/MEET/annual/index.html) at a later date. > > In recent years the use of Python in the climate and meteorological > communities has seen a sharp increase. Many powerful tools have been > developed in Python and have reach maturity, such as, for example the > Climate Data Analysis Tools (CDAT). In parallel the success of > Intergovernmental Panel on Climate Change, Fourth Assessment report (IPCC > AR4) has led to new technologies relying heavily on the Python programming > language for their user interface (e.g. the Earth System Grid). > > Unfortunately both these communities still have deep roots into > FORTRAN programming, and the transition to the next generation of tools > isn?t necessarily easy. > > The goal of the course is to help the student to become familiar with > Python programming in general and Python tools in the climate/meteorological > communities in particular. It should help ?demystify? Python and > ?object-oriented? programming. But the course is also targeting users with > Python experience. It aims at helping more experienced programmers to > sharpen their skills and discover new tools and techniques they can bring > back into their every-day work. > > The course will be divided into 4 parts. The first part will present > the Python programming language. The second part will introduce users to the > most advanced Python-based set of tools available to the community: CDAT. > The third part will demonstrate how to use Python to access one of the most > extensive data resources available: the Earth System Grid. The last part > will be a case study of integrative atmospheric science modeling and > analysis using Python. > > The course format consists of two days of lectures mixed with hands > on laboratory session with exercises that can be completed any time during > the conference. The person responsible for the course is Charles Doutriaux, > Program for Climate Model Diagnosis and Intercomparison (PCMDI), at Lawrence > Livermore National Laboratory. > > Students will be on their own for lunch both days. Students should > bring a fully-charged laptop with wireless card to the course. > > For more information please contact Charles Doutriaux at PCMDI, > L-103, LLNL, 7000 East ave, Livermore, CA, 94550 (tel: 925-422-1487; email: > doutriaux1 at llnl.gov ). (9/10) > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.albright at gmail.com Fri Oct 22 16:53:45 2010 From: nick.albright at gmail.com (Nick Albright) Date: Fri, 22 Oct 2010 10:53:45 -0400 Subject: [CentralOH] Changing Exception Raised In-Reply-To: References: Message-ID: You might also try capturing the exception in an variable and then passing the string version of that to the constructor of the value error, so you can pass as much info in as possible: ie: try: return decimal.Decimal(x) except Exception, e: raise ValueError( str(e) ) Peace, -Nick On Wed, Oct 20, 2010 at 4:22 PM, Eric Floehr wrote: > Mark, > > I think that way is pretty elegant. I don't know of a better way. Since > you don't care, you could just do a naked "except:" which will catch > everything and re-emit as a ValueError. > > I get bit by Decimal a lot because for purity it doesn't accept floats. In > that case, a TypeError is raised. > > -Eric > > > On Wed, Oct 20, 2010 at 3:55 PM, Mark Erbaugh wrote: > >> I am developing some utility routines for parsing user input data. I would >> like all my routines to raise the same exception, i.e. ValueError, if the >> input data is invalid. In some cases, I can use routines already in the >> standard Python library. For example, decimal.Decimal() will take a string >> as input, so this is satisfactory to parse my input; however, >> decimal.Decimal() raises decimal.InvalidOperation if the string cannot be >> parsed. I could write code to catch the InvalidOperation exception and >> raise a ValueError, but I wonder if there is a better/more elegant way? >> >> Mark >> >> import decimal >> >> def str_to_decimal(x): >> """ >> convert do Decimal >> >> >> x - input >> returns Decimal >> raises ValueError if x is not valid format for Decimal >> """ >> try: >> return decimal.Decimal(x) >> except decimal.InvalidOperation: >> raise ValueError >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh >> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -- Please note that as of 1/20 I no longer have a land phone line, only my cell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at atlantixeng.com Mon Oct 25 08:20:56 2010 From: james at atlantixeng.com (James - Atlantix) Date: Mon, 25 Oct 2010 02:20:56 -0400 Subject: [CentralOH] Templates Message-ID: <006b01cb740c$c9a11dc0$5ce35940$@atlantixeng.com> I have been using Mako very successfully lately for autogeneration of VHDL code . . . sort of like generating C++ code with Python directives, if you will. ( don't know how many people are familiar with VHDL.) I get a little frustrated looking at all the Python template engines . . .and all the examples are for HTML. Cheetah often talks about how it can be used to generate things other than HTML, but doesn't really have any examples. I found Jinja2 a little too complicated for my purposes, and Evoque promises to be better than Mako but what I found was the Mako documentation as very thorough and useful . . . . and of course there is the homespun Tempita template language. But what I have found is that among the big three (Jinja2, Mako, Genshi) I prefer Mako . . . Of course, this may deserve a "survey" if Eric wants to facilitate one . . . Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From issac.kelly at gmail.com Mon Oct 25 16:02:00 2010 From: issac.kelly at gmail.com (Issac Kelly) Date: Mon, 25 Oct 2010 10:02:00 -0400 Subject: [CentralOH] Templates In-Reply-To: <006b01cb740c$c9a11dc0$5ce35940$@atlantixeng.com> References: <006b01cb740c$c9a11dc0$5ce35940$@atlantixeng.com> Message-ID: I guess, what I want to know, is what problem with manually making your VHDL are you trying to solve by templating it? There are other methods of creating source code in python, and those might be better suited, as most templating languages are made for markup languages like PDF, or LaTex or, as you noted, HTML. There are options like this: http://effbot.org/zone/python-code-generator.htm Where you could still be very explicit, but use things like string comprehension, and other powerful python functions to create. Also while looking for something else, I stumbled on Cheetah, which claims to be a code generating templating language. I for one can't wait for python on a chip to get a bit more mature. On Mon, Oct 25, 2010 at 2:20 AM, James - Atlantix wrote: > I have been using Mako very successfully lately for autogeneration of VHDL > code . . . sort of like generating C++ code with Python directives, if you > will. ( don?t know how many people are familiar with VHDL.) I get a little > frustrated looking at all the Python template engines . . .and all the > examples are for HTML. Cheetah often talks about how it can be used to > generate things other than HTML, but doesn?t really have any examples. I > found Jinja2 a little too complicated for my purposes, and Evoque promises > to be better than Mako but what I found was the Mako documentation as very > thorough and useful . . . . and of course there is the homespun Tempita > template language. But what I have found is that among the big three > (Jinja2, Mako, Genshi) I prefer Mako . . . Of course, this may deserve a > ?survey? if Eric wants to facilitate one . . . Thanks, James > > > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From issac.kelly at gmail.com Mon Oct 25 16:12:27 2010 From: issac.kelly at gmail.com (Issac Kelly) Date: Mon, 25 Oct 2010 10:12:27 -0400 Subject: [CentralOH] Templates In-Reply-To: References: <006b01cb740c$c9a11dc0$5ce35940$@atlantixeng.com> Message-ID: Here! This is the type of thing I was looking for: It seems several steps further along than I expected actually, http://www.myhdl.org/doku.php/start Dissappointing that the python hardware guys don't also use python on the web, but whatever :) On Mon, Oct 25, 2010 at 10:02 AM, Issac Kelly wrote: > I guess, what I want to know, is what problem with manually making your > VHDL are you trying to solve by templating it? > > There are other methods of creating source code in python, and those might > be better suited, as most templating languages are made for markup languages > like PDF, or LaTex or, as you noted, HTML. > > There are options like this: > http://effbot.org/zone/python-code-generator.htm Where you could still be > very explicit, but use things like string comprehension, and other powerful > python functions to create. > > Also while looking for something else, I stumbled on Cheetah, which claims > to be a code generating templating language. > > I for one can't wait for python on a chip to get a bit more mature. > > > On Mon, Oct 25, 2010 at 2:20 AM, James - Atlantix wrote: > >> I have been using Mako very successfully lately for autogeneration of VHDL >> code . . . sort of like generating C++ code with Python directives, if you >> will. ( don?t know how many people are familiar with VHDL.) I get a little >> frustrated looking at all the Python template engines . . .and all the >> examples are for HTML. Cheetah often talks about how it can be used to >> generate things other than HTML, but doesn?t really have any examples. I >> found Jinja2 a little too complicated for my purposes, and Evoque promises >> to be better than Mako but what I found was the Mako documentation as very >> thorough and useful . . . . and of course there is the homespun Tempita >> template language. But what I have found is that among the big three >> (Jinja2, Mako, Genshi) I prefer Mako . . . Of course, this may deserve a >> ?survey? if Eric wants to facilitate one . . . Thanks, James >> >> >> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.scites at railcar88.com Tue Oct 26 13:26:48 2010 From: scott.scites at railcar88.com (Scott Scites) Date: Tue, 26 Oct 2010 07:26:48 -0400 Subject: [CentralOH] Python DoJoe Hacker Session Notes Message-ID: I (@railcar88) updated the Python DoJoe web site hackery page with Morgan's projects and began to test/fix the build.sh file in the pyjamas blogjamas example. Morgan Goose (@morganiangoose) continued his work toward extending pycco (http://github.com/goosemo/pycco) functionality. See you next week! -------------- next part -------------- An HTML attachment was scrubbed... URL: From godber at gmail.com Tue Oct 26 14:41:40 2010 From: godber at gmail.com (Austin Godber) Date: Tue, 26 Oct 2010 08:41:40 -0400 Subject: [CentralOH] ATOM Source and Message-ID: Hello folks, The link below contains the source to my presentation for those who are interested. This RestructuredText route was OK as long as I wasn't specific about how I wanted it to look, I will probably use this again at least a few times. http://github.com/godber/ATOM It was mostly inspired by this post, which shows how to include a background as well: http://lateral.netmanagers.com.ar/stories/BBS52.html I was also talking to a few of you later about an error logging app that integrates error logging with issue tracking, it can be found here: http://areciboapp.com http://github.com/andymckay/arecibo Thanks for listening to my talk, I hope everyone got something from it. Austin From morgan.goose at gmail.com Tue Oct 26 15:06:45 2010 From: morgan.goose at gmail.com (Morgan Goose) Date: Tue, 26 Oct 2010 09:06:45 -0400 Subject: [CentralOH] ATOM Source and In-Reply-To: References: Message-ID: <20101026130645.GG23538@grumpy.morgan-dyn-o-saur.com> I like that you're using reST for the presentation. Have you looked into using s5 for making it into an html slideshow at all? I ask because thats usually how I handle them now. I still compile to pdf, and if you wanted a bit of code I ganked from somewhere to use pygments to highlight code-blocks: in reST, I mention it on a post I made for using reST and presentations. http://morgangoose.com/blog/2010/09/12/using-rst-for-presentations/ and my fabfile with the command I use to compile it with said bit is mentioned here: http://morgangoose.com/blog/2010/02/how-fabric-gets-it-right/ Great presentation as well. I didn't know about the lssitepackages command I'd just been installing yolk and using it to do the listing. goose On Tue, Oct 26, 2010 at 08:41:40AM -0400, Austin Godber wrote: > Hello folks, > > The link below contains the source to my presentation for those who > are interested. This RestructuredText route was OK as long as I > wasn't specific about how I wanted it to look, I will probably use > this again at least a few times. > > http://github.com/godber/ATOM > > It was mostly inspired by this post, which shows how to include a > background as well: > > http://lateral.netmanagers.com.ar/stories/BBS52.html > > I was also talking to a few of you later about an error logging app > that integrates error logging with issue tracking, it can be found > here: > > http://areciboapp.com > http://github.com/andymckay/arecibo > > Thanks for listening to my talk, I hope everyone got something from it. > > Austin > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh ---end quoted text--- From issac.kelly at gmail.com Tue Oct 26 15:18:41 2010 From: issac.kelly at gmail.com (Issac Kelly) Date: Tue, 26 Oct 2010 09:18:41 -0400 Subject: [CentralOH] ATOM Source and In-Reply-To: <20101026130645.GG23538@grumpy.morgan-dyn-o-saur.com> References: <20101026130645.GG23538@grumpy.morgan-dyn-o-saur.com> Message-ID: Yeah, I was surprised by the lssitepackages as well, I had used this in pip before $ pip freeze > stable-req.txt http://pip.openplans.org/#freezing-requirements but lssitepackages seems more handy for everyday stuff. On Tue, Oct 26, 2010 at 9:06 AM, Morgan Goose wrote: > I like that you're using reST for the presentation. Have you looked into using > s5 for making it into an html slideshow at all? I ask because thats usually how > I handle them now. I still compile to pdf, and if you wanted a bit of code I > ganked from somewhere to use pygments to highlight code-blocks: in reST, I > mention it on a post I made for using reST and presentations. > ? ?http://morgangoose.com/blog/2010/09/12/using-rst-for-presentations/ > > and my fabfile with the command I use to compile it with said bit is > mentioned here: > ? ?http://morgangoose.com/blog/2010/02/how-fabric-gets-it-right/ > > Great presentation as well. I didn't know about the lssitepackages command I'd > just been installing yolk and using it to do the listing. > > goose > > On Tue, Oct 26, 2010 at 08:41:40AM -0400, Austin Godber wrote: >> Hello folks, >> >> The link below contains the source to my presentation for those who >> are interested. ?This RestructuredText route was OK as long as I >> wasn't specific about how I wanted it to look, I will probably use >> this again at least a few times. >> >> http://github.com/godber/ATOM >> >> It was mostly inspired by this post, which shows how to include a >> background as well: >> >> http://lateral.netmanagers.com.ar/stories/BBS52.html >> >> I was also talking to a few of you later about an error logging app >> that integrates error logging with issue tracking, it can be found >> here: >> >> http://areciboapp.com >> http://github.com/andymckay/arecibo >> >> Thanks for listening to my talk, I hope everyone got something from it. >> >> Austin >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > ---end quoted text--- > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > From james at atlantixeng.com Tue Oct 26 19:38:20 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 26 Oct 2010 13:38:20 -0400 Subject: [CentralOH] Custom Compilers Message-ID: <004501cb7534$954b99a0$bfe2cce0$@com> I think it possible to build customer parser/generators (or declarative compilers, as I call them) with Python . . . I once did a project with about 20,000 lines of Perl code that parsed a Simulink diagram, linked, and generated VHDL from that by linking to pre-established VHDL libraries . . . . Python's ease of object orientation and structure is a bit better for that, although regex handling in Perl is still a "bit" more powerful in some cases . . . but I haven't written a line of Perl code in 3.5 years now since using Python . . . James -------------- next part -------------- An HTML attachment was scrubbed... URL: From godber at gmail.com Tue Oct 26 19:58:28 2010 From: godber at gmail.com (Austin Godber) Date: Tue, 26 Oct 2010 13:58:28 -0400 Subject: [CentralOH] ATOM Source and In-Reply-To: <20101026130645.GG23538@grumpy.morgan-dyn-o-saur.com> References: <20101026130645.GG23538@grumpy.morgan-dyn-o-saur.com> Message-ID: I had used S5 alone in the past, see my virtualization presentations in 2007 below. It felt really clunky back then so I switched away from it. http://uberhip.com/projects/presentations.html I have not tried rst2s5 yet though I will probably tweak rst off and on for a while. I think for screen and print I prefer PDF, though automatically generating s5 for google indexing purposes is not a bad idea. Austin On Tue, Oct 26, 2010 at 9:06 AM, Morgan Goose wrote: > I like that you're using reST for the presentation. Have you looked into using > s5 for making it into an html slideshow at all? I ask because thats usually how > I handle them now. I still compile to pdf, and if you wanted a bit of code I > ganked from somewhere to use pygments to highlight code-blocks: in reST, I > mention it on a post I made for using reST and presentations. > ? ?http://morgangoose.com/blog/2010/09/12/using-rst-for-presentations/ > > and my fabfile with the command I use to compile it with said bit is > mentioned here: > ? ?http://morgangoose.com/blog/2010/02/how-fabric-gets-it-right/ > > Great presentation as well. I didn't know about the lssitepackages command I'd > just been installing yolk and using it to do the listing. > > goose > > On Tue, Oct 26, 2010 at 08:41:40AM -0400, Austin Godber wrote: >> Hello folks, >> >> The link below contains the source to my presentation for those who >> are interested. ?This RestructuredText route was OK as long as I >> wasn't specific about how I wanted it to look, I will probably use >> this again at least a few times. >> >> http://github.com/godber/ATOM >> >> It was mostly inspired by this post, which shows how to include a >> background as well: >> >> http://lateral.netmanagers.com.ar/stories/BBS52.html >> >> I was also talking to a few of you later about an error logging app >> that integrates error logging with issue tracking, it can be found >> here: >> >> http://areciboapp.com >> http://github.com/andymckay/arecibo >> >> Thanks for listening to my talk, I hope everyone got something from it. >> >> Austin >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > ---end quoted text--- > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > From james at atlantixeng.com Tue Oct 26 20:24:39 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 26 Oct 2010 14:24:39 -0400 Subject: [CentralOH] Python -- Templates -- Specific Targets Message-ID: <005a01cb753b$0da57aa0$28f06fe0$@com> For those not itereested in VHDL, there is a header template which would show how to make a hader with Mako for general Python programming below . . . . Issac; These are good comments however I have long ago evaluated MyHDL as not appropriate for me. (It is essentially more or less geared towards Verilog although it claims VHDL support & seems confusing layer on top of these languages.) I should be more specifica about my Mako usage. I am using is essentially in the role of parser/linker in the chain of lex/parser/linker/compiler . . . . I have a very comprehensive suite of self made VHDL libraries that I intelligently assemble with Mako, so Mako has lots of <$defs > inside the template. For example, lets say I wanted to build and array of 24 debouncer circuits. I have a nice hierarchical, parameterized VHDL module for this. Mako does look something like this: debouncetemplate = Template(""" <%def name = "Debouncer(instance,enEN,enRST,EN,RST,DIN,DOUT)"> ${instance} : entity work.debounce(rtl) port map( CLK => CLK, HRST => HRST, % if enEN: EN => ${EN}, % else: EN => '1', % endif % if enRST: RST_FF => ${RST}, % endif DIN => ${DIN}, DOUT => ${DOUT} ); """) Atlantixheader = Template(""" <%def name = "Header(module,fname,time,author,company)"> --========================================================================== ============= -- Module Name: ${module} -- File Name: ${fname} -- Created: ${time} -- Revised: ${time} -- Company: ${company} -- Author: ${author} -- -- Legal: This software is coverered under the proprietary terms and conditions of -- Atlantix Engineering LLC. Not for use or reproduction by third parties -- outside of Atlantix Engineering. All Rights Reserved. --========================================================================== ==============""") VHDLentity = Template(""" <%def name = "Header(entity,signals)"> library IEEE; use IEEE.STD_LOGIC_1164.all; use ieee.numeric_std.all; entity ${entity} is port( CLK : in std_logic; HRST : in std_logic; % for (a,b) in signals: ${a}\t : ${b} % endfor ); end ${entity};""") from time import strftime gendate = strftime("%m/%d/%Y at %H.%M hours") print Atlantixheader.get_def("Header").render(module="Debouncer Array", fname="Debouncer Array.vhd", time=gendate, author="James Bonannno", company="Atlantix Engineering") num_inputs = 10 vector_size = " std_logic_vector(%s downto 0)" % str(num_inputs-1) print VHDLentity.get_def("Header").render(entity="DebouncerArray",signals = (('EN','in std_logic;'), ('RST','in std_logic;'), ('DIN','in'+vector_size+';'), ('DOUT','out'+vector_size))) The programmatic generation would be like this: for j in range(10): print Debouncetemplate.get_def("Debouncer").render(instance = "U%s"%str(j+1), enEN = False, enRST = False, EN="enbit%s"%str(j), RST="rstFault%s"%str(j), DIN="DIN(%s)"%str(j), DOUT = "DOUT(%s)"%str(j)) Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From wam at cisco.com Tue Oct 26 20:38:26 2010 From: wam at cisco.com (William McVey) Date: Tue, 26 Oct 2010 14:38:26 -0400 Subject: [CentralOH] Custom Compilers In-Reply-To: <004501cb7534$954b99a0$bfe2cce0$@com> References: <004501cb7534$954b99a0$bfe2cce0$@com> Message-ID: <1288118306.2021.24973.camel@goldfinger> On Tue, 2010-10-26 at 13:38 -0400, James - Atlantix wrote: > I think it possible to build customer parser/generators (or > declarative compilers, as I call them) with Python . . Sure, there are lots of parser tools available for Python. Many of the tools are listed at: http://wiki.python.org/moin/LanguageParsing I have used PyParsing (http://pyparsing.wikispaces.com/) on several projects and like it a lot. If I needed to parse a grammar that went beyond the capabilities of pyparsing, I'd probably reach for ANTLR (http://www.antlr.org/), which supports python as a target language. > Python's ease of object orientation and structure is a bit better for > that, although regex handling in Perl is still a "bit" more powerful > in some cases . . . but I haven't written a line of Perl code in 3.5 > years now since using Python . . . Simple regexs (which python handles just fine) might be suitable for building a tokenizer with, but if you start getting into the corner cases of regexs that perl might outshine python in, then you're likely going to have serious issues with your parse grammar when one of your complex regexs gets stuck in a catastrophic backtrace or over/under matches. -- William From wam at cisco.com Tue Oct 26 21:15:48 2010 From: wam at cisco.com (William McVey) Date: Tue, 26 Oct 2010 15:15:48 -0400 Subject: [CentralOH] rst based presentations (was: Re: ATOM Source and) In-Reply-To: References: Message-ID: <1288120548.2021.25021.camel@goldfinger> A couple of years ago I, and a few PyOhio sprinters, worked on a tool called rst2odp*. It converts reStructuredText to OpenOffice's Presenter format. I liked it a lot better than S5, as Presenter allows you much more control of the display and transitions. I was also much more confident in Presenter's ability to rescale my slide deck to alternate resolutions needed by projectors and video capture devices, than S5's rescaling ability. rst2odp can be found in the docutils sandbox and from pypi. -- William * To be clear, we sprinted on improving rst2odp. It wasn't something we invented or anything. From james at atlantixeng.com Tue Oct 26 21:34:45 2010 From: james at atlantixeng.com (James - Atlantix) Date: Tue, 26 Oct 2010 15:34:45 -0400 Subject: [CentralOH] Parser-Interpeter in Python Message-ID: <003b01cb7544$d89f1000$89dd3000$@atlantixeng.com> William; pyPEG ( at http://fdik.org/pyPEG/ ) is very interesting to me. I haven't seen this before. Thanks for the link. James -------------- next part -------------- An HTML attachment was scrubbed... URL: From douglas.m.stanley at gmail.com Wed Oct 27 01:57:28 2010 From: douglas.m.stanley at gmail.com (Douglas Stanley) Date: Tue, 26 Oct 2010 19:57:28 -0400 Subject: [CentralOH] Python -- Templates -- Specific Targets In-Reply-To: <005a01cb753b$0da57aa0$28f06fe0$@com> References: <005a01cb753b$0da57aa0$28f06fe0$@com> Message-ID: On a related note (not to hijack the thread or anything) what about generating bash shell scripts (like init scripts)? It seems a template language that uses $ in variable names wouldn't work so well. Any suggestions? Doug On Oct 26, 2010 2:24 PM, "James - Atlantix" wrote: For those not itereested in VHDL, there is a header template which would show how to make a hader with Mako for general Python programming below . . . . Issac; These are good comments however I have long ago evaluated MyHDL as not appropriate for me. (It is essentially more or less geared towards Verilog although it claims VHDL support & seems confusing layer on top of these languages.) I should be more specifica about my Mako usage. I am using is essentially in the role of parser/linker in the chain of lex/parser/linker/compiler . . . . I have a very comprehensive suite of self made VHDL libraries that I intelligently assemble with Mako, so Mako has lots of <$defs > inside the template. For example, lets say I wanted to build and array of 24 debouncer circuits. I have a nice hierarchical, parameterized VHDL module for this. Mako does look something like this: debouncetemplate = Template(""" <%def name = "Debouncer(instance,enEN,enRST,EN,RST,DIN,DOUT)"> ${instance} : entity work.debounce(rtl) port map( CLK => CLK, HRST => HRST, % if enEN: EN => ${EN}, % else: EN => '1', % endif % if enRST: RST_FF => ${RST}, % endif DIN => ${DIN}, DOUT => ${DOUT} ); """) Atlantixheader = Template(""" <%def name = "Header(module,fname,time,author,company)"> --======================================================================================= -- Module Name: ${module} -- File Name: ${fname} -- Created: ${time} -- Revised: ${time} -- Company: ${company} -- Author: ${author} -- -- Legal: This software is coverered under the proprietary terms and conditions of -- Atlantix Engineering LLC. Not for use or reproduction by third parties -- outside of Atlantix Engineering. All Rights Reserved. --========================================================================================""") VHDLentity = Template(""" <%def name = "Header(entity,signals)"> library IEEE; use IEEE.STD_LOGIC_1164.all; use ieee.numeric_std.all; entity ${entity} is port( CLK : in std_logic; HRST : in std_logic; % for (a,b) in signals: ${a}\t : ${b} % endfor ); end ${entity};""") from time import strftime gendate = strftime("%m/%d/%Y at %H.%M hours") print Atlantixheader.get_def("Header").render(module="Debouncer Array", fname="Debouncer Array.vhd", time=gendate, author="James Bonannno", company="Atlantix Engineering") num_inputs = 10 vector_size = " std_logic_vector(%s downto 0)" % str(num_inputs-1) print VHDLentity.get_def("Header").render(entity="DebouncerArray",signals = (('EN','in std_logic;'), ('RST','in std_logic;'), ('DIN','in'+vector_size+';'), ('DOUT','out'+vector_size))) The programmatic generation would be like this: for j in range(10): print Debouncetemplate.get_def("Debouncer").render(instance = "U%s"%str(j+1), enEN = False, enRST = False, EN="enbit%s"%str(j), RST="rstFault%s"%str(j), DIN="DIN(%s)"%str(j), DOUT = "DOUT(%s)"%str(j)) Thanks, James _______________________________________________ CentralOH mailing list CentralOH at python.org http://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonebird at gmail.com Thu Oct 28 02:20:23 2010 From: jonebird at gmail.com (Jon Miller) Date: Wed, 27 Oct 2010 20:20:23 -0400 Subject: [CentralOH] Ugliest Line of Python Ever? Message-ID: I think I just typed the ugliest line of python code in iPython ever?... and I don't mind sharing it since you might get a chuckle out of it: In [18]: datetime.datetime(*[ int(x) for x in (game.gametime - datetime.timedelta(hours=24)).strftime('%Y %m %d 12 0').split()]) Out[18]: datetime.datetime(2010, 10, 27, 12, 0) I was trying to create a datetime object for twelve noon on the previous day before the game. (game is the DB object and game.gametime should be pretty obvious) I'm going to split it up for readability but I'm still don't have a better way to do this. -- Jon Miller From chris at developingchris.com Thu Oct 28 03:13:51 2010 From: chris at developingchris.com (Chris Chandler) Date: Wed, 27 Oct 2010 21:13:51 -0400 Subject: [CentralOH] Ugliest Line of Python Ever? In-Reply-To: References: Message-ID: what about? from datetime import datetime,timedelta,time,date print datetime.combine(game.gametime.date() - timedelta(days=1), time(12,0)) Then at least its less,hand wavy with the formatting. Thanks, Chris Chandler 352-871-0712 On Wed, Oct 27, 2010 at 8:20 PM, Jon Miller wrote: > I think I just typed the ugliest line of python code in iPython > ever?... and I don't mind sharing it since you might get a chuckle out > of it: > > In [18]: datetime.datetime(*[ int(x) for x in (game.gametime - > datetime.timedelta(hours=24)).strftime('%Y %m %d 12 0').split()]) > Out[18]: datetime.datetime(2010, 10, 27, 12, 0) > > I was trying to create a datetime object for twelve noon on the > previous day before the game. > (game is the DB object and game.gametime should be pretty obvious) > > I'm going to split it up for readability but I'm still don't have a > better way to do this. > > -- Jon Miller > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonebird at gmail.com Thu Oct 28 04:30:58 2010 From: jonebird at gmail.com (Jon Miller) Date: Wed, 27 Oct 2010 22:30:58 -0400 Subject: [CentralOH] Ugliest Line of Python Ever? In-Reply-To: References: Message-ID: Much cleaner! Thanks. Jon Miller On Wed, Oct 27, 2010 at 9:13 PM, Chris Chandler wrote: > what about? > > from datetime import datetime,timedelta,time,date > print datetime.combine(game.gametime.date() - timedelta(days=1), time(12,0)) > > Then at least its less,hand wavy with the formatting. > > Thanks, > Chris Chandler > 352-871-0712 > > > On Wed, Oct 27, 2010 at 8:20 PM, Jon Miller wrote: >> >> I think I just typed the ugliest line of python code in iPython >> ever?... and I don't mind sharing it since you might get a chuckle out >> of it: >> >> In [18]: datetime.datetime(*[ int(x) for x in (game.gametime - >> datetime.timedelta(hours=24)).strftime('%Y %m %d 12 0').split()]) >> Out[18]: datetime.datetime(2010, 10, 27, 12, 0) >> >> I was trying to create a datetime object for twelve noon on the >> previous day before the game. >> (game is the DB object and game.gametime should be pretty obvious) >> >> I'm going to split it up for readability but I'm still don't have a >> better way to do this. >> >> -- Jon Miller >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> http://mail.python.org/mailman/listinfo/centraloh > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh > > From james at atlantixeng.com Fri Oct 29 10:06:31 2010 From: james at atlantixeng.com (James - Atlantix) Date: Fri, 29 Oct 2010 04:06:31 -0400 Subject: [CentralOH] Python, py2exe, and Windows Message-ID: <009201cb7740$32d7b200$98871600$@atlantixeng.com> I have done exhaustive searching and efforts to get a PyQt program to compile with py2exe and run under Windows 7. It simply will not. I am fine with Python 2.5, but not with Python 2.6. I have done the side by side installation of the MSVCR90.dll and a manifest file in my dist directory . . . . and followed about a dozen examples on the web. My only logical conclusion at this point is that Windows is fried and my main alternative is to distribute .pyc files along with the minimal distro of Python that I need. Windows is like the grand vision of the hallucinogenic collective, perhaps more amorphous and delicately sublime than that. James -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Fri Oct 29 14:17:57 2010 From: mark at microenh.com (Mark Erbaugh) Date: Fri, 29 Oct 2010 08:17:57 -0400 Subject: [CentralOH] Python, py2exe, and Windows In-Reply-To: <009201cb7740$32d7b200$98871600$@atlantixeng.com> References: <009201cb7740$32d7b200$98871600$@atlantixeng.com> Message-ID: <760F28CC-B30E-4C1A-ADB3-BBCC55D4C2BA@microenh.com> On Oct 29, 2010, at 4:06 AM, James - Atlantix wrote: > I have done exhaustive searching and efforts to get a PyQt program to compile with py2exe and run under Windows 7. It simply will not. I am fine with Python 2.5, but not with Python 2.6. I have done the side by side installation of the MSVCR90.dll and a manifest file in my dist directory . . . . and followed about a dozen examples on the web. My only logical conclusion at this point is that Windows is fried and my main alternative is to distribute .pyc files along with the minimal distro of Python that I need. Windows is like the grand vision of the hallucinogenic collective, perhaps more amorphous and delicately sublime than that. > > James > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > http://mail.python.org/mailman/listinfo/centraloh James, If you have to go the route of distributing .pyc files, look a the standard library zipfile.PyZipFile routine. This takes a directory, compiles the .py files to .pyo and creates a .zip file, containing just the .pyo files. In your startup code, which still needs to be outside the zip, but can be trivial, you add the zip file to sys.path. For several versions, Python has had the ability to do import's directly from a zip file. Here's a simple script to create the zip file: import zipfile f = zipfile.PyZipFile(, 'w', Z.ZIP_DEFLATED) for i in (): f.writepy(i) f.close() using this scheme, I have created a .zip file on one OS (i.e. Mac OSX) and run the application on Linux or Windows (XP, haven't tried newer). The only caveat is that the Python installed has to be of the same major version, i.e. 2.6. For example, my Mac runs 2.6.1 and the created zip file works on Windows XP with 2.6.5, but wouldn't work with 2.5.x or 2.7.x For slightly added security, you don't need to name the ZIP file with a .zip extension. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at atlantixeng.com Sat Oct 30 12:24:01 2010 From: james at atlantixeng.com (James - Atlantix) Date: Sat, 30 Oct 2010 06:24:01 -0400 Subject: [CentralOH] Zip Files Distro .pyc Message-ID: <015c01cb781c$92837fe0$b78a7fa0$@com> Mark; Your suggestion is much appreciate & I see it as an excellent approach. I will try this. This suggestion is on the line of using the "compile" command in Python to generate .pyd / .pyc files. ( See http://docs.python.org/library/py_compile.html ) On another note, I have this crazy idea: I will use a small non-volatile FPGA (such as one from Lattice Seminconductor, such as their LatticeXP2 device) and power it from the USB port. I will then make a small kernel in the GUI program that will use some form of encryption and talk to the FPGA over the USB port . . making sure to get the right security key back to enable the program. The kernel will then hand off operation to the rest of the program. During the main GUI operation, there will periodically be a polling or a "self internalized cron job" that will go out an access the security key on the FPGA. This is a bit more homegrown that using a USB key and Aladdin driver, etc. Funny thing is, I have all the code working to do this, as well as hardware to test the idea. Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at microenh.com Sat Oct 30 15:44:21 2010 From: mark at microenh.com (Mark Erbaugh) Date: Sat, 30 Oct 2010 09:44:21 -0400 Subject: [CentralOH] Zip Files Distro .pyc In-Reply-To: <015c01cb781c$92837fe0$b78a7fa0$@com> References: <015c01cb781c$92837fe0$b78a7fa0$@com> Message-ID: <2C578280-2237-4812-983D-599F3EB1E309@microenh.com> On Oct 30, 2010, at 6:24 AM, James - Atlantix wrote: > Mark; > > Your suggestion is much appreciate & I see it as an excellent approach. I will try this. This suggestion is on the line of using the "compile" command in Python to generate .pyd / .pyc files. > > ( See http://docs.python.org/library/py_compile.html ) The zipfile.PyZipFile class will do the compilation for you. I just re-read the docs on it and discovered that it doesn't compile to .pyo, but to .pyc; however, it will use a .pyo file if present. If the .pyo file was created with the -OO command line switch to the python interpreter, docstrings will be removed. That would provide you with some additional security, as otherwise, well-written docstrings which you need for maintenance might give away your secrets to someone who browses the code. > > On another note, I have this crazy idea: > > I will use a small non-volatile FPGA (such as one from Lattice Seminconductor, such as their LatticeXP2 device) and power it from the USB port. I will then make a small kernel in the GUI program that will use some form of encryption and talk to the FPGA over the USB port . . making sure to get the right security key back to enable the program. The kernel will then hand off operation to the rest of the program. During the main GUI operation, there will periodically be a polling or a "self internalized cron job" that will go out an access the security key on the FPGA. This is a bit more homegrown that using a USB key and Aladdin driver, etc. Funny thing is, I have all the code working to do this, as well as hardware to test the idea. > Sometimes, it's best to work with what you know. That's why I bet there are more 'database' applications out there written in Excel than in a proper database. As far as verifying the security device, rather than having an automatic task, you might just have your code check for the device a key points in the process. For example, right before the program generates any output. If that check slows things down too much, you could keep a counter of how many times a certain step has been executed and check the device every n-th time. In fact, you could code the check into a simple class and just call it's 'check_security' (or similar) method at strategic points throughout the program. If no check was needed (because one had been done recently), it would just return. Otherwise it would check the device and and return if it was okay or take whatever action (probably shut down the program with a message) if the device wasn't present. If you put all the calls to check the security device in one place, it would be easy to enable or disable checks or change the behavior. If you wanted to be even more secure, you could encrypt the .pyo files and have the decryption routine in the FPGA. You could hook python's import mechanism to take the encrypted file and run it through the decryption before loading it. Thus the unencrypted code would only exist in memory, making it harder (but not impossible - I just read COhPy's copy of "Gray Hat Python" and they discuss methods of getting at code in similar situations). How much do you think it would cost to make the FPGA device? Would this be something that could be marketed to other Python programmers who need to protect their source code? Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: