ANN: Image Processing with Python Kickstarter

2021-01-04 Thread Mike Driscoll
Hi! I've been busily working on a new book on image processing with Python
that uses the Pillow package. Pillow is the friendly fork of the Python
Imaging Library and is one of the most popular Python image processing
tools.

If you'd like to learn more, you can check out my Kickstarter:
https://www.kickstarter.com/projects/driscollis/image-processing-with-python

Here are some of the topics that the book will cover:


   - Accessing image metadata
   - Working with image colors
   - Opening / viewing images with Python
   - Applying filters to images
   - Cropping, rotating, and resizing photos
   - Enhancing photos with Python
   - Combining images
   - and more!

Thanks,
Mike
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


Python 101 2nd Edition book

2020-02-18 Thread Mike Driscoll
Hi,

Years ago I posted about my first book, Python 101 on here and people really 
enjoyed it. I am working on a complete rewrite of the book and thought there 
might be people here who would enjoy knowing about it.

You can read more here: 
https://www.blog.pythonlibrary.org/2020/02/17/python-101-2nd-edition-kickstarter-is-live/

Feel free to ask any questions that you might have as well.

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38587] __set_name__ missing from descriptor howto documentation

2019-10-24 Thread Mike Driscoll


New submission from Mike Driscoll :

I noticed that __set_name__ is not mentioned in 
https://docs.python.org/3/howto/descriptor.html even though it was added in 
https://www.python.org/dev/peps/pep-0487/ and mentioned here 
https://docs.python.org/3/whatsnew/3.6.html#pep-487-descriptor-protocol-enhancements

--
assignee: docs@python
components: Documentation
messages: 355345
nosy: Mike Driscoll, docs@python
priority: normal
severity: normal
status: open
title: __set_name__ missing from descriptor howto documentation
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue38587>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



ANN: Creating GUI Applications with wxPython

2019-01-14 Thread Mike Driscoll
Hi,

I just thought I would let you all know that I am working on my 2nd wxPython 
book, "Creating GUI Applications with wxPython". This one will be about 
actually creating small runnable applications instead of just recipes like my 
Cookbook did. I hope to have 8-10 working applications included with the book.

You can read more about it here if you are interested: 
https://www.blog.pythonlibrary.org/2019/01/14/creating-gui-applications-with-wxpython-kickstarter/

Feel free to ask me questions about it too.

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: ReportLab Book Kickstarter

2018-01-31 Thread Mike Driscoll
I have recently started my 4th self-published book, ReportLab: PDF
Processing with Python. This is the first book on ReportLab, a great
package for creating reports in the PDF format. You can read more about it
here:
https://www.kickstarter.com/projects/34257246/reportlab-pdf-processing-with-python

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Where are the moderators?

2018-01-18 Thread Mike Driscoll
Hi,

What happened to the moderators? I have always liked this forum, but there's so 
much spam now. Is there a way to become a moderator so this can be cleaned up?

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: wxPython Cookbook

2016-08-26 Thread Mike Driscoll
Hi,

Several years ago, the readers of my popular Python blog
 asked me to take some of my articles
and turn them into a cookbook on wxPython. I have finally decided to do
just that. I am including over 50 recipes that I am currently editing to
make them more consistent and updating them to be compatible with the
latest versions of wxPython. I currently have nearly 300 pages of content!

If you'd like to check out the funding campaign for the book, you can find
it here: https://www.kickstarter.com/projects/34257246/wxpython-cookbook/

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Wanted Python programmer to join team

2016-05-20 Thread Mike Driscoll
On Tuesday, May 17, 2016 at 12:20:53 AM UTC-5, Steven D'Aprano wrote:
> On Tuesday 17 May 2016 12:56, Chris Angelico wrote:
> 
> > On Tue, May 17, 2016 at 12:37 PM, Steven D'Aprano <>
> > wrote:
> >> On Tue, 17 May 2016 09:07 am, Chris Angelico wrote:
> >>
> >>> I'm not overly bothered by the use of GMail for a business address,
> >>
> >> It's 2016. Using a gmail address for your business (unless you're a really
> >> small business, like a sole trader or something) is equivalent to a postal
> >> address of "Leave mail with the lady in the milk bar on the corner".
> >>
> >> It's not hard to run your own mail server. *I* can do it. At the very 
> >> least,
> >> register a domain and tell Gmail to use that, and *pretend* you're running
> >> your own mail server.
> > 
> > And a lot of job postings do come from that sort of really small
> > business, trying to expand a bit. Plus, some of them want some
> > anonymity (why, I don't know, but there are plenty of jobs posted
> > without too much in the way of company details)
> 
> That probably means the job advert is coming from a recruiter. They don't 
> want 
> people to contact the company directly, and they want to hide the fact that 
> they are a recruiter.
> 
> Personally, I think that advertising a job position without saying who you 
> are, 
> what you do, and offering at least an indicative salary range, are 
> *astonishingly* rude (to say nothing of counter-productive). If I see a job 
> for 
> (let's say) Blackwater[1], paying $900,000 a year, then I know that (1) I 
> don't 
> want to work for them, and (2) even if I did, I wouldn't be qualified; so I 
> don't waste either my time or theirs applying. But when I see a job for some 
> unnamed company with an unknown salary doing something often couched in the 
> vaguest possible terms, I end up wasting everyone's time.

+1

I have had recruiters from within Company A bug me about their company, but 
when I asked about a salary range, they said that they wouldn't discuss that 
until a later stage but that I would be happy with it. How would they know? 
They don't know what I make or what would make me happy! I ignored them after 
that even though I was interested in working for Company A.

They do a lot of weird things. Frankly the ones that look like they spam 
everyone provide more information than the more professional recruiters.

- Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Resources/pointers for writing maintable, testable Python

2016-05-19 Thread Mike Driscoll
On Thursday, May 19, 2016 at 11:23:53 AM UTC-5, Terry Reedy wrote:
> On 5/19/2016 11:33 AM, Mike Driscoll wrote:
> > On Wednesday, May 18, 2016 at 4:48:28 PM UTC-5, Andrew Farrell wrote:
> >> Hi Jacob,
> >>
> >> You are probably looking for the book Test-Driven Development with Python
> >> <http://chimera.labs.oreilly.com/books/123400754/index.html>.
> 
> Electronic version is free online.
> 
> > I was under the impression that this book is primarily aimed at 
> > Python/Django web testing. I saw
> 
> It is.  However, the first four chapters cover the general principles of 
> TDD, so one can read them while thinking of web development as just an 
> illustrative example.
> 
> In my case, I learned better how to test IDLE from a user perspective. 
> For tkinter apps, an external program such as Selenium is not needed. 
> Tk/tkinter have the simulated event generation and introspection needed 
> to simulate a user hitting keys, clicking mouse buttons, and reading the 
> screen.
> 
> -- 
> Terry Jan Reedy

I am curious. Where is this documented? Are you referring to calling the 
invoke() method on each widget?

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.5.1

2016-05-19 Thread Mike Driscoll
On Thursday, May 19, 2016 at 12:21:52 PM UTC-5, kbell...@aol.com wrote:
> Thisis my first encountering with Python. I have successfully downloaded 
> Python3.5.1 for Windows but see only a black window with command prompt. I do 
> not see IDLE under PYthon on Windows Start Menu.
> 
> 
> Downloaded version of Python is based on 32-bit and my PC is 64-bit. 
>  
> Couldyo please help and provide guidance?
> 
> 
> Thank you very much.
> 
> 
> Bella

You should have a folder in your Start Menu for Python. Inside of that, there 
should be a shortcut for IDLE. If there's not, then I'm guessing it didn't 
install correctly. I haven't had any problems installing Python 3.5 on my 
Windows PCs, although I have had issues getting it installed in certain locked 
down virtual environments.

Try uninstalling and then reinstalling Python 3.5

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Resources/pointers for writing maintable, testable Python

2016-05-19 Thread Mike Driscoll
On Wednesday, May 18, 2016 at 4:48:28 PM UTC-5, Andrew Farrell wrote:
> Hi Jacob,
> 
> You are probably looking for the book Test-Driven Development with Python
> .
> You'll also want to look at py.test 
> 
> Cheers!
> Andrew Farrell

I was under the impression that this book is primarily aimed at Python/Django 
web testing. I saw "Testing Python: Applying Unit Testing, TDD, BDD and 
Acceptance Testing" is getting good reviews too though. 

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Strange urlopen error

2016-04-12 Thread Mike Driscoll
Hi,

I have recently run into an issue at work where we are having intermittent 
problems with an internal website not loading due to an interrupted system 
call. We are using urllib2 to access the website. I can't share the exact code, 
but here is basically how we do it:

payload = {'userName': user_name,
  'emailAddress': email_address,
  'password': password}
headers = {'Accept': 'application/json',
   'Content-Type': 'application/json',
   'Authorization': token}
values = json.dumps(payload)
req = urllib2.Request(url, values, headers)

try:
 response = urllib2.urlopen(req, timeout=30)
 break
except IOError, e:
if e.errno != errno.EINTR:
print e.errno
raise

We log the errono and the raised exception. The exception is:

IOError: 

And the errno is None. I expected it to be 4.

Is there a better way to catch this error in Python 2? I am aware of PEP475, 
but we cannot upgrade to Python 3 right now.

Thanks,
Mike

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
On Wednesday, March 30, 2016 at 2:21:08 PM UTC-5, Ethan Furman wrote:
> On 03/30/2016 11:41 AM, justin walters wrote:
> 
> > That absolutely answers my questions. I'll keep an eye out for your book
> > when it is realeased. It seems like it will cover some topics that could be
> > useful in continuing my learning.
> 
> KickStarter plug:
> 
> If you want to pledge to buying the book now on KickStarter, that will 
> guarantee you the book when it comes out, plus contribute to possibly 
> have more content in the book as higher reward levels are unlocked.
> 
> Currenty his book is past the "it will definitely happen" stage, and the 
> next reward level will unsure even more content.
> 
> Note:  I'm not affiliated with the book, probably won't pledge (only a 
> couple topics apply to me), but I am a KickStarter fan (having purchased 
> more games than was probably wise ;) .
> 
> --
> ~Ethan~

You'll also get early access to the book so you'll get to see the chapters as 
soon as I'm done with them (most of the time).

Mike

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
Hi Justin,

> > https://mail.python.org/mailman/listinfo/python-list
> 
> Can you go over a couple of the topics you are going to cover?
> 
> Are you going to cover any of the most popular packages such as Django and
> scrapy?

Sure! I'm planning on covering several of the more popular intermediate-level 
modules from Python's standard library, such as collections, contextlib, 
functools and itertools.

I am also going to be covering benchmarking, encryption, connecting to 
databases, etc.

There is a section on Web-related chapters. While I don't plan to cover a web 
framework, I am going to cover other items related to working with the internet 
using Python. I do plan to talk about creating a web crawler / scraper, but I 
hadn't decided if I was going to use scrapy for that or not. I also plan to 
write about working with web APIs, such as Amazon's or Google's APIs. There 
will probably be some kind of chapter about Selenium / Web Driver too. I have 
some other ideas too.

I hope that answered your question.

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
Hi,

I just wanted to let you know that I am hard at work on my second book, which 
is entitled Python 201 which will come out this Fall 2016. I currently have a 
Kickstarter going where you can pre-order the book: 
https://www.kickstarter.com/projects/34257246/python-201-intermediate-python

I actually posted to this list last year about what you would consider to be 
intermediate topics in Python. From that discussion and from some ideas I had 
already been working, this book was born. The book is aimed for people who 
already know the basics of Python but would like to learn more. It is also 
written with Python 3 in mind. 

Let me know if you have any questions.

Thanks,
Mike Driscoll

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: Python 201 Book Kickstarter Campaign

2016-03-09 Thread Mike Driscoll
I am happy to announce my latest project, which is the sequel to my Python
101 book: Python 201 – Intermediate Python. I am launching a Kickstarter
campaign to help fund its publication so if you’re interested in
supporting, you can do so here:
https://www.kickstarter.com/projects/34257246/python-201-intermediate-python

If you already know the basics of Python and now you want to go to the next
level, then this is the book for you! This book is for *intermediate
level *Python
programmers only. There won’t be any beginner chapters here.

*Note*: This book will be covering *Python 3*

*Here are some of the topics covered:*

   - generators / iterators
   - Functional idioms (map, filter, reduce).
   - Writing your own context managers.
   - Command-line argument processing
   - collections
   - itertools
   - functools
   - Function Overloading
   - Basics of regular expressions
   - httplib / urllib (client / server)
   - web scraping
   - Basics of Unicode (encoding and codecs)
   - Timing code (benchmarking)
   - Testing (unit tests, doc tests, mock, coverage)

-
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
Book: https://gumroad.com/l/bppWr
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: What is considered an advanced topic in Python?

2015-05-29 Thread Mike Driscoll
On Friday, May 29, 2015 at 11:08:19 AM UTC-5, Joel Goldstick wrote:
 Maybe itertools or generators
 

Yeah, I was thinking along those lines. I was also thinking about some of the 
cool stuff in the collections and contextlib modules.

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is considered an advanced topic in Python?

2015-05-29 Thread Mike Driscoll
On Friday, May 29, 2015 at 11:40:11 AM UTC-5, Skip Montanaro wrote:
 On Fri, May 29, 2015 at 11:01 AM, Mike Driscoll kyos...@gmail.com wrote:
  ... I was wondering what the community considers to be intermediate or 
  advanced.
 
 Just about any topic on which Dave Beazley has given a keynote talk. :-)
 
 
 Skip

I've always enjoyed reading Beazley's blog...and his presentations are always 
neat too. Good idea. 

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


What is considered an advanced topic in Python?

2015-05-29 Thread Mike Driscoll
Hi,

I've been asked on several occasions to write about intermediate or advanced 
topics in Python and I was wondering what the community considers to be 
intermediate or advanced. I realize we're all growing in our abilities with 
the language, so this is going to be very subjective, but I am still curious 
what my fellow Python developers think about this topic.

Thanks,
Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is considered an advanced topic in Python?

2015-05-29 Thread Mike Driscoll

 
 Good fun! A few ideas:
 
 How to write decorators, particularly those that take parameters.


Yes, this one always seems to trip people up.


 
 The differences between the various number types (int, float, complex,
 Fraction, Decimal) and when you'd want each one.

I hadn't considered this one


 
 (CPython-specific) The dis.dis() function and what it can tell you
 about how Python operates

I remember seeing on PyMOTW - http://pymotw.com/2/dis/  I agree that it's a 
module most programmers don't know about.


 
 These are all topics that have come up with my students; they're
 advanced enough to be outside the scope of the course itself (the
 course _uses_ decorators, but doesn't explain how to actually build
 them), but not beyond the grasp of someone who's mastered Python's
 fundamentals.
 
 ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is considered an advanced topic in Python?

2015-05-29 Thread Mike Driscoll
Hi Steven,

On Friday, May 29, 2015 at 12:55:48 PM UTC-5, Steven D'Aprano wrote:
 On Sat, 30 May 2015 02:01 am, Mike Driscoll wrote:
 
  Hi,
  
  I've been asked on several occasions to write about intermediate or
  advanced topics in Python and I was wondering what the community considers
  to be intermediate or advanced. I realize we're all growing in our
  abilities with the language, so this is going to be very subjective, but I
  am still curious what my fellow Python developers think about this topic.
 
 
 I would consider these advanced topics:
 
 
 Metaclasses.
 Descriptors.
 Futures.
 Asynchronous processing, including multiprocessing and threads.
 Writing C or Fortran extensions.
 Function/code object internals.
 Byte-code hacking.
 Manipulating ASTs.
 OS-specific features like the os.exec* functions, os.fork, daemons, etc.
 Multiple inheritance, mixins, traits, etc.
 Coroutines.
 Dynamic programming.
 Neural nets.
 Distributed processing, including remote procedure calls.
 Fuzz testing.
 
 
 I would consider these intermediate topics:
 
 
 Closures.
 Using classes and functions as first-class values.
 Second-order functions.
 Decorators.
 Functional idioms (map, filter, reduce).
 Viewing byte-code using the dis module.
 Unicode, code pages, codecs and encodings.
 Regular expressions.
 SQL and dealing with databases.
 The complexities of floating point, including Decimal.
 Writing your own context managers.
 Generators and iterators.
 Unit testing, doctests, etc.
 Code generation and metaprogramming.
 Writing your own classes.
 State machines.
 The structure of URLs (they're more than just http://blahblah.com;).
 Anything to do with HTTP (client or server).
 Commandline argument processing (argparse, optparse, etc.)
 
 Some of the intermediate topics start at an intermediate level, but can go
 on to include more advanced uses.
 
 
 
 -- 
 Steven

That's a really good list of topics. Thanks so much for sharing your ideas.

Mike
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: The Python 101 Screencast Series

2015-04-06 Thread Mike Driscoll
I am currently running a Kickstarter campaign for turning my book, Python
101, into a screencast series. The Kickstarter can be found here:

https://www.kickstarter.com/projects/34257246/the-python-101-screencast

Thanks,
Mike


-
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
Book: https://gumroad.com/l/bppWr
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Python 101 - the book kickstarter

2014-03-05 Thread Mike Driscoll
I am writing a beginner / intermediate book for Python and would like to
announce the Kickstarter project in support of the book:

http://kck.st/1kX98BB

Thanks!
Mike
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: WxPython versus Tkinter.

2011-01-24 Thread Mike Driscoll
On Jan 24, 7:24 am, Bryan bryan.oak...@gmail.com wrote:
 On Jan 24, 12:06 am, rusi rustompm...@gmail.com wrote:

  On Jan 24, 9:16 am, Littlefield, Tyler ty...@tysdomain.com wrote:

  Of course as Steven pointed out wx is written in C++ which is almost
  certainly where the crash is occurring.
  But this is technical nitpicking.
  The real issue is that when coding in C/C++ segfaults are a daily
  affair.
  Whereas for python its the first time I am seeing it in 10 years...

 In my experience, segfaults with wxPython aren't daily, but they are
 pretty much weekly. There are weeks that can go by without them, but
 then I'll have several in a week to bump up the average.


I've only run my code on Windows and Linux, but I haven't had this
issue. The only time I've had segfaults was when I was first learning
how to get threading and wx to work properly and when I was creating
binaries with py2exe.

On a completely different note, as a heavy wxPython user for almost 5
years, I have never seen the OP on our mailing list, dev group or IRC
channel. While I like wx more than Tk, I think this thread is a
terrible way to try to show that wx is better. I like the concept of
creating a challenge to see which toolkit can do what, but this is not
the way to go about it.

Bryan, on the other hand, has been a Tkinter luminary who has helped
me in the past when I was learning Tkinter and I won't be too
surprised if he helps me again. I'm sorry he's had so much trouble
with wx though.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-24 Thread Mike Driscoll
On Jan 24, 9:02 am, rantingrick rantingr...@gmail.com wrote:
 On Jan 24, 8:49 am, Mike Driscoll kyoso...@gmail.com wrote:

  On Jan 24, 7:24 am, Bryan bryan.oak...@gmail.com wrote:
   In my experience, segfaults with wxPython aren't daily, but they are
   pretty much weekly. There are weeks that can go by without them, but
   then I'll have several in a week to bump up the average.

  I've only run my code on Windows and Linux, but I haven't had this
  issue. The only time I've had segfaults was when I was first learning
  how to get threading and wx to work properly and when I was creating
  binaries with py2exe.

 Thanks. I knew these guys were full of it.


Not necessarily. He may been using some of the generic widgets, like
the agw stuff. The agw set is awesome, but they haven't been tested
extensively on anything other than Windows because their author is a
Windows programmer.



  I like the concept of
  creating a challenge to see which toolkit can do what, but this is not
  the way to go about it.

 Well by all means offer some input. You have offered opinions but no
 ideas. I would love to hear any ideas you may have. And yes, Tkinter
 has a very likable API. I have mentioned this fact many times and in
 many threads. However when weighed on all factors wx will win. Because
 even though we may need to mold the wx API a bit, at least with wx we
 have a solid feature rich platform to work from.



I haven't gotten my ideas fleshed out yet. When I do, I will describe
them.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


The PSF Blog Gets a Transfusion!

2010-09-07 Thread Mike Driscoll
The Python Software Foundation’s Blog staff has been recently expanded
by a new set of top-notch bloggers to bring you the latest in PSF
news, ranging from the scintillating projects that the PSF has its
fingers in to the mundane, but necessary board minutes.

Don’t despair if you hate reading blogs! The blog also has a handy RSS
feed and a mailing list! You can take your pick of these delivery
methods by visiting the blog, at http://pyfound.blogspot.com/
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


The PSF Blog Gets a Transfusion!

2010-09-06 Thread Mike Driscoll
The Python Software Foundation’s Blog staff has been recently expanded
by a new set of top-notch bloggers to bring you the latest in PSF
news, ranging from the scintillating projects that the PSF has its
fingers in to the mundane, but necessary board minutes.

Don’t despair if you hate reading blogs! The blog also has a handy RSS
feed and a mailing list! You can take your pick of these delivery
methods by visiting the blog, at http://pyfound.blogspot.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: packaging multiple python scripts as Windows exe file

2010-04-13 Thread Mike Driscoll
On Apr 12, 5:20 pm, Alex Hall mehg...@gmail.com wrote:
 Hi all,
 While my project is still suffering from major import problems, I will
 soon have to try to package it as a Windows executable file. I do not
 want an installer; I want the user to be able to run the program for
 as long as they want, then to quit (by using a command from inside the
 program) and that is it. Nothing to install, no files to copy, no
 registry editing, just start and use it until done.

 I know about the popular solutions for this sort of thing, but I read
 that a DLL is required, and that this dll cannot be (legally)
 distributed by myself? A few questions here:
 1. Did I read this wrong / is this outdated? Please answer 'yes' as
 this will be a real pain to deal with.

 2. If I must have it but can distribute it, where should it go so my
 program can find it?

 3. If the user must download it for legal reasons, instead of me
 giving it to them, can I just have a Python script take care of it and
 put it in the same directory as the program, so the program can find
 it, or do I need to register the dll with the system? If I need to
 register, does this require admin login?

 Thanks as always!

 --
 Have a great day,
 Alex (msg sent from GMail website)
 mehg...@gmail.com;http://www.facebook.com/mehgcap


Without knowing the exact DLL you're thinking of, we can't be sure
what the answer is. But I think you're talking about a certain MS DLL
that Python distributes. If so, I've read multiple threads on this
topic that claim that since Python distributes it, there is an implied
permission that you can as well. Since I'm not a lawyer, I can't say
for sure, but the articles I've seen are pretty convincing.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Pyowa Meeting Next Monday

2010-01-27 Thread Mike Driscoll
Hi,

Next Monday, February 1st, we will be having our first Pyowa meeting
of 2010! It will be held at the Marshall County Sheriff's Office and
start at 7 p.m. (barring inclement weather). I will be demoing some
software I created for our Sheriff's office and will talk about the
various modules used to put it all together. We'll probably have
plenty of free time to chat and you can show off anything neat that
you've been doing too. I hope to see you there!


-
Mike Driscoll

Website: www.pyowa.org
Twitter: www.twitter.com/pyowa
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython upgrade trouble on Ubuntu 8.04

2010-01-25 Thread Mike Driscoll
On Jan 25, 5:18 am, lada...@my-deja.com lada...@my-deja.com wrote:
 Hello everyone,

 You know the old saying, in for a penny, in for a pound.

 Several hours ago I posted this...

 http://groups.google.com/group/comp.lang.python/msg/0a86e792c674adc8

 ...in which I described my desire to acquire Python 2.6 without
 upgrading my Ubuntu Linux installation from 8.04.

 Since Python 2.6 is not part of the Ubuntu 8.04 repository, I
 installed Python 2.6 manually.  Things are a little messy right now,
 since invoking IDLE from the desktop still defaults to Python 2.5.
 But I'm getting there.  At least I can access Python 2.6 from the
 command prompt, and SCIte also finds 2.6.

 Of course, I also have to reinstall all of the Python modules that I
 use on 2.6.  I have succeeded with numpy and biopython, both installed
 manually.  WxPython is giving me trouble, though.

 I visited wxpython.org and noted that wx version 2.8.10.1 fixes some
 important bugs that can occur when using Python 2.6.  The instructions
 here...

 http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

 ...allowed me to add the wxWidgets apt repository to the list of web
 sites that my Synaptic Package Manager checks for updates.  It found
 wx 2.8.10.1 and auto-installed it.  I got error messages from Python
 2.5 until I also installed python-wxtools, wx2.8-i18n, libwxgtk2.8-
 dev, and libgtk2.0-dev as recommended on the web page mentioned
 above.  Now import wx worked again, with no error messages, from
 Python 2.5.

 Installing wx on Python 2.6 is my ultimate goal, and here's where I'm
 stuck.  I actually tried import wx from Python 2.6 first, and I got
 this result:

  import wx

 Traceback (most recent call last):
   File stdin, line 1, in module
   File wx/__init__.py, line 45, in module
     from wx._core import *
   File wx/_core.py, line 4, in module
     import _core_
 ImportError: No module named _core_

 I went back to Synaptic, said that I wanted to reinstall wx 2.8.10.1
 -- but not really, as I then selected download package files only.
 I received the tarball.  The top-level folder has the wx binary stuff,
 which I believe is already installed.  I selected the wxPython
 directory at the second level.  Tried python setup.py build, and
 after several minutes and dozens of warning messages, I finally got
 this fatal error:

 In file included from /usr/include/wx-2.8/wx/glcanvas.h:54,
                  from contrib/glcanvas/gtk/glcanvas_wrap.cpp:2661:
 /usr/include/wx-2.8/wx/gtk/glcanvas.h: At global scope:
 /usr/include/wx-2.8/wx/gtk/glcanvas.h:47: error: ‘GLXContext’ does not
 name a type
 /usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: ISO C++ forbids
 declaration of ‘GLXFBConfig’ with no type
 /usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: expected ‘;’ before
 ‘*’ token
 error: command 'gcc' failed with exit status 1

 Worse -- NOW if I start Python 2.5, I get the same error message I got
 from 2.6.

 Now I'm stuck again.  Any advice?  Many thanks!

Try re-posting to the wxPython mailing list. Someone there will know
what the next step is.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: looking for Python live code reloading IDEs

2010-01-22 Thread Mike Driscoll
On Jan 22, 3:16 am, George Oliver georgeolive...@gmail.com wrote:
 hi, I'm wondering if there are any Python programming environments
 that enable live code reloading, for example something like the Scheme-
 based impromptu (but also meant for any kind of Python program, not
 just audio/visual generation).

 Currently I do this directly in my editor (for game development), but
 I'm curious if there are other options.

Maybe you could get an idea from TurboGears or Django. They seem to
reload their environments when a file is saved.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simple pub/sub

2010-01-22 Thread Mike Driscoll
On Jan 21, 10:54 am, Steve Howell showel...@yahoo.com wrote:
 Hi, I'm looking for ideas on building a simple architecture that
 allows a bunch of independent Python processes to exchange data using
 files and perform calculations.

 One Python program would be collecting data from boat instruments on a
 serial port, then writing that info out to a file, and also
 transmitting data to instruments as needed (again through the serial
 port).  It would be the most complex program in terms of having to
 poll file descriptors, or something similar, but I want to limit its
 job to pure communication handling.

 Then, I would have a bunch of programs doing various calculations on
 the input stream.  It's totally acceptable if they just sleep a bit,
 wake up, see if there is any new data, and if so, do some
 calculations, so I will probably just use this:

 http://www.dabeaz.com/generators/follow.py

 Some of the calculator programs might be looking for trends in the
 data, and when a certain threshold is reached, they will need to
 notify the comm program of the new message.  To avoid collisions
 between all the different calculator programs, I am thinking the
 simplest thing is just have them each write to their own output file.

 So then the comm program has multiple data sources.  It wants to track
 to the serial port, but it also wants to monitor the output files from
 the various calculator processes.  I want to do this in a mostly
 nonblocking way, so I would probably poll on the file descriptors.

 The only problems are that select ...cannot be used on regular files
 to determine whether a file has grown since it was last read, and it
 only works on Unix for files.  (I'm using Unix myself, but one of the
 other programmers insists on Windows, and is resisting Python as
 well.)

 So a variation would be that the calculator programs talk to the comm
 program via sockets, which seems slightly on the heavy side, but it is
 certainly feasible.

 I know that something like twisted could probably solve my problem,
 but I'm also wondering if there is some solution that is a little more
 lightweight and batteries-included.

 At the heart of the matter, I just want the programs to be able to do
 the following tasks.

   1) All programs will occasionally need to write a line of text to
 some data stream without having to lock it.  (I don't care if the
 write blocks.)
   2) All programs will need to be able to do a non-blocking read of a
 line of text from a data stream.  (And there may be multiple
 consumers.)
   3) The comm program will need to be able to poll the serial port and
 input data streams to see which ones are ready.

 Any thoughts?

Did you look at the pubsub module at all? See http://pubsub.sourceforge.net/
for more information.

I use it a lot in my wxPython programs.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python gui ide under linux..like visual studio ;) ?

2010-01-18 Thread Mike Driscoll
On Jan 18, 8:32 am, ted t...@sjksdjk.it wrote:
 Hi at all...
 Can someone please give me some advice, about a good IDE with control
 GUI under Linux ?

 Actually i know QT Creator by Nokia which i can use with Python (but i
 don't know how).

 And, a good library for access to database (mysql, sql server, oracle) ?

 Thank you very much !

 bye

Check out Dabo for the database stuff: http://dabodev.com/

There is nothing like Visual Studio. The closest I've found are things
like the QT Creator and wxGlade / Boa Constructor / wxFormBuilder. I
know I've heard of another one that was commercial, but I can't recall
the name at the moment.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Simple distributed example for learning purposes?

2010-01-14 Thread Mike Driscoll
On Dec 26 2009, 2:06 pm, Tim Golden m...@timgolden.me.uk wrote:
 I'm trying to work up a programming course using Python,
 aimed at secondary school students [*] here in London. One
 of my aims is to have a series of compact but functional
 examples, each demonstrating a particular field in which
 Python (and programming) can be useful.

 I'm trying to come up with something which will illustrate
 the usefulness of a distributed processing model. Since I
 may not be using the term distributed exactly, my
 criteria are:

 * It should be clear that the application produces results
 sooner when run via multiple cooperating computers
 than when run on one.

 * The problem being solved should be broadly comprehensible by
 the students. This rules out some abstruse mathematical
 calculation which would benefit from multiple processors but
 which will fail to engage their interest.

 * I don't mind using / installing some library as a black box
 so long as the other criteria are met. This is at least partly
 because I want the code to be compact and I'm quite happy to
 point to a library call and say this does the hard work.

 I'm not asking anyone to write code: what I'm after is some sort
 of problem space which will meet my criteria. Part of the issue
 is that computers are just so fast these days that almost anything
 I can come up with can be managed so quickly on one laptop that
 the overhead of distribution (or of the IO) will dwarf the benefits
 of distributing.

 The kind of things I've considered briefly include: speech recognition;
 image analysis; large scale indexing (effectively: building a search
 engine). At present I'm looking at that last one, not least because I
 have little knowledge of the other domains so there's a overhead for
 me in setting the example up.

 Any suggestions, either from your own experience of something similar,
 or from sheer inspiration, will be gratefully received.

 Thanks

 TJG

 [*] roughly, ages 14-18

I think distributed transcoding of hi-def videos would be cool, but I
haven't found much with Google. Still, you might find this useful for
your project:

http://pypi.python.org/pypi/AsynCluster/0.3

For reasons I don't understand, the home page listed in that link is
blocked here.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help getting profile information programmatically

2009-12-31 Thread Mike Driscoll
On Dec 31, 12:32 pm, sawilla sawi...@gmail.com wrote:
 I need to get the cumulative process time for a function that returns
 arguments and I'm having trouble doing so programmatically. After I
 get the process time, I want to log it to a file, along with other
 information. My problem is that I can't figure out how to do this
 programmatically in a good way. I see that the cProfile module has the
 method getstats which returns a list with the information I need but
 I don't see how I can access it.

 Here is some pseudocode showing what I'm hoping to do:

 # Get a cProfile object with the profile information of my function.
 # This syntax doesn't work and this is the first part I need help
 with.
 p = cProfile.run('(a,b,c)=myFunc(x,y,z)')

 # Get the process time. The timeit.clock() function would give me
 process time
 # but it doesn't allow me to access the return arguments afterward so
 I can't use it.
 # The syntax of the next line doesn't work but this is an example of
 what I hope to do.
 top_entry = p.getstats()[0]
 cum_time = top_entry[3]  # totaltime

 # Now, log all this info to a CSV file. (No help needed here.)
 csv_file.writerow([a,b,c,x,y,z,cum_time])

 Once this works, I will wrap the above code in a loop which iterates
 through thousands of combinations of the parameters x,y,z.

 Thanks in advance for your help.

 Reg

I think what you need to look at is the documentation for the various
Python profilers:

http://docs.python.org/library/profile.html

From what I can see, it looks like cProfile can log to a file and you
use the pstats module to review the data generated. That link also
links to the hotshot profiler, which looks like it's even simpler to
use.

You might also want to check out the logging module.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: whoops: create a splash window in python

2009-12-31 Thread Mike Driscoll
On Dec 30, 11:31 pm, Ron Croonenberg r...@depauw.edu wrote:
 sorry about posting with the wrong subject...

 *
 hello,

 is there a way, in python, to create a splash window and when the
 program has completed disappears by sending a msg to it? (I tried
 creating two gtk windows but gtk_main doesn't seem to return unless it
 gets closed.)

 tia

 Ron
 *

wxPython has a splash page widget for this sort of thing. Of course,
if all you want to do is display a message to the user for a short
time, any GUI library will allow you to create a window of some sort
that you can use for that purpose. Note that GUI's tend to run in a
loop that may block your calling program, so you may need to mess with
threads, in which case each GUI has their own thread-safe methods.

It's less complicated then it sounds. I tend to use wxPython the most,
so if you have specific questions about that, let me know. Good luck!

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with win32ui

2009-12-22 Thread Mike Driscoll
On Dec 22, 11:05 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
 En Tue, 22 Dec 2009 12:31:37 -0300, Marc Grondin marcg...@gmail.com  
 escribió:

  Hello everyone,
  So i have been building an app with python(and learning as i go along) my
  knowledge of python is still kinda limited but the app work on my pc. I  
  have
  also compiled it to an exe using py2exe and it also works fine this way  
  on
  my pc(where python is installed) if however i try to run it from a pc  
  where
  python is not installed i get this message:

  Traceback (most recent call last):
    File printorders.py, line 2, in module
    File win32ui.pyc, line 12, in module
    File win32ui.pyc, line 10, in __load
  ImportError: DLL load failed: The specified module could not be found.

 There is a missing DLL. Dependency Walker is a useful tool to solve this  
 kind of 
 problems:http://technet.microsoft.com/en-us/library/cc738370(WS.10).aspx
 Once you know which DLL is missing, add it to your setup.py

 --
 Gabriel Genellina


Also make sure that you can legally distribute the dll.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21  http://us.pycon.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Connecting to the users preferred email client

2009-12-04 Thread Mike Driscoll
On Dec 4, 5:28 am, Tuomas Vesterinen tuomas.vesteri...@iki.fi wrote:
 If I want to open a html-page from Python code I can say:

   import webbrowser
   webbrowser.open('index.html')

 Is there a standard way to init an email in users preferred email client
 like Thubderbird, Evolution etc.?

 Tuomas Vesterinen

Check this thread out:

http://www.megasolutions.net/python/invoke-users-standard-mail-client-64348.aspx

Basically, the idea is to pass the mailto url to webbrowser.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess kill

2009-12-04 Thread Mike Driscoll
On Dec 4, 3:50 pm, luca72 lucabe...@libero.it wrote:
 Hello i'm using subprocess in this way:
 self.luca = subprocess.Popen(['/usr/bin/
 dvbtune'+frase_sint],shell=True, stdout=self.f_s_l,stderr=self.f_s_e )

 then i kill:
 self.luca.Kill()

 but the process is still active and the file self.f_s_l increase it
 size because the process is not killed.

 How i can kill the process?
 Regards

 Luca

See http://lmgtfy.com/?q=python+kill+subprocess+linux

When I do that on my machine, the 2nd result has the answer:

http://stackoverflow.com/questions/1064335/in-python-2-5-how-do-i-kill-a-subprocess

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: confusing thread behavior

2009-12-03 Thread Mike Driscoll
On Dec 3, 3:42 pm, paul phart...@gmail.com wrote:
 I have been experiencing strange thread behavior when I pass a message
 received via a Queue to a wx.PostEvent method (from wxPython). The
 relevant code in the thread is:

 def run(self):
     while self.is_running:
         task = self.queue.get()
         wx.PostEvent(self.app.handle_task, task)

 self.queue is a Queue.Queue instance and self.app is a wx.Window
 instance

 I have a case where two items are placed in the queue one after the
 other, and it appears that only the first item is passed to
 wx.PostEvent.  If I place a time.sleep(0.1) call anywhere within the
 while loop, both items get passed to wx.PostEvent.  It works if I put
 time.sleep before the self.queue.get(), in between get() and PostEvent
 () or after PostEvent().  So it seems like a short delay is enough to
 get two items handled, although it doesn't seem to matter where I
 place the delay within the while loop.  Does someone know what might
 explain this behavior?  Thanks.

[Note: I cross-posted this to wxPython where Paul had also cross-
posted]

Not sure if this will help or not, but see the following article on
the wxPython wiki:

http://wiki.wxpython.org/LongRunningTasks

There's a section called More Tips where Queues are discussed. Robin
Dunn (creator of wxPython) seems to recommend using wx.CallAfter there
rather than PostEvent.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help in wxpython

2009-12-03 Thread Mike Driscoll
On Dec 2, 10:05 pm, Krishnakant hackin...@gmail.com wrote:
 On Wed, 2009-12-02 at 00:20 -0800, madhura vadvalkar wrote:
  Hi

  I am trying to write an  PAINT like application where on the mouse
  click a circle is drawn on canvas. I am new to python and using
  wxpython to create this.

  here is the code:

  import wx

  class SketchWindow(wx.Window):

      def __init__ (self, parent,ID):

          wx.Window.__init__(self, parent, ID)

          self.panel =wx.Panel(self, size= (350,350))
          self.pen=wx.Pen( 'blue',4)
          self.pos=(0,0)
          self.InitBuffer()
          self.Bind(wx.EVT_LEFT_DOWN,self.OnLeftDown)

      def InitBuffer(self):

          size=self.GetClientSize()
          self.Buffer=wx.EmptyBitmap(size.width,size.height)
          dc=wx.BufferedDC(None,self.buffer)
          dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
          dc.Clear()
          self.Drawcircle(dc)
          self.reInitBuffer=False

      def OnLeftDown(self,event):
          self.pos=event.GetPositionTuple()
          self.CaptureMouse()

      def Drawcircle(self,dc):
          pen=wx.Pen(colour,thickness,wx.SOLID)
          dc.SetPen(pen)
          dc.DrawCircle(self.pos.x,self.pos.y,r)

  class SketchFrame(wx.Frame):
      def __init__(self, parent):

          wx.Frame.__init__(self, parent, -1, Sketch Frame,size=(800,600))
          self.sketch = SketchWindow(self, -1)

  if __name__=='__main__':
      app=wx.PySimpleApp()
      frame=SketchFrame(None)
      frame.Show(True)
      app.MainLoop()

  I am getting the following error:

  Traceback (most recent call last):
    File C:/Python26/circle.py, line 42, in module
      frame=SketchFrame(None)
    File C:/Python26/circle.py, line 38, in __init__
      self.sketch = SketchWindow(self, -1)
    File C:/Python26/circle.py, line 12, in __init__
      self.InitBuffer()
    File C:/Python26/circle.py, line 19, in InitBuffer
      dc=wx.BufferedDC(None,self.buffer)
  AttributeError: 'SketchWindow' object has no attribute 'buffer'

  Please tell me what I am doing wrong.

  Thanks

 Madhura, Sorry to be a bit off-topic, but, I would really recommend you
 to use pygtk instead of wx.
 For one thing, the developers at pygtk are very active (they have their
 mailing list as well ) and it comes by default with python on almost all
 linux distros.  You can also easily install it on windows.


wxPython has some very active developers as well, but the core isn't
released all that often. I think this may be caused somewhat by the
slow release cycle of wx itself though.



 Most important, the api for pygtk is closely similar to wx.
 Not to mention the quick responses you will get with pygtk related
 problems.


The wxPython mailing list has very fast responses to questions as well
(most of the time)

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help in wxpython

2009-12-03 Thread Mike Driscoll
On Dec 3, 3:22 pm, Nobody nob...@nowhere.com wrote:
 On Thu, 03 Dec 2009 07:55:19 +, r0g wrote:
  I have to recommend to opposite, stick with wx. What's the point of
  tying yourself into GTK when wx works on Mac, PC and Linux?

 The main drawbacks are that wxWidgets sucks compared to GTK or Qt (mostly
 due to being modelled on the Win32 API, which itself sucks compared to
 most Unix/X11 toolkits), and that wxPython is woefully under-documented
 (whereas PyGTK is better documented than GTK itself).

 But if you need portability, wxPython is the way to go.

There is currently an on-going documentation initiative going on for
wxPython. Robin Dunn is doing some work on it that will allow much
easier documentation patching (as I understand it), so that should get
better.

Also, I am slowly working my way through wxPython many widgets and
doing tutorials on them on my blog, which I then stick in the official
wxPython wiki if I think the article is good enough.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Freezing python files into executables

2009-11-03 Thread Mike Driscoll
On Nov 3, 3:23 pm, Girish Venkatasubramanian giris...@gmail.com
wrote:
 Will try that.

 Meanwhile I went ahead and used cx_freeze and that seems to work OK.

 Thanks for your help Rami and Marc-Andre.


Something that you might want to try in the future is GUI2Exe, which
allows you to play with a whole slew of freezing modules:

http://code.google.com/p/gui2exe/

I've been using it to make executables on Windows through it's py2exe
implementation.

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


AES decrypting in Python

2009-10-07 Thread Mike Driscoll
Hi,

I am working on a project where I need to decrypt some data that has
been encrypted with AES. It looks like M2Crypto is the module of
choice for these sorts of things, but I cannot figure out how to do
this stuff from the docs. I have the following PHP code that needs to
be translated into Python:

$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key,
$data,MCRYPT_MODE_ECB, $iv),\0);

I can't find a method in M2Crypto that gets the initialization
vector size. I found the right method in the tests, which appears to
be EVP.Cipher. So I would assume, I would need to do something like:

EVP.Cipher(alg=aes_256_ecb, key=SomeKey, iv=SomeIV, op=dec,
padding=False)

I don't really see where I pass the data that needs the decrypting
though. Can someone shed some light on this?

Thanks,

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: AES decrypting in Python

2009-10-07 Thread Mike Driscoll
On Oct 7, 10:04 am, M.-A. Lemburg m...@egenix.com wrote:
 Mike Driscoll wrote:
  Hi,

  I am working on a project where I need to decrypt some data that has
  been encrypted with AES. It looks like M2Crypto is the module of
  choice for these sorts of things, but I cannot figure out how to do
  this stuff from the docs. I have the following PHP code that needs to
  be translated into Python:

  $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
  $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
  return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key,
  $data,MCRYPT_MODE_ECB, $iv),\0);

  I can't find a method in M2Crypto that gets the initialization
  vector size. I found the right method in the tests, which appears to
  be EVP.Cipher. So I would assume, I would need to do something like:

  EVP.Cipher(alg=aes_256_ecb, key=SomeKey, iv=SomeIV, op=dec,
  padding=False)

  I don't really see where I pass the data that needs the decrypting
  though. Can someone shed some light on this?

 If you just need AES, you're probably better of with pycrypto:

 http://www.amk.ca/python/code/crypto

 Still, to answer your question: AES uses blocks of 16 bytes (256 bits)
 each, so the IV-size is always 16 bytes.

 BTW: I'm not sure what the PHP code is trying to do ... ECB mode
 doesn't use the IV at all. It's only used for chained modes and
 there you include the IV in the encrypted data (usually at the
 beginning), since you need it for decryption. The PHP code
 apparently generates a random IV block for decryption. This
 would never work in e.g. CBC mode.

 --
 Marc-Andre Lemburg
 eGenix.com


That's good to know. I had originally started with PyCrypto by
following the example here: 
http://www.codekoala.com/blog/2009/aes-encryption-python-using-pycrypto/

Unfortunately, no matter which base64 decoding method I use, I get a
padding error or in the case of b16decode, I get TypeError: Non-
base16 digit found. AES decoding is something I've never done before,
so I apologize for my greenness.

I'll bug the guys on the pycrypto list as well.

Thanks,

Mike

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess woes

2009-09-15 Thread Mike Driscoll
On Sep 15, 2:26 pm, kj no.em...@please.post wrote:
 I'm trying to write a function, sort_data, that takes as argument
 the path to a file, and sorts it in place, leaving the last sentinel
 line in its original position (i.e. at the end).  Here's what I
 have (omitting most error-checking code):

 def sort_data(path, sentinel='.\n'):
     tmp_fd, tmp = tempfile.mkstemp()
     out = os.fdopen(tmp_fd, 'wb')
     cmd = ['/usr/local/bin/sort', '-t', '\t', '-k1,1', '-k2,2']
     p = Popen(cmd, stdin=PIPE, stdout=out)
     in_ = file(path, 'r')
     while True:
         line = in_.next()
         if line != sentinel:
             p.stdin.write(line)
         else:
             break
     in_.close()
     p.stdin.close()
     retcode = p.wait()
     if retcode != 0:
         raise CalledProcessError(retcode, cmd)
     out.write(sentinel)
     out.close()
     shutil.move(tmp, path)

 This works OK, except that it does not catch the stderr from the
 called sort process.  The problem is how to do this.  I want to to
 avoid having to create a new file just to capture this stderr
 output.  I would like instead to capture it to an in-memory buffer.
 Therefore I tried using a StringIO object as the stderr parameter
 to Popen, but this resulted in the error StringIO instance has no
 attribute 'fileno'.

 How can I capture stderr in the scenario depicted above?

 TIA!

 kynn

According to the docs for subprocess module (which you don't appear to
be using even though that's what you used for your subject line), you
can set stderr to stdout:

http://docs.python.org/library/subprocess.html

You can use cStringIO to create a file-like object in memory:

http://docs.python.org/library/stringio.html

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDE for Python

2009-08-31 Thread Mike Driscoll
On Aug 29, 1:08 pm, ivanko@gmail.com wrote:
 29.08.2009 4:14 пользователь Thangappan.M thangappan...@gmail.com  
 написал:

  Dear all,
  Please suggest some good IDE for python.I am working in linux platform.
  --
  Regards,
  Thangappan.M

 You can use Eclipse + PyDev or Emacs+PythonMode . Also there are Anjuta and  
 Code:Blocks, but they are designed mainly for C++ (but still can be used).

Don't forget Wingware IDE. Admittedly, it's not free (except for a
limited version), but it's pretty good. There's also SPE (Stani's
Python Editor). If you want a nigh-complete list, check the Python
wiki:

http://wiki.python.org/moin/PythonEditors

---
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: win32ui DLL Load Failed

2009-08-31 Thread Mike Driscoll
On Aug 31, 2:43 pm, MikeC mcrav...@att.net wrote:
 I have a python executable that's failing to load on a user's machine
 running Windows XP. My developer machine is also running Windows XP. I
 have determined that it is failing when it attempts to load win32ui.

 I have Python 2.6 on my developer machine and am using the pywin
 support (Mark Hammonds???) for Python 2.6.

 In order to make the problem smaller and more managable I created an
 executable (with pytoexe) of a 1 one-line python script which does the
 following:

 import win32ui

 Running the one-line script on my machine from python source as well
 as from the executable created from the one-line source works fine on
 my machine. But when I attempt to run the executable on a target
 Windows/XP user machine (without Python) it fails with the following
 traceback

 Traceback (most recent call last):
   File CheckScan.py, line 7, in module
   File PrintImage.pyc, line 1, in module
   File win32ui.pyc, line 12, in module
   File win32ui.pyc, line 10, in __load
 ImportError: DLL load failed: This application has failed to start
 because the application configuration is incorrect. Reinstalling the
 application may fix this problem.

 The only thing I can think of regarding the difference between my
 machine and the target machine is that I have the .NET framework on my
 machine. Is it possible that that is the problem? Running Depends
 didn't get me anywhere. I would appreciate any help you can offer.

Did you install PyWin32? If so, which version? Here's a link:

http://sourceforge.net/projects/pywin32/

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Pyowa Meeting Tomorrow (8/6)

2009-08-06 Thread Mike Driscoll
Pyowa Meeting - Thursday, Aug. 8th, 2009

Time: 6:30 - 8:45 p.m.
Location: Ames Public Library, Founders Suite, Ames, IA

Itinerary:

- Presentation on Building Executables and Installers with GUI2Exe and Inno
Setup
- Possible group programming exercise
- Social Time

We hope to see you there!


Mike Driscoll

www.pyowa.org
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Bug in IEHtmlWindow?

2009-07-30 Thread Mike Driscoll
On Jul 30, 2:54 am, Massi massi_...@msn.com wrote:
 Hi everyone, I'm trying to use IEHtmlWindow in my application (python
 2.5, wxpython 2.8 on win xp). Everything is ok, but I encountered a
 problem which also affects the demo. If I make a research on google a
 strange message appears, saying (I'll try to translate from italian):

 Error during execution.
 Do you want to run the debug?

 line 29:
 error: 'r' is NULL or it is not an object

 Did anybody have the same problem? is it a bug?
 Thanks in advance for your help.

I've never seen that error. Could you re-post to the wxPython user's
list? They can probably help you there: http://groups.google.com/group/wxPython

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Pyowa is this Monday!

2009-07-05 Thread Mike Driscoll
Hi,

The next Pyowa meeting is on Monday, July 6th from 7-9 p.m. We will be at
the Marshall County Sheriff's Office (directions on website). Currently, the
plan is to have a talk about Python at Fisher/Emerson that will segue into a
general discussion of what we do with our favorite programming language. Be
prepared to share!

We may have another presentation in our Standard Library series as well. Let
me know if you think you'll be there. Pop  water will be provided. We hope
to see you there!

--
Mike Driscoll

http://www.pyowa.org
http://pyowa.blip.tv/
http://twitter.com/pyowa
http://upcoming.yahoo.com/event/2853430/
Mailing list:
http://pyowalist.pythonlibrary.org/listinfo.cgi/pyowa-pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Pyowa is this Monday!

2009-07-04 Thread Mike Driscoll
Hi,

The next Pyowa meeting is on Monday, July 6th from 7-9 p.m. We will be
at the Marshall County Sheriff's Office (directions on website).
Currently, the plan is to have a talk about Python at Fisher/Emerson
that will segue into a general discussion of what we do with our
favorite programming language. Be prepared to share!

We may have another presentation in our Standard Library series as
well or just something random. Let me know if you think you'll be
there. Pop  water will be provided. We hope to see you there!

--
Mike Driscoll

http://www.pyowa.org
http://pyowa.blip.tv/
http://twitter.com/pyowa
http://upcoming.yahoo.com/event/2853430/
Mailing list: 
http://pyowalist.pythonlibrary.org/listinfo.cgi/pyowa-pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tutorial on working with Excel files in Python (without COM and cross platform!) at EuroPython 2009

2009-06-18 Thread Mike Driscoll
On Jun 18, 10:38 am, Chris Withers ch...@simplistix.co.uk wrote:
 Hi All,

 Too many people in the Python community *still* think the only way to
 work with Excel files in Python is using COM on Windows.

 To try and correct this, I'm giving a tutorial at this year's EuroPython
 conference in Birmingham, UK on Monday, 29th June that will cover
 working with Excel files in Python using the pure-python libraries xlrd,
 xlwt and xlutils.

 I'll be looking to cover:

 - Reading Excel Files

    Including extracting all the data types, formatting and working with
    large files.

 - Writing Excel Files

    Including formatting, many of the useful frilly extras and writing
    large excel files.

 - Modifying and Filtering Excel Files

    A run through of taking existing Excel files and modifying them in
    various ways.

 - Workshop for your problems

    I'm hoping anyone who attends will get a lot out of this! If you're
    planning on attending and have a particular problem you'd like to work
    on in this part of the tutorial, please drop me an email and I'll try
    and make sure I come prepared!

 All you need for the tutorial is a working knowledge of Excel and
 Python, with a laptop as an added benefit, and to be at EuroPython this
 year:

 http://www.europython.eu/

 I look forward to seeing you all there!

 Chris

 --
 Simplistix - Content Management, Zope  Python Consulting
             -http://www.simplistix.co.uk


As I recall, these utilities don't allow the programmer to access
Excel's formulas. Is that still an issue?

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Mike Driscoll
On Jun 18, 8:35 am, Hans Müller heint...@web.de wrote:
 Here we have to select between wxPython and PyQt for a medium size project.
 In this project several hundred dialogs are to be created. This work will be 
 done by a
 program generator which has to re-written.

 The question now is which framework should we use.
 As far as I could found is PyQt with the Qt Framework the superior choice.
 Most articles I found (not all) results to PyQt.
 But Qt is expensive ~ 3400€ per Developer and OS.
 Since these articles are more or less old, it would be nice to hear your 
 current opinions.

 Condensed, I found this pros / cons:

 Pros for Qt:
         - best framwork, well designed


Best in who's opinion?

         - nice GUI builders
         - faster execution

How was the execution speed measured?


 Cons:
         - epensive

The others have answered this...


 Pros for wxPython:
         - cheap
         - big community
 Cons:
         - more layers on top of OS
         - more bugs (still valid ?)
         - slower


Again, how was the slowness measured?


 Can someone tell me about his experiences with one or both frameworks ?

 Thanks a lot,

 Greetings
 Hans


I've been using wxPython for almost three years. I can attest to there
being a good solid community behind wx that is very friendly. The
wxPython framework is built on top of C++ wxWidgets code, but as far
as I know, pyQT is built on top of the QT framework. So I'm not sure
where this idea of more layers for wx comes from.

I haven't messed with QT to know if it is faster or not. Hopefully
someone else can weigh in on that. I also don't know which has more
bugs. For what I've done though, I've never had a bug to deal with.
I've created a fairly involved timesheet for my company that's a
little unwieldy at the moment. I also have quite a few smaller
applications in wxPython. I like it quite a bit. All the widgets I've
ever needed are already implemented and when they aren't there, it
always seems that one of the other developers releases one.

I would recommend trying to create something small in each toolkit
(like a minimal calculator) and see which one makes the most sense to
you.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
On Jun 16, 9:20 am, Filipe Teixeira shuan...@gmail.com wrote:
 Hi, I'm really struggling to find the best GUI to make a simple
 application.

 I'm doing a program to load all the ini files in the current folder,
 or the folder that the user chooses and list the specifics entries in
 it.

 So, the program would be like this:

 Som tabs here like:
 ( Load | Edit | Options)

 In the [ Load ] tab:
 A folder tree in the left, and two labels or edit boxes showing some
 specific entries in the ini file.

 In the [ Edit ] tab:
 really straight-forward, Edit boxes of the entries so the user can
 edit

 in the [ options ] tab:
 More edits to specifie the default folder, etc.

 Basically I will use a lot of edit boxes and some tabs, and a folder
 tree, any tips so I can search in the right place?

wxPython has all the widgets you've described built into it. They also
have a very helpful mailing list. However, you should try the various
toolkits and see which one makes the most sense to you.

When I was first looking at GUIs, I tried Tkinter first. But it just
couldn't replicate the stupid UIs I needed to reimplement, so I went
with wxPython. I've heard good things about pyQT. If you want the
ultimate look-and-feel for Windows, you should go with IronPython.

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
On Jun 16, 1:24 pm, Tim Harig user...@ilthio.net wrote:
 On 2009-06-16, Mike Driscoll kyoso...@gmail.com wrote:

  On Jun 16, 9:20 am, Filipe Teixeira shuan...@gmail.com wrote:
  Hi, I'm really struggling to find the best GUI to make a simple
  application.
 [SNIP]
  Basically I will use a lot of edit boxes and some tabs, and a folder
  tree, any tips so I can search in the right place?
  When I was first looking at GUIs, I tried Tkinter first. But it just
  ultimate look-and-feel for Windows, you should go with IronPython.

 IronPython is not a GUI toolkit per se.  It is a python implementation
 build on top of .Net like Jython is built on top of Java.  I therefore has
 access to the MFCs which can be used to create native Windows GUIs.  This
 can also be done from Cpython using the pywin extensions.

That is true...I was just referring to IronPython's ability to hook a
GUI created using Visual Studio easily. Going about it through pywin
and ctypes is probably above the OP's current needs...although I think
Greg Ewing's pyGUI wraps that stuff. I suppose the OP might find that
useful:

http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Pyowa Meeting this Thursday

2009-06-03 Thread Mike Driscoll
 Hi,

Pyowa will be meeting Thursday, June 4th in Ames. We will be meeting
at the Ames
Public Library from 7 to 8:45 p.m. The current plan for the meeting is to
have a code review of sorts on some member submitted GIS-type code. Then we
will have a short presentation on one of the modules from Python's standard
library. Whatever time is left over will be used for socializing and
planning the next meeting. If you have ideas or would like to present
something, please let me know at the meeting or through email.

In other news, you can see my experiments in recording some of our meetings
here: http://pyowa.blip.tv/

Please note that if you don't have a fast internet connection, then you will
be disappointed as it will take eons to buffer. Let me know if you plan to
come to the meeting. Thanks!

Mike Driscoll
Pyowa Coordinator
Website: www.pyowa.org http://www.pyowa.org/
Upcoming: http://upcoming.yahoo.com/event/2677147/
Twitter: http://twitter.com/pyowa
Mailing List:
http://pyowalist.pythonlibrary.org/listinfo.cgi/pyowa-pythonlibrary.org
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: AOPython Question

2009-05-28 Thread Mike Driscoll
On May 28, 1:43 pm, Roastie roasti...@gmail.com wrote:
 I installed the AOPython module:

    % easy_install aopython

 That left an aopython-1.0.3-py2.6.egg at
 C:\mystuff\python\python_2.6.2\Lib\site-packages.

 I entered the interpreter:

  import aopython

 All is well.

 But I was uncomfortable, since I was used to seeing directories
 of Python code for modules in site-packages, so I decided
 to read about 
 eggs:http://mrtopf.de/blog/python_zope/a-small-introduction-to-python-eggs/

 The article told me to run:
     % easy_install aopython-1.0.3-py2.6.egg
 The result was a long list of error messages and removal
 of my egg, and Python could no longer use the AOPython module.

 So, I'm looking for a better reference for telling me about eggs and
 modules in site-packages.

 Roastie
 roasti...@gmail.com

The first way to do it is usually the preferred method. When you do

easy_install somePackage

the easy_install script will try to find the package on PyPI and
download the latest version. If you do the latter, you are telling
easy_install to look for that specific version. If you mis-spell the
version slightly, then you will probably have issues. I am guessing
that is why you received those error messages.

See the easy install official docs:

http://peak.telecommunity.com/DevCenter/EasyInstall

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: AOPython Question

2009-05-28 Thread Mike Driscoll
On May 28, 3:10 pm, Mike Driscoll kyoso...@gmail.com wrote:
 On May 28, 1:43 pm, Roastie roasti...@gmail.com wrote:



  I installed the AOPython module:

     % easy_install aopython

  That left an aopython-1.0.3-py2.6.egg at
  C:\mystuff\python\python_2.6.2\Lib\site-packages.

  I entered the interpreter:

   import aopython

  All is well.

  But I was uncomfortable, since I was used to seeing directories
  of Python code for modules in site-packages, so I decided
  to read about 
  eggs:http://mrtopf.de/blog/python_zope/a-small-introduction-to-python-eggs/

  The article told me to run:
      % easy_install aopython-1.0.3-py2.6.egg
  The result was a long list of error messages and removal
  of my egg, and Python could no longer use the AOPython module.

  So, I'm looking for a better reference for telling me about eggs and
  modules in site-packages.

  Roastie
  roasti...@gmail.com

 The first way to do it is usually the preferred method. When you do

 easy_install somePackage

 the easy_install script will try to find the package on PyPI and
 download the latest version. If you do the latter, you are telling
 easy_install to look for that specific version. If you mis-spell the
 version slightly, then you will probably have issues. I am guessing
 that is why you received those error messages.

 See the easy install official docs:

 http://peak.telecommunity.com/DevCenter/EasyInstall

 - Mike

I forgot to mention, but I've found that using a virtualenv for
testing new modules is very helpful and you don't end up with lots of
junk entries in your system path. Check it out too: 
http://pypi.python.org/pypi/virtualenv

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: which database is suitable for small applications

2009-05-26 Thread Mike Driscoll
On May 26, 8:16 am, J Kenneth King ja...@agentultra.com wrote:
 Jean-Michel Pichavant jeanmic...@sequans.com writes:
  Kalyan Chakravarthy wrote:
  Hi All,
            can any one suggest me which database I can use for my
  small application(to store user names ,passwords, very few other
  data.. )
  I am using Python, Google Apps and guide me how to connect to
  database, I am very new to these technologies

  Please help me

  Thanks in advance

  --
  Regards
  Kalyan

  If you are really new to these technologies and don't want to spend
  some time on it, just serialize on the disk your data structure
  containing your names, password and so on
  (http://docs.python.org/library/pickle.html).
  Depending on your application you may not be that concerned with
  security/reliability issues.

  Of course if you want to learn more about it, go on. I personally use
  postgreSQL with the pgdb python module. But this is the only one I
  ever used so I'll let someone else more familiar with all the database
  types respond to you.

  Jean-Michel

 sqlite is also a pretty lite database. Sits in a single file and the
 libraries ship with Python ( 2.6 I think? or maybe 2.5?).


Sqlite starting shipping with Python 2.5.

I use SqlAlchemy to connect to Microsoft SQL 2000 right now, but I
used to use the mssql and adodb modules. The latter two worked for
what I needed, although I was always running to escaping issues with
them. SqlAlchemy is nice because it does all that for you and you can
switch database back-ends with little to no change in your code.

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Advanced Python books?

2009-05-19 Thread Mike Driscoll
On May 18, 3:04 pm, kj so...@987jk.com.invalid wrote:
 I have read a couple of learn Python-type books, and now I'm
 looking for some more advanced books on Python, something analogous
 to Effective Java or High-Order Perl.  I've only been able to
 find Advanced Python 3 Programming Techniques, which, as far as
 I can tell, is only available as a Kindle Book.  (Since I won't
 be buying a Kindle for another few decades, this is not an option
 for me.)

 I tried out Dive into Python, because I was told that it was
 written for people with prior programming experience.  It's an OK
 book, but I don't find that it is much more advanced than pretty
 much any other learn Python book I've seen.

 Basically I'm looking for a book that assumes that one has the
 basics of the language down, and instead focuses on standard problems
 of software development, such as application architecture and
 design, prototyping, debugging, profiling and performance-tuning,
 testing, packaging/distribution, extending/embedding, threading
 and IPC, persistence, etc., and on various prototypical cases such
 as command-line utilities, GUI-apps, webapps, database-backed apps,
 simulations, etc.

 Granted, it is unlikely that a single book will do justice to all
 these areas, but these are the topics I'm now interested in, from
 the perspective of Python.

 Any suggestions?

 TIA!
 --
 NOTE: In my address everything before the first period is backwards;
 and the last period, and everything after it, should be discarded.

Hetland's book, Beginning Python has a bunch of projects at the end.
It also has a chapter on testing, network programming, extending
python, packaging and more. They're not in depth, but they give you a
taste.

Lutz's Programming Python has some pretty in depth projects using
Tkinter. You might find the Python Cookbook helpful or you could just
look at ActiveState's cookbook which is what the book was based on:
http://code.activestate.com/recipes/langs/python/

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python

2009-05-15 Thread Mike Driscoll
On May 15, 8:58 am, anica_1...@hotmail.com wrote:
 hello, I´m a student of linguistic an I need do this exercises. Can
 anybody help me,please?
 Thanks

 ◑ Read in some text from a corpus, tokenize it, and print the list of
 all wh-word types that occur. (wh-words in English are used in
 questions, relative clauses and exclamations: who, which, what, and so
 on.) Print them in order. Are any words duplicated in this list,
 because of the presence of case distinctions or punctuation?


This requires learning file I/O and some string manipulation
techniques. I would probably read each line, split on spaces and then
loop over each word and check for wh and add them to a new list.
After reading the file, you'd then use a sort to get them in the right
order.


 ◑ Create a file consisting of words and (made up) frequencies, where
 each line consists of a word, the space character, and a positive
 integer, e.g. fuzzy 53. Read the file into a Python list using open
 (filename).readlines(). Next, break each line into its two fields
 using split(), and convert the number into an integer using int(). The
 result should be a list of the form: [['fuzzy', 53], ...].

I recommend reading the Python Tutorial: http://python.org/doc/

If you're using Python 2.x, then check out http://www.diveintopython.org/

If you're using 3.0, your primary options are the online docs and
Programming in Python 3 by Summerfield.

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Your Favorite Python Book

2009-05-15 Thread Mike Driscoll
On May 11, 4:45 pm, Chris Rebert c...@rebertia.com wrote:
 On Mon, May 11, 2009 at 1:44 PM, Sam Tregar s...@tregar.com wrote:
  Greetings.  I'm working on learning Python and I'm looking for good books to
  read.  I'm almost done with Dive into Python and I liked it a lot. I found
  Programming Python a little dry the last time I looked at it, but I'm more
  motivated now so I might return to it.  What's your favorite?  Why?

 I like Python in a Nutshell as a reference book, although it's now
 slightly outdated given Python 3.0's release (the book is circa 2.5).

 Cheers,
 Chris
 --http://blog.rebertia.com

I use Hetland's Beginning Python and Chun's Core Python
Programming the most, although I haven't used them in a while. I also
use Martelli's Python Cookbook from time-to-time. Hopefully he will
put out a 3.0 version too.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Parsing Strings in Enclosed in Curly Braces

2009-05-15 Thread Mike Driscoll
On May 15, 11:12 am, xama...@yahoo.com wrote:
 How do you parse a string enclosed in Curly Braces?

 For instance:

 x = {ABC EFG IJK LMN OPQ}

 I want to do x.split('{} ') and it does not work. Why does it not work
 and what are EXCEPTIONS to using the split method?

 That I want to split based on '{', '}' and WHITESPACE.

 Please advise.

 Regards,
 Xav

The reason it doesn't work is that you don't have a string with {}.
Instead, you have one of each. If your string was like this, then it
would split:

x = {} ABC EFG

In the mean time, you can just use some string slicing like this:

y = x[1:-1]

That will remove the braces and allow you to manipulate the text
therein.

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ConfigParser and newlines

2009-05-15 Thread Mike Driscoll
On May 15, 1:09 pm, Minesh Patel min...@gmail.com wrote:
 I am using ConfigParser to parse a config file and I want to maintain
 the newlines, how is it possible. Example given below. BTW, is there
 an alternative to configParser, should I use 'exec' instead. Is there
 any support for yaml built-in or possibly in the future?


The primary alternative to ConfigParser is Michael Foord's ConfigObj:

http://www.voidspace.org.uk/python/configobj.html

I don't know if it has yaml support or not though.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to consume .NET webservice

2009-05-12 Thread Mike Driscoll
On May 12, 12:54 pm, namekuseijin namekusei...@gmail.com wrote:
 On May 12, 4:12 am, Diez B. Roggisch de...@nospam.web.de wrote:



  namekuseijin schrieb:
    Diez B. Roggisch wrote:
    namekuseijin schrieb:
    bav escreveu:
    question from a python newbie;
   
      how can i consume in python language, a .NET web service, passing
      a string array as parameter in some easy steps?
   
    Unless Microsoft extended the standard in any way, then it should
  be just as you consume any web service, I guess. ;)
   
    Microsoft *created* the standard..
   
    No:

  Yes:

 http://webservices.xml.com/pub/a/ws/2001/04/04/soap.html

 You are right, sorry.

  MS created it. That it *became* a standard of the W3C later - well, they
  did that with OOXML as well...

 OpenOfficeXML document format AKA ODF? ;)

No...Office Open XML, which is used in Microsoft Office 2007 and which
Microsoft rammed through the ISO: http://en.wikipedia.org/wiki/Office_Open_XML

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to abort module evaluation?

2009-05-12 Thread Mike Driscoll
On May 12, 1:33 pm, mrstevegross mrstevegr...@gmail.com wrote:
 I have a python script that is pretty simple: when executed, it
 imports a bunch of stuff and then runs some logic. When *imported*, it
 defines some variables and exits. Here's what it looks like:

 === foo.py ===
 if __name__ != '__main__':
   x = 1
   exit_somehow

 import bar
 do_some_stuff...
 === EOF ===

 There's a problem, though. On line 3, I wrote exit_somehow.
 Actually, I have no idea how to do that part. Is there some way I can
 get python to abandon processing the rest of the script at that point?
 I know goto doesn't exist, so that's not an option... sys.exit() won't
 work, because that will abort the entire python interpreter, rather
 than just the evaluation of the module.

 Thanks,
 --Steve

Isn't abandoning the processing of the rest of the script exiting the
script? You could use return or wrap the offending code in a try/
except block and do something on an exception...

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OOP Abstract Classes

2009-05-11 Thread Mike Driscoll
On May 11, 9:53 am, Adam Gaskins agaskins...@kelleramerica.com
wrote:
 Hi all,

 -- Non critical info--
 I am a fairly seasoned PHP developer (don't shoot, I'm changing teams!:) who
 is admittedly behind the curve with OOP. Like most who learned PHP, I
 started doing web app backend stuff, but I have moved to full blown windows
 apps in the last 6 months using Winbinder. As you may know Winbinder is
 essentially abandoned, and programming windows apps with Winbinder or even
 GTK-PHP is less than ideal. I also deal heavily in serial/rs-232
 communications which is a pain in PHP. Long story short, I'm tired of doing
 things in such a hackish manner and want to write applications that are
 cross platform (I'd like to get our production dept on linux eventually) and
 truely object oriented.
 -- END non critical stuff--

 So I was beginning to learn OOP for PHP, and it seemed to me that abstract
 classes were just right for my application. In my application I must
 communicate with several peices of test equipment that communicate via
 RS-232. Most use SCPI instructions, some do not and require low level
 communication.

 The way I understand abstract classes is that I could have a class that has
 all my abstract methods such as 'init', 'getMeasurement', 'setPressure',
 etc... then I could use this common interface to to control my different
 pieces of hardware (after I write a library for each of them).

 Is this a valid application for abstract classes? Or am I making life more
 complicated than it need be?

 Now, I have read that Pythons OOP implimentation is so much better and more
 complete then PHP's, but I cant find anything about abstract classes except
 this:http://norvig.com/python-iaq.html

 ...which says it doesn't exist in Python and you can only do this hack to
 make it work (and I don't particularly understand how to impliment it from
 this article).

 This makes me suspect I am making things more comlicated than they need to
 be. Could someone help me understand the proper way to impliment a set
 classes/methods to deal with several peices of similar and not so similar
 hardware? Not looking for anyone to write code for me, just help
 understanding some of these OOP concepts and how they would apply to my
 situation.

 Thanks!
 -Adam

I've never used (or heard of) the Abstract type...and the guy who
wrote the FAQ was being a jerk. It looks like he was just throwing in
an undefined variable name just to make his Python program break while
taking a pot shot at people who use that sort of thing. Whatever.

According to wikipedia, dynamic languages don't implement Abstract as
they can accomplish the same thing via duck typing:
http://en.wikipedia.org/wiki/Abstract_class .  The way it describes
the class, it made me think of decorators as well.

Hopefully someone who has used Abstract classes will jump in here and
give you more information about whether or not they matter in Python.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Writing text to a Word Document

2009-05-11 Thread Mike Driscoll
On May 11, 11:27 am, gazath...@gmail.com wrote:
 Hi everyone,

 I am trying to write several attributes from a database table and
 using the code below I can write the values however it is only
 overwriting on the first line.

 I am new to the win32com bit and I would like to know what is the
 recommended reference to loop down the page and add multiple records
 rather than the worddoc.Content.

 I have read a little about writing this to an RTF or htmol but I am
 getting information overload and going nowhere.  Does anyone have a
 nice tutorial out there that simply explains how to do this?

 Much appreciated for any thoughts.

 Cheers,

 Gareth

 import win32com.client, arcgisscripting, sys, os
 gp = arcgisscripting.create(9.3)

 #Create word document component 
 -http://www.faqts.com/knowledge_base/view.phtml/aid/37034/fid/244
 wordapp = win32com.client.Dispatch(Word.Application) # Create new
 Word Object
 wordapp.Visible = 1 # Word Application should`t be visible
 worddoc = wordapp.Documents.Add() # Create new Document Object
 worddoc.Content.Font.Size = 11
 worddoc.Content.Paragraphs.TabStops.Add (100)

 #Setup of GDB Connection
 # Get the Featureclass from the Mobel - Property Box
 PropBox = C:\\Avon Fire Rescue\\data\AvonFire_1.gdb\\PropertyBox

 # Make a search cursor for the Property Box Feature class
 PBselCur = gp.searchcursor(PropBox)
 PBrow = PBselCur.reset()
 PBrow = PBselCur.next()

 #Using the search cursor get the Premise ID from a Property box

 while PBrow:
     PBrowVal = PBrow.getvalue(PremisesID)
     #Add data to Word Document
     worddoc.Content.Text = (PBrowVal)
     PBrow = PBselCur.next()

 #worddoc.Close() # Close the Word Document (a save-Dialog pops up)

 print Fin

What you probably want is something like this:

rng = worddoc.Range(0,0)
while PBrow:
rng.InsertAfter(PBrowVal + \r\n)  # needs return and new line
character

At least, that's what I found in one of my books. It seemed to work
when I tested it in the interpreter.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using Pygame with Python

2009-05-11 Thread Mike Driscoll
On May 11, 2:54 pm, cripplem...@gmail.com wrote:
 Hi. I would just like to know which of the versions of python and
 pygame would be best to download for use together. I am a windows xp
 user.

Look at the pygame website to see what the newest version of Python it
supports and go with that unless there are known issues listed. If you
plan to make an executable of the game, then I recommend Python 2.5
since there are some known issues with 2.6 (don't know if that's true
for 3.0 or not, but it's probable).

- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to consume .NET webservice

2009-05-11 Thread Mike Driscoll
On May 11, 3:09 pm, bav baudewijn.verme...@skynet.be wrote:
 question from a python newbie;

   how can i consume in python language, a .NET web service, passing
   a string array as parameter in some easy steps?

 best regards

You're being pretty vague here. Try using Google first...I got plenty
of hits with python .net web service. This one sounds good:

http://www.beardygeek.com/2009/01/how-to-call-a-net-webservice-using-python/

It sounds like you consume it much like you do with other web
services...find the API and use Python to access it or create a parser
of some sort.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: desperately looking for a howto on running my wxPython app on Vista

2009-05-05 Thread Mike Driscoll
On May 5, 11:43 am, Paul Sijben paul.sij...@xs4all.nl wrote:
 Mike Driscoll wrote:
  On Apr 29, 4:17 am, Paul Sijben paul.sij...@xs4all.nl wrote:
  Is there any way to check which is the offending pyd/dll?  (normally
  Vista does not give out much data on what went wrong)

  Paul

  You might be able to find it using the Dependency Walker utility:

 http://www.dependencywalker.com/

 Mike, thanks! That spotted indeed some issues with one specific file:
 SHLWAPI.DLL, now let's see what is the issue. The report from Dependency
  Walker:Warning: At least one module has an unresolved import due to a
 missing export function in a delay-load dependent module. is not
 telling me much at this moment. The FAQ from Dependency Walker sais this
   is not a major issue, but apparently on Vista it is ?!?

 Does anyone have a clue what I am to do about this?

 Interestingly On WinXP it flags DWMAPI.DLL as missing. I did not spot
 that on the Vista box.

 Paul



  - Mike

Hmmm...I'm not familiar with that DLL, but a little googling seems to
indicate that you may be able to get it off your installation CD:

http://www.techimo.com/forum/applications-operating-systems/76550-winxp-msgina-dll-shlwapi-dll-problem.html

The link above gives the steps for XP, but Vista will probably be
similar. I don't know for sure, but you may have to register the dll
once you've got it copied back onto your machine.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: IDE for python 2.6 (auto complete)

2009-05-04 Thread Mike Driscoll
On May 4, 10:13 am, Soumen banerjee soume...@gmail.com wrote:
 Hello,
 I have just installed and run python 2.6.2 from the sources available
 on the website. I notice that SPE (the editor which i used with python
 2.5) is not displaying some of the functions new in 2.6 as
 autocomplete options. Is there any IDE with support for autocomplete
 in python 2.6 with all the newer functions included?

Wingware probably does. You should just submit a bug report to Stani
though. He can probably fix SPE for you.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython having trouble with frame objects

2009-05-01 Thread Mike Driscoll
On May 1, 12:12 am, Soumen banerjee soume...@gmail.com wrote:
 Hello,
 Im not adding any GUI elements from the changer thread. Im just
 attempting to change the value of a preexisting widget made in thread
 one. The point is that i need to display text generated in thread 2 in
 a GUI generated in thread 1.
 As far as inter thread synchronization is concerned, i see your point.
 So i took this approach

 import wx,gui,threading
 fix=0
 i=1
 class guithread(threading.Thread):
     def run(self):
         global fix
         app = wx.PySimpleApp(0)
         wx.InitAllImageHandlers()
         guithread.frame_1 = gui.MyFrame(None, -1, )
         app.SetTopWindow(guithread.frame_1)
         guithread.frame_1.Show()
         print setting fix
         fix=1
         app.MainLoop()
 gui1=guithread()
 gui1.start()
 class changer(threading.Thread):
     def run(self):
         print fix
         gui1.frame_1.text_ctrl_1.SetValue(hello)
 print fix
 while i:
     if fix == 1:
         print starting changer
         chang=changer()
         chang.start()
         i=0
 This works, but is there anything simpler?
 Regards
 Soumen

For additional ideas on using threads in wxPython, see the wiki:

http://wiki.wxpython.org/LongRunningTasks

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython having trouble with frame objects

2009-05-01 Thread Mike Driscoll
On Apr 30, 11:52 pm, Dave Angel da...@ieee.org wrote:
 Soumen banerjee wrote:
  Hello,
  you say that  frame_1 is an attribute of the main class. The main
  class here is guithread right? so any instance of guithread should
  also have an attribute called frame_1 isnt it? Excuse me if im getting
  this wrong, since i am somewhat new to python.
  Regards
  Soumen

  On Fri, May 1, 2009 at 9:05 AM, CM cmpyt...@gmail.com wrote:

  On Apr 30, 9:54 pm, Soumen banerjee soume...@gmail.com wrote:

  Hello,
  I am using wxglade to design a gui which i am using in another script.
  Here are the codes

  The main file:
  import wx,gui,threading
  class guithread(threading.Thread):
     def run(self):
         app =x.PySimpleApp(0)
         wx.InitAllImageHandlers()
         self.frame_1 =ui.MyFrame(None, -1, )
         app.SetTopWindow(self.frame_1)
         self.frame_1.Show()
         app.MainLoop()
  gui1=ithread()
  gui1.start()
  class changer(threading.Thread):
     def run(self):
         gui1.frame_1.text_ctrl_1.Setvalue(hello)
  chang=anger()
  chang.start()

  and The GUI file (gui.py, imported in the above)
  import wx

  # begin wxGlade: extracode
  # end wxGlade

  class MyFrame(wx.Frame):
     def __init__(self, *args, **kwds):
         # begin wxGlade: MyFrame.__init__
         kwds[style] =x.DEFAULT_FRAME_STYLE
         wx.Frame.__init__(self, *args, **kwds)
         self.text_ctrl_1 =x.TextCtrl(self, -1, )
         self.slider_1 =x.Slider(self, -1, 0, 0, 10)
         self.Open =x.Button(self, -1, Open)
         self.button_4 =x.Button(self, -1, Pause/Resume)
         self.button_5 =x.Button(self, -1, Quit)

         self.__set_properties()
         self.__do_layout()

         self.Bind(wx.EVT_COMMAND_SCROLL, self.slider, self.slider_1)
         self.Bind(wx.EVT_BUTTON, self.open, self.Open)
         self.Bind(wx.EVT_BUTTON, self.pause, self.button_4)
         self.Bind(wx.EVT_BUTTON, self.quit, self.button_5)
         # end wxGlade

     def __set_properties(self):
         # begin wxGlade: MyFrame.__set_properties
         self.SetTitle(frame_1)
         self.SetSize((522, 457))
         # end wxGlade

     def __do_layout(self):
         # begin wxGlade: MyFrame.__do_layout
         sizer_1 =x.BoxSizer(wx.VERTICAL)
         sizer_2 =x.BoxSizer(wx.VERTICAL)
         sizer_3 =x.BoxSizer(wx.HORIZONTAL)
         sizer_2.Add(self.text_ctrl_1, 7, wx.EXPAND, 0)
         sizer_2.Add(self.slider_1, 0, wx.EXPAND, 0)
         sizer_3.Add(self.Open, 0, wx.LEFT, 70)
         sizer_3.Add((52, 20), 0, 0, 0)
         sizer_3.Add(self.button_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
         sizer_3.Add((55, 23), 0, 0, 0)
         sizer_3.Add(self.button_5, 0, 0, 0)
         sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
         sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
         self.SetSizer(sizer_1)
         self.Layout()
         # end wxGlade

     def slider(self, event): # wxGlade: MyFrame.event_handler
         print Event handler `slider' not implemented!
         event.Skip()

     def open(self, event): # wxGlade: MyFrame.event_handler
         print Event handler `open' not implemented!
         event.Skip()

     def pause(self, event): # wxGlade: MyFrame.event_handler
         print Event handler `pause' not implemented!
         event.Skip()

     def quit(self, event): # wxGlade: MyFrame.event_handler
         print Event handler `quit' not implemented!
         event.Skip()

  # end of class MyFrame

  if __name__ =__main__:
     app =x.PySimpleApp(0)
     wx.InitAllImageHandlers()
     frame_1 =yFrame(None, -1, )
     app.SetTopWindow(frame_1)
     frame_1.Show()
     app.MainLoop()

  The problem here is that when i run the main file, i am told that
  'guithread' object has no attribute 'frame_1' whereas i seem to have
  defined
  self.frame_1=i.MyFrame etc.

  Your statement above means that self--that is, the instance of
  your main class--has an attribute called frame_1, and that name
  refers to an instance of the MyFrame class from the gui module.

  It does not mean that the guithread object has an attribute named
  frame_1.  In order to do that, you should have written:

  guithread.frame_1 =omething

  The idea here is to access a gui element running in a thread from a
  separate thread. Please help

  I would post wxPython related questions on the wxPython mailing
  list, which is excellent.
 http://www.wxpython.org/maillist.php

  HTH,
  Che
  --
 http://mail.python.org/mailman/listinfo/python-list

 Don't top-post. It puts things entirely out of order. Now the order of
 the parts of this message are 3, 1, 2, 4

 Two things at least are wrong here, either of which is fatal.
    1) you have two threads doing GUI stuff.  Can't be done, at least not in 
 wxPython.  Certain things can be done in a second thread, but definitely not 
 constructing Frames and such.


You are correct...but I think that's pretty common across GUI
toolkits. The GUI has it's own main loop that will get blocked if
another thread 

Pyowa Meeting Next Monday

2009-04-30 Thread Mike Driscoll

Hi,

Our May Pyowa meeting is next Monday, May 4th. It will be held at the 
Marshall County Sheriff's Office from 7-9 p.m. Direction are on the 
website: www.pyowa.org.


Agenda (in  no particular order):

1) Introduction to SqlAlchemy - An object oriented way of connecting to 
a database with a pythonic API.
2) Nick Fox from Fox Media Systems in Des Moines will talk about his 
experiences with Python and (maybe) his experience as a core developer 
for the Mythbuntu project.
3) A short GIS Code review - We'll look at some auto-generated ArcGIS(?) 
code from one of our members and try to improve it.


If you need a laptop to follow along, we have some that can be made 
available as long as you let me know ahead of time. I've been told that 
we will have snacks this time as well as pop and water.


Also note that the Iowa Code Camp is this Saturday. The reason I mention 
this is that there's a Django talk there and there may be a 
Python-related open space type thing too. You can check out the 
schedule here: http://iowacodecamp.com/. Iowa Code Camp is in Cedar 
Rapids. Go and support Python!


Anyway, I hope to see you next Monday! Let me know if you have any 
questions.


Mike Driscoll
Pyowa Organizer
www.pyowa.org
twitter.com/pyowa


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4046 (20090430) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations.html


Re: don't understand namespaces...

2009-04-30 Thread Mike Driscoll
On Apr 30, 9:11 am, Lawrence Hanser lhan...@gmail.com wrote:
 Dear Pythoners,

 I think I do not yet have a good understanding of namespaces.  Here is
 what I have in broad outline form:

 
 import Tkinter

 Class App(Frame)
       define two frames, buttons in one and Listbox in the other

 Class App2(Frame)
       define one frame with a Text widget in it

 root = Tk()
 app = App(root)
 win2 = Toplevel(root)
 app2 = App2(win2)
 root.mainloop()
 

 My understanding of the above goes like this:
 1) create a root window
 2) instantiate a class that defines a Frame in the root window
 3) create another Toplevel window
 4) instantiate another class that defines a frame in the Toplevel window 
 (win2)

 What I cannot figure out is how to reference a widget in app2 from app...

 I hope this is sort of clear.

 Any assistance appreciated.

 Thanks,

 Larry

It depends on how you're doing this. If the first frame opens the 2nd
frame, then you can have a handle to the 2nd in the 1st. Something
like this:

self.newFrame = NewFrame()

Then you can get at the attributes of the 2nd frame:

self.newFrame.SomeWidget.GetSomeValue()

If you're opening both at the same time, you'll have to come up with
something else, like Queues or pubsub.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: desperately looking for a howto on running my wxPython app on Vista

2009-04-29 Thread Mike Driscoll
On Apr 29, 4:17 am, Paul Sijben paul.sij...@xs4all.nl wrote:
 Gabriel Genellina wrote:
  I am currently stuck on the infamous R6034 error but I understand that
  after that there may be another issue with certain wxPython functions.

  That should be fixed in Python 2.6.2, I think.
  Are you compiling all your dependencies, including Python itself? R6034
  is likely a DLL mismatch between parts of your project.

 I am using 2.6.2 and am compiling only my own changed modules. For all
 the other support modules I have taken the most recent ones (win32,
 wxpython)

 Is there any way to check which is the offending pyd/dll?  (normally
 Vista does not give out much data on what went wrong)

 Paul

You might be able to find it using the Dependency Walker utility:

http://www.dependencywalker.com/

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: What do you think of ShowMeDo

2009-04-28 Thread Mike Driscoll
On Apr 28, 10:43 am, tuxagb alessiogiovanni.bar...@gmail.com wrote:
 On 28 Apr, 17:09, Astley Le Jasper astley.lejas...@gmail.com wrote:

  Hi,

  I've just stumbled over this (http://showmedo.com/) and being the very
  visual person I am, it seems like it could be a good way to learn
  about python. However, before I smack down $60, I wondered if anyone
  had any opinions on it. My gut feel is that it could be pretty good.

  ALJ

 It can be useful, but there are many free howtos and tutorial ... and
 the programming
 can't be learned with video, but with books!

 Hi.

Actually, I think working through examples or finding a small project
is more helpful than books or videos. The videos are nice though.
Check out the online book, Dive Into Python, if you haven't already.
Then try to make something, like a program to keep track of your CDs
or books or something. I think the learning process of creating some
application was probably the most valuable tool I ever had.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: Third Party Modules

2009-04-28 Thread Mike Driscoll
On Apr 28, 12:15 pm, John Nagle na...@animats.com wrote:
 Brock wrote:
  Hi Everyone,

  I know this is most likely a basic question and you will roll your
  eyes, but I am just starting out with Python (hobbyist) and I see many
  tutorials on the web referring to the use of external modules.

  However, when I locate them, they often come as a zipped folder with a
  number of files.  How do I install them?  In addition, is there an
  easy way to manage external modules? Some I see require additional
  modules not included.

     There are several different mechanism for handling this, and they all 
 suck.
 The whole Python module distribution scheme is so uncoordinated that there's
 no uniform way to do this.  It's not your fault.

     There's python ./setup.py.  There are eggs, which are supposed to
 install very simply, but in practice usually fail to install properly,
 producing obscure error messages.  There are Windows installers.
 There's no consistency.

     I'm currently struggling with guiding users through installation
 of a Python program I put on SourceForge. I have to explain to them how
 to install three different external modules which don't have compatible
 installation mechanisms.

     I'm not going to put Python software out for public use again.  I don't
 have the time to deal with this crap.

                                         John Nagle
                                         Animats

I've found the eggs thing to work more often than not. But I've seen
it fail before too. I'm not sure where tuxagb got the idea that
there's usually a Windows installer. If I want something, it's usually
more like a 50-50 chance of there being an installer.

Anyway, hopefully the snakebite project will help with this a little.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython notebook oddness

2009-04-27 Thread Mike Driscoll
On Apr 27, 1:50 pm, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
 En Thu, 23 Apr 2009 16:44:25 -0300, Lawson English lengli...@cox.net  
 escribió:

  Can anyone tell me why these two behave differfently?

 http://pastebin.com/m57bee079vs  http://pastebin.com/m3c044b29

 The code is so different that I don't see why they should behave  
 similarly...
 Please strip it down to the bare minimum showing the discrepancy (and tell  
 us *what* you see and what you expect)

 --
 Gabriel Genellina

Just ignore him. He re-posted to the wxPython list and they seem to
have him straightened out now.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: Help with code! Gamepad?

2009-04-24 Thread Mike Driscoll
On Apr 24, 10:11 am, DC16 luster...@gmail.com wrote:
 On Apr 23, 4:03 pm, Mike Driscoll kyoso...@gmail.com wrote:



  On Apr 23, 6:46 am, DC16 luster...@gmail.com wrote:

   I am using pygame and OpenGL.
   How do I make a gamepad able to move the camera to a side of a cube on
   screen.

   Here is the code for keyboard use:

   import pygame
   from pygame.locals import *
   import sys
   from OpenGLLibrary import *

   pygame.init()

   Screen = (800,600)
   Window = glLibWindow(Screen,caption=Camera Test)
   View3D = glLibView3D((0,0,Screen[0],Screen[1]),45)
   View3D.set_view()

   Camera = glLibCamera([0,0.5,6],[0,0,0])

   glLibColorMaterial(True)

   drawing = 0
   Objects = [glLibObjCube(),glLibObjTeapot(),glLibObjSphere
   (64),glLibObjCylinder(0.5,1.0,64),glLibObjCone(0.5,1.8,64)]

   while True:
       key = pygame.key.get_pressed()
       for event in pygame.event.get():
           if event.type == QUIT:
               pygame.quit()
               sys.exit()
           if event.type == KEYDOWN:
               if event.key == K_ESCAPE:
                   pygame.quit()
                   sys.exit()
               if event.key == K_RETURN:
                   drawing += 1
                   if drawing == 5:
                       drawing = 0
               if event.key == K_1: glLibColor((255,255,255))
               if event.key == K_2: glLibColor((255,0,0))
               if event.key == K_3: glLibColor((255,128,0))
               if event.key == K_4: glLibColor((255,255,0))
               if event.key == K_5: glLibColor((0,255,0))
               if event.key == K_6: glLibColor((0,0,255))
               if event.key == K_7: glLibColor((128,0,255))
       if   key[K_LEFT]: Camera.set_target_pos([-6,0.5,0])
       elif key[K_RIGHT]: Camera.set_target_pos([6,0.5,0])
       elif key[K_UP]: Camera.set_target_pos([0,6,2])
       elif key[K_DOWN]: Camera.set_target_pos([0,-6,2])
       else: Camera.set_target_pos([0,0.5,6])

       Camera.update()

       Window.clear()
       Camera.set_camera()
       Objects[drawing].draw()
       Window.flip()

   How do I change it so that a gampad can move the camera in the same
   way.
   (Ignore the colour changing code)

   Thanks,
   Dexter (DC16)

   BTW the code was originally by someone else.

  Try cross-posting to the pygame guys:http://www.pygame.org/wiki/info

  I read that pyglet will have some sort of gamepad support soon too, so
  you might want to check that project out as well.

  - Mike- Hide quoted text -

  - Show quoted text -

 I cannot find any code for gamepad/joypad on there.

I guess I was thinking of this: http://pypi.python.org/pypi/jaraco.input/1.0

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: WINXP vs. LINUX in threading.Thread

2009-04-23 Thread Mike Driscoll
On Apr 22, 2:57 pm, Kent kent.y...@gmail.com wrote:
 hello all,

 i want to add a new update notification feature to my wxPython appl.
 The codes below do the job. The logic is simple enough, I don't think
 it needs to be explained.

 since sometimes, under windows, proxy setting was a script. and was
 set in IE. In this case, connecting to the HTML will take relative
 long time. I therefore run the following codes in a new Thread
 (subclass of threading.Thread), so that user don't have to wait during
 the version checking period.

 Under Linux, it worked smoothly. But under Windows XP, it didn't. If
 there was new updates, the notification dialog can show, but no text,
 icon,  on it. Then, the whole application didn't response any
 longer. :( I have to force stop the application process.

 where is the problem?

 Thanks.

 code to get the version from a HTML:

 def getLatestVersion(versionUrl):
     #proxy is only for testing
 #    proxy_support = urllib2.ProxyHandler
 ({http:10.48.187.80:8080})
 #    opener = urllib2.build_opener(proxy_support)
 #    urllib2.install_opener(opener)
     #proxy is only for testing

     result = ''
     try:
         f = urllib2.urlopen(versionUrl)
         s = f.read()
         f.close()
         result = s.split(#xxx#)[1]
     except:
         pass
     return result

 Thread class:

 class UpdateChecker(Thread):
     def __init__(self):
         Thread.__init__(self)

     def run(self):
         lv = util.getLatestVersion(config.VERSION_URL)
         if lvconfig.VERSION:
             showUpdateDialog(lv)

 codes to start the thread:

 updatechk = UpdateChecker()
 updatechk.start()

You are probably blocking wxPython's main loop. There are several
examples of using threads with wxPython on their wiki:
http://wiki.wxpython.org/LongRunningTasks

As you will find, there are various methods within wxPython that are
threadsafe (such as wx.CallAfter) and you can use those to communicate
with and update your GUI. From what I've read, this is normal across
GUI toolkits. They all have special ways to work with threads.

In the future, I highly recommend that you join and post to the
wxPython list as that's where you'll get the best targeted advice (see
their website). This list is great for general questions though.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: Help with code! Gamepad?

2009-04-23 Thread Mike Driscoll
On Apr 23, 6:46 am, DC16 luster...@gmail.com wrote:
 I am using pygame and OpenGL.
 How do I make a gamepad able to move the camera to a side of a cube on
 screen.

 Here is the code for keyboard use:

 import pygame
 from pygame.locals import *
 import sys
 from OpenGLLibrary import *

 pygame.init()

 Screen = (800,600)
 Window = glLibWindow(Screen,caption=Camera Test)
 View3D = glLibView3D((0,0,Screen[0],Screen[1]),45)
 View3D.set_view()

 Camera = glLibCamera([0,0.5,6],[0,0,0])

 glLibColorMaterial(True)

 drawing = 0
 Objects = [glLibObjCube(),glLibObjTeapot(),glLibObjSphere
 (64),glLibObjCylinder(0.5,1.0,64),glLibObjCone(0.5,1.8,64)]

 while True:
     key = pygame.key.get_pressed()
     for event in pygame.event.get():
         if event.type == QUIT:
             pygame.quit()
             sys.exit()
         if event.type == KEYDOWN:
             if event.key == K_ESCAPE:
                 pygame.quit()
                 sys.exit()
             if event.key == K_RETURN:
                 drawing += 1
                 if drawing == 5:
                     drawing = 0
             if event.key == K_1: glLibColor((255,255,255))
             if event.key == K_2: glLibColor((255,0,0))
             if event.key == K_3: glLibColor((255,128,0))
             if event.key == K_4: glLibColor((255,255,0))
             if event.key == K_5: glLibColor((0,255,0))
             if event.key == K_6: glLibColor((0,0,255))
             if event.key == K_7: glLibColor((128,0,255))
     if   key[K_LEFT]: Camera.set_target_pos([-6,0.5,0])
     elif key[K_RIGHT]: Camera.set_target_pos([6,0.5,0])
     elif key[K_UP]: Camera.set_target_pos([0,6,2])
     elif key[K_DOWN]: Camera.set_target_pos([0,-6,2])
     else: Camera.set_target_pos([0,0.5,6])

     Camera.update()

     Window.clear()
     Camera.set_camera()
     Objects[drawing].draw()
     Window.flip()

 How do I change it so that a gampad can move the camera in the same
 way.
 (Ignore the colour changing code)

 Thanks,
 Dexter (DC16)

 BTW the code was originally by someone else.

Try cross-posting to the pygame guys: http://www.pygame.org/wiki/info

I read that pyglet will have some sort of gamepad support soon too, so
you might want to check that project out as well.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread Mike Driscoll
On Apr 22, 8:11 am, srinivasan srinivas sri_anna...@yahoo.co.in
wrote:
 Hi,
 Could you suggest me some modules in Python which can be used to develop GUI 
 based applications? and tell me which could be the best(in terms of 
 efficiency) one for a small GUI based application development?

 Thanks,
 Srini


See the Python Wiki: http://wiki.python.org/moin/GuiProgramming

Python comes with Tkinter, which is good for simple programs and some
of the people on this list use it for very complicated programs. I
like wxPython. There are many others as well. It really depends on
what you want to do and whether or not you need special widgets.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread Mike Driscoll
On Apr 22, 10:51 am, Tim Chase python.l...@tim.thechases.com wrote:
  My requirement is to write an application which is GUI based
  has to run on browsers. Could you tell me which one would be
  suitable for this?

 These are generally 2 different things:  either you're writing a
 local GUI rich-client (in which case, use the GuiProgramming wiki
 link Mike sent), or you're doing web development targeting
 browsers in which case you should investigate the myriad web
 programming frameworks for Python (Django, Turbogears, CheryPy,
 web.py, webstack, etc).

 There's a third type of application that I abhor, usually
 developed in Flash/Silverblight/JavaFX that runs within a
 web-browser, but allows for richer interactions/rendering than
 your average web-page.  However, I don't know of any python
 tie-ins for any of these environments.

 There's also a blurred line if you embed a web-browser in a local
 GUI application.

 -tkc

Technically speaking, Silverlight can be run with IronPython...which
works on Windows and Linux (through Mono), but not Mac (as far as I
know).

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: using python logo at startup

2009-04-21 Thread Mike Driscoll
On Apr 21, 11:46 am, Dhruv dhruv.howud...@gmail.com wrote:
 Is there a way to display/flash python powered logo for like 2
 seconds at startup of a helloworld application?

 Well actually I have an application that takes data from an excel file
 and generates a kml file and opens it up with google earth. All this
 is compiled in an exe file using py2exe. Now I just want to display
 the python logo before the actual script starts. Just for the sake of
 informing the user that this application was made using python.

 Is this possible?

Sure. You just need to pick a GUI toolkit and have it display a
picture for a few seconds and then disappear. wxPython has a built-in
splash screen widget made for just this purpose. Tkinter may too, or
you could just roll your own in it.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: SqlAlchemy and mssqlserver

2009-04-21 Thread Mike Driscoll
On Apr 21, 11:22 am, Stefano stef...@vulcanos.it wrote:
 Using sqlalchemy with pyodbc and mssqlserver
 Why sa always generate identity ?

 many thanks here the sample

 tb = Table('prova',meta,Column('chiave', Integer, primary_key=True))
 tb.create()

 CREATE TABLE prova (
  chiave INTEGER NOT NULL IDENTITY(1,1),
  PRIMARY KEY (chiave)
 )

 Stefano

Try re-posting to the SqlAlchemy mailing list. They'll be able to tell
you.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Mike Driscoll
On Apr 21, 3:35 pm, Kent kent.y...@gmail.com wrote:
 Hi there,

 I wrote a desktop application with wxPython2.8. And got a problem.
 Hope here someone can give some hint. Thanks in advance.

I recommend joining the wxPython mailing list and posting there. The
guys there are great and can probably help you out. See
http://wxpython.org/maillist.php



 There was a ListCtrl (lc) in my GUI, and it was a bit long, so that
 there would be some blank space below (empty area) in case there
 were only a few items.

 I bind a function on the event wx.EVT_LIST_ITEM_RIGHT_CLICK, when user
 rightclick on the lc item, my function was triggered, and open a popup
 menu.

 Depends on the item user clicked, the menu items can be different. I
 checked the event.getData(), to decide which menu item will show to
 user. That is, if user right click on the empty area, the
 event.getData() will be 0. I wrote the appl. under Linux, and tested,
 it worked as what I expected.

 However, today someone reported a bug, said, under Windows XP, right
 clicking on the items of lc, it works fine, but if on the empty area
 of the lc, nothing happened, no popup menu. I tested under WINXP, the
 function was not triggered at all when I right-clicked on the empty
 area.

 I tried to bind wx.EVT_RIGHT_DOWN(UP) to the lc, but the function
 cannot be triggered under Linux.  any suggestion?

 Thanks

 regards,

 Kent

If you join the wxPython list, they'll probably ask for a small
runnable sample. Here's some instructions for how to do that:
http://wiki.wxpython.org/MakingSampleApps

It would be good to know what mode you are using for your ListCtrl.
List view, report, icon or what? The demo doesn't have any white space
at the end, so I can't test this easily. Are you using a sizer to hold
the widget?

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: color propagation in tkinter

2009-04-20 Thread Mike Driscoll
On Apr 20, 12:35 pm, Alan G Isaac alan.is...@gmail.com wrote:
 I'm a tkinter novice.

 If I want to propagate changes to a font,
 I can just use a named font.

 What if I want to propagate color changes?
 (E.g., a change in background color for
 a number of widgets.)

 Thanks,
 Alan Isaac

One way would be to keep a list of the widgets that you want to be
able to change the color of, and then loop over the list and change
their respective colors as needed.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to create an unclosed dialog in wxPython?

2009-04-19 Thread Mike Driscoll
On Apr 19, 4:36 am, liangguan...@gmail.com wrote:
 On 4月18日, 下午9时40分, 书虫 liangguan...@163.com wrote:

  In wxPython, after I create a wx.Frame, I want to create a modeless
  and unclosed dialog. Here is my step:

  app = wx.PySimpleApp()
  f = wx.Frame(None, -1, Test)
  d = wx.Dialog(f, -1, Test Dialog, style = wx.CAPTION)
  f.Show()
  d.Show()
  app.MainLoop()

  As you see, I create a dialog with wx.CAPTION style. And than, there
  is no close button in this dialog. It seems unclosed dialog, but in
  fact, if you enter Alt+F4 in this dialog, it will close. How could I
  do?

 Binds the wx.EVT_CLOSE event and ignor it in the handle function.

This is the preferred method...there is a slight caveat that when you
actually want to close the dialog, you'll need to use the dialog's
Destroy() method...

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython 2.8 for Python 2.6 on Linux

2009-04-19 Thread Mike Driscoll
On Apr 19, 8:30 am, David Robinow drobi...@gmail.com wrote:
 On Sun, Apr 19, 2009 at 1:58 AM, Kenny x xarv...@gmail.com wrote:
  Hello, I use Ubuntu 8.10 and the latest version of Python.

  I started programming wxPython on my Windows computer,

  but now I have access to my ubuntu box, and want wxPython for 2.6

  All the debs in the package manager are for 2.5, not 2.6

  How can I Install wxPython for Python 2.6 without building from the source?

  Any help appreciated, I need this solved! :)

  --
 http://mail.python.org/mailman/listinfo/python-list

 I don't know. Why don't you ask Ubuntu?
 How come you don't want to build from source?

Did you look at the wxPython wiki?

http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

Try that. If it doesn't work, then you'll probably have to install
from source. However, I wouldn't bother with it and Python 2.6 until
wxPython's next release as there are some goofy things going on with
the manifest files. Maybe this doesn't affect Linux users
though...however, if you experience weird issues, that may be the
cause...or you didn't build it correctly.

If you need help building wxPython, please post to the wxPython list.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: IronPython newbie: not clear on imports and assemblies

2009-04-15 Thread Mike Driscoll
On Apr 15, 3:31 pm, Thomas Gagne tga...@wide-open-west.com wrote:
 OK--I also haven't programmed on .NET before.

 My goal is to play with the EssentialPDF libraries inside IronPython.
   But I'm not clear on how to import (load?) Essential's .dll files.  Of
 course, all the samples files are in C# and VB.  I guess Im wondering
 if Essential's libraries (assemblies?) should already be in my path or
 if I need to provide a path to them, and whether or not I'm going to use
 import or Assembly.Load(), and if the latter, where am I to find
 Assembly?  I'm pretty sure that has to be imported as well 'cause
 whenever I try to use it I'm told it doesn't exist...

 Anyway, I'll keep Googling around and reading tutorials to catch-up.  I
 haven't used Python since 1999 so I need some refreshing...
 --
 Visit http://it.toolbox.com/blogs/anything-worth-doing to read
 my rants on technology and the finance and consulting industries.

First of all, you should join the IronPython mailing list and ask
there. They can probably give quicker, better answers. See
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

You might also want to buy Michal Foord's new book: IronPython in
Action from Manning.

I'm pretty new to IronPython too, but my guess is that you'd have to
do something like this:

code
import clr
clr.AddReference(EssentialPDF)

# now EssentialPDF should be in your python namespace
# so you can do something like this:

from EssentialPDF import SomeModule

# or

EssentialPDF.SomeModule

/code

At least, that's how it seems to work for most .NET libraries. Hope
that helps.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython question

2009-04-14 Thread Mike Driscoll
On Apr 13, 9:12 pm, Clemens Anhuth blackw...@nexgo.de wrote:
 isam uraiqat wrote:
  I HATE VISTA!!

  it just needed to be installed on the site packages library, because
  it was installed by default on program files,

  hope this might help another poor vista user

 Hello.

 Can you explain?

 Does the installer default to the wrong directory (installer fault)?

 Does Vista mislead you to choose the wrong directory in the installer
 (user fault)?

 With best regards

 Clemens Anhuth

I've not had any problems whatsoever installing wxPython or its demo
on Vista. What are you doing exactly?

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: tkFileDialog - ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 11:26 am, Alan G Isaac alan.is...@gmail.com wrote:
 Why do I get the ImportError below?
 What is the right way to do this?
 Thanks,
 Alan Isaac

 Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] 
 on win32
 Type help, copyright, credits or license for more information.
   import Tkinter as tk
   root=tk.Tk()
   import tkFileDialog
   fh = tkFileDialog.asksaveasfile()
 Traceback (most recent call last):
    File boot_com_servers.py, line 44, in module
    File tbzr.pyo, line 125, in module
    File tbzr.pyo, line 60, in get_all_com_classes
    File contextmenu.pyo, line 9, in module
 ImportError: No module named shell
 Redirecting output to win32trace remote collector

Well, if you have tortoisehg installed, uninstall it. That was what
was giving me this exact error with wxPython file dialogs.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: tkFileDialog - ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 2:29 pm, Alan G Isaac alan.is...@gmail.com wrote:
  On Apr 13, 11:26 am, Alan G Isaac alan.is...@gmail.com
  wrote:
  Why do I get the ImportError below?
  What is the right way to do this?
  Thanks,
  Alan Isaac
  Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC
  v.1310 32 bit (Intel)] on win32 Type help, copyright,
  credits or license for more information.
    import Tkinter as tk
    root=tk.Tk()
    import tkFileDialog
    fh = tkFileDialog.asksaveasfile()
  Traceback (most recent call last):
     File boot_com_servers.py, line 44, in module
     File tbzr.pyo, line 125, in module
     File tbzr.pyo, line 60, in get_all_com_classes
     File contextmenu.pyo, line 9, in module
  ImportError: No module named shell
  Redirecting output to win32trace remote collector

 On 4/13/2009 2:28 PM Mike Driscoll apparently wrote:

  Well, if you have tortoisehg installed, uninstall it. That was what
  was giving me this exact error with wxPython file dialogs.

 No, I don't have tortoisehg.
 But, I do have Bazaar installed,
 and that is the only place I see contextmenu.pyo.

 And that appears to be the source of the 
 problem:https://bugs.launchpad.net/bzr/+bug/305085

 Can you help me understand how
 another application can interfere with Tkinter
 in such a fashion?

 Thank you!
 Alan Isaac

Here's my (probably flawed) understanding of what tortoisehg does:
According to their bug report, there's a dll mismatch that causes the
issue (see 
http://bitbucket.org/tortoisehg/stable/issue/67/thg-conflicts-with-other-python).

I haven't had any issues with IDLE and bzr as of yet, and it
definitely hasn't given my Wingware IDE any issues either. I wonder if
you need to just upgrade to the latest bzr to see if that fixes the
issue. I have a pretty old one (1.8)...then again, I'm using wxPython,
not Tkinter.

Anyway, somehow these DVCSes are messing with the shell itself, which
is what a file dialog tries to open too. When the file dialog goes to
open it, it executes some code automagically in the DVCS and then
crashes.

Hopefully someone else with more knowledge will step in and give us a
clue.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: loop? maybe?

2009-04-10 Thread Mike Driscoll
On Apr 10, 7:42 am, heidi taynton heidihan...@mac.com wrote:
 Hey guys,

 Sorry for being such a noob with this stuff and the language is hard for me 
 to read through with the online manuals...  i can do math speak, and science 
 speak... not so much programming/code speak... so when you say pickle... i 
 think food

 Anyways,

 I have an array and I want to turn it into a new array.   where

 nlines = 188
 new_array=n.array(nlines)

 for i in arange(nlines):

 #   and here i want to tell it to read old_array and take  n  data points 
  where new_n=1.1**old_n ... take the mean of those data points and put them 
 in the first spot in the array    then loop through with until the array 
 is full?      If it doesn't make sense, i can try to clarify some more...

 Thanks, you guys are life savers,
 hi

I'm probably missing something, but is this sort of what you are
looking for?

code

nlines = 188
new_array = [] # this creates a list
for i in range(nlines):
new_n = 1.1 ** i
mean = (new_n + i) / 2
new_array.append(mean)

/code

If you wanted a cumulative mean of the values, then you'll have to
change it slightly of course, probably by using a nested loop.

Hopefully this isn't a homework question, but even if it is, it's an
interesting exercise.

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: Q: Best book for teaching

2009-04-07 Thread Mike Driscoll
On Apr 6, 9:37 am, grkunt...@gmail.com wrote:
 I am considering teaching an introduction to programming course for
 continuing education adults at a local  community college. These would
 people with no programming experience, but I will require a reasonable
 facility with computers.

 What would be a good book to use as the text for the course?

 Thanks.

If they ever release it, this book might be good:

http://www.amazon.com/Hello-World-Computer-Programming-Beginners/dp/1933988495/ref=pd_bbs_sr_1?ie=UTF8s=booksqid=1239129498sr=8-1

Zelle's Python Programming book is pretty good (and was written by a
college professor) and I've heard good things about ORielly's Learning
Python by Lutz.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: Any library to bind python with Yahoo mail service

2009-04-02 Thread Mike Driscoll
On Apr 2, 7:45 am, guptha gjango...@gmail.com wrote:
 Hi friends,
 I came across libgmail library that can be used to bind python with
 Google Gmail's service .Likewise is there any library available to
 access the service of Yahoo mail  from python code .
 I like to send sms from my application  via Yahoo mail Service .
 Thanks

Google's first hit was this:

http://developer.yahoo.com/python/

It's not a library, but it's the way that Yahoo itself recommends.

- Mike
--
http://mail.python.org/mailman/listinfo/python-list


Pyowa Meeting 04-02-2009

2009-04-01 Thread Mike Driscoll

Event: Pyowa Meeting
Location: Durham Center Room 248, ISU, Ames, IA
Time:  7-9 p.m. on 04/02/2009
Topics: PyCon thoughts, plans for expanding, script review
Website  directions: www.pyowa.org

If you're a Python programmer or want to be one, come to Pyowa! It's a 
good networking opportunity and it's fun! We even have a mailing list. 
See our website for more details. We hope to see you there!


Mike Driscoll
Pyowa Organizer
www.pyowa.org




__ Information from ESET NOD32 Antivirus, version of virus signature 
database 3979 (20090331) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations.html


  1   2   3   4   5   6   >