Re: Re: Dictionary from String?

2011-05-08 Thread gslindstrom

On May 8, 2011 2:00pm, Dan Stromberg drsali...@gmail.com wrote:

On Sun, May 8, 2011 at 8:20 AM, Greg Lindstrom gslindst...@gmail.com  
wrote:


Is it possible to create a dictionary from a string value? Something  
along these lines (but that works):



 mystring = {'name':'greg','hatsize':'7 5/8'}
 mystring




{'name':'greg','hatsize':'7 5/8'}
 dict(mystring)
Traceback (most recent call last):
File , line 1, in
ValueError: dictionary update sequence element #0 has length 1; 2 is  
required



Yes. It works like a champ. Thanks!
--greg
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-14 Thread gslindstrom
On Aug 12, 4:33 am, Paul Rubin no.em...@nospam.invalid wrote:
 Baba raoul...@gmail.com writes:
  exercise: given that packs of McNuggets can only be bought in 6, 9 or
  20 packs, write an exhaustive search to find the largest number of
  McNuggets that cannot be bought in exact quantity.

 Is that a homework problem?  Hint: first convince yourself that a
 largest number actually exists.

If I recall, this was a puzzler on the NPR radio show Car Talk.
Still might be homework, though.
-- 
http://mail.python.org/mailman/listinfo/python-list


Python or Ant

2010-01-26 Thread gslindstrom
My company is looking at creating a tool to allow us to define and manage a  
process for each job we run (a typical job may be look on a customers ftp  
site for a file, download it, decrypt it and load it into our database). We  
would like something which would allow us to glue together various existing  
processes we currently use into a single unit with multiple steps. Along  
the way, this new routine would need to log its progress and be able to  
report and even handle errors. A coworker has suggested we look at Ant  
(Another Neat Tool) and, though it looks promising, I have reservations.  
If I recall correctly, it was intended as a replacement for Make and I  
worry that we may be trying to force Ant to be something it is not. Also,  
most of our code base is in Python and I'd really like to stay that way, of  
possible.


Are there any systems out there that will allow me to run multiple programs  
as one process? We could write our own, of course, and the Twisted package  
looks like it would be fun to use. Or, is Ant a viable solution to our  
problem?


Your constructive comments would be appreciated

Greg Lindstrom
Novasys Health
Little Rock, Arkansas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why not enforce four space indentations in version 3.x?

2009-07-11 Thread gslindstrom
On Jul 10, 2:22 pm, walterbyrd walterb...@iname.com wrote:
 I believe Guido himself has said that all indentions should be four
 spaces - no tabs.

 Since backward compatibility is being thrown away anyway, why not
 enforce the four space rule?


There is a routine in the Scripts directory, reindent.py, that will
take your source file(s) and remove tabs, unify the indents to 4-
spaces, remove needless characters at the end of lines, etc.  IIRC, it
was written by Tim Peters.  We run all of our source files though
before checking them into svn.


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


PyCon 2009 Tutorial Days

2009-02-07 Thread gslindstrom
Registration for PyCon 2009 http://us.pycon.org/2009/registration/ (US) is
open.  Because of the popularity of the tutorials in years past, this year
features 2 days of tutorials http://us.pycon.org/2009/tutorials (32 total
class on Wednesday, March 25 and Thursday, March 26) including:

   - 2 tracks on Introduciton to Python
   - Working with Excel
spreadsheetshttp://us.pycon.org/2009/tutorials/schedule/1AM8/
   - GIS with Python http://us.pycon.org/2009/tutorials/schedule/1PM4/
   - Django http://us.pycon.org/2009/tutorials/schedule/1PM2/
   - Concurrency http://us.pycon.org/2009/tutorials/schedule/1PM6/ and
   Kamaelia http://us.pycon.org/2009/tutorials/schedule/1AM7/
   - Testing http://us.pycon.org/2009/tutorials/schedule/2AM2/
   - SQLAlchemy http://us.pycon.org/2009/tutorials/schedule/2AM4/
   - Advanced topics
   http://us.pycon.org/2009/tutorials/schedule/
   - much, much more http://us.pycon.org/2009/tutorials/schedule/

These classes are being presented by some of the smartest cookies in the
Python community and are 3-hours each (with break).  You get to rub
shoulders with other Python programmers who share your interests and all
sessions have time for you to ask questions.  There is a (modest) cost to
attend, but you will get great training as well as class notes.  We even
feed you lunch and provide snacks during the breaks.

Click http://us.pycon.org/2009/about/ for more information.  Questions?
Email us at pycon-tutori...@python.org.

Greg Lindstrom
Tutorial Coordinator
--
http://mail.python.org/mailman/listinfo/python-announce-list

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


PyCon 2009 Tutorial Days

2009-02-07 Thread gslindstrom
Registration for PyCon 2009 http://us.pycon.org/2009/registration/ (US) is
open.  Because of the popularity of the tutorials in years past, this year
features 2 days of tutorials http://us.pycon.org/2009/tutorials (32 total
class on Wednesday, March 25 and Thursday, March 26) including:

   - 2 tracks on Introduciton to Python
   - Working with Excel
spreadsheetshttp://us.pycon.org/2009/tutorials/schedule/1AM8/
   - GIS with Python http://us.pycon.org/2009/tutorials/schedule/1PM4/
   - Django http://us.pycon.org/2009/tutorials/schedule/1PM2/
   - Concurrency http://us.pycon.org/2009/tutorials/schedule/1PM6/ and
   Kamaelia http://us.pycon.org/2009/tutorials/schedule/1AM7/
   - Testing http://us.pycon.org/2009/tutorials/schedule/2AM2/
   - SQLAlchemy http://us.pycon.org/2009/tutorials/schedule/2AM4/
   - Advanced topics
   http://us.pycon.org/2009/tutorials/schedule/
   - much, much more http://us.pycon.org/2009/tutorials/schedule/

These classes are being presented by some of the smartest cookies in the
Python community and are 3-hours each (with break).  You get to rub
shoulders with other Python programmers who share your interests and all
sessions have time for you to ask questions.  There is a (modest) cost to
attend, but you will get great training as well as class notes.  We even
feed you lunch and provide snacks during the breaks.

Click http://us.pycon.org/2009/about/ for more information.  Questions?
Email us at pycon-tutori...@python.org.

Greg Lindstrom
Tutorial Coordinator
--
http://mail.python.org/mailman/listinfo/python-list


Python and Nagios

2009-01-27 Thread gslindstrom
Hello all-

We have started using Nagios at work to monitor our computer system and have
been very happy with the results.  We have decided to use it monitor our
business processes as well, so I needed to write custom plug-ins and I opted
to use Python because I am very comfortable with it.  I found an excellent
paper by Cameron Laird and Wojciech Kocjan showing the basics (thanks,
guys!) and I have written plugins to verify the arrival and departure of
files as well as the completion of business processes.  We plan to use
Nagios to report on file audits and reprocess jobs that have failed because
a database or Internet connection burps.  We have great plans for Nagios and
I intend to submit a paper to next years PyCon showing what we have done.

What I would like to know is if there is anything resembling a package to
help with plugin deveopment with Python.  I have a base class that provides
most of the GNU plugin requirements (warning and critical threshold pattern
processing, logging requirements, etc) and would like to work on creating
something to release for general use, but I don't want to reinvent the
wheel.  Is there anything close to what I'm suggesting out there?  I've
looked in the standard places and have not located anything.

I will continue to add to my local package and, if I don't hear about a
similar effort, will look to create something for the Cheese Shop.  If you
are interested in helping out, please drop me a line via the list or at
gslindstrom via gmail.

Thanks,
--greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: does anybody earn a living programming in python?

2006-09-26 Thread gslindstrom
walterbyrd wrote:
 If so, I doubt there are many.

I program full-time in Python writing systems to automate the
processing of health care claims.  Lots of database usage, lots of
objects, lots of fun to write it in python (I used to code C/C++ and
Perl).

 I wonder why that is?
Me, too.  Are you *sure* there aren't many??

--greg

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


Re: IronPython 1.0 released today!

2006-09-06 Thread gslindstrom
Jim Hugunin wrote:
 I'm extremely happy to announce that we have released IronPython 1.0 today!
  http://www.codeplex.com/IronPython

Way to go, Jim!! I am impressed with the effort.
--greg

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


Re: Read a file with open command

2006-08-12 Thread gslindstrom
AlbaClause wrote:
 jean-jeanot wrote:

snip

 Ummm, he did not say that your question was stupid.   The Zappa quote is
 included as part of what we refer to as a 'signature'.   In the case of
 Sybren Stuvel's posts to this newsgroup, the Frank Zappa quote is included
 in every message that he posts.  Not just messages that he posts to you.

First up, I *like* the Frank Zappa signature quote; it has a George
Carlin feel to it and takes a swipe at our overly-protective cultures
[side note: I bought an electric heating pad last night that came with
instructions not to use it in the bathtub!  Well, duh!].  But, can you
see where the signature on a response to a tutor list -- where people
are already feeling a bit intimidated and/or inadequate and therefore
may feel a wee bit stupid -- might be taken the wrong way?

I have spent many years teaching mathematics and physics in a classroom
setting and have come to realize that, as a teacher, just about
anything I say/do can be blown way out of proportion.  So I don't use
sarcasm or fun little put-downs and I treat every question as if it
is the most important matter because, to the student, it is.  Do I get
tired of answering the same thing over and over? Yes!!  Many times I
will ask if the student has read the textbook and, if not, I will
request they give it a try (much in the same way we ask if they have
read any tutorials), but I take Homeric efforts not to offend them and,
to that end, modify my behavior in order to teach them mathematics.

My point is that this is a wonderful service you tutors provide, but
the Zappa signature may not be the best choice for this setting. Most
people will read it and get a laugh (as did I), but how many have taken
it the way jean-jeanot did and walk away feeling insulted?  How many
will not post a response expressing their feelings, never post a
question again or, worst case, decide Python is not for them?

Again, I admire this list and those of you you maintain it.  These are
just my thoughts.  YMMV.

--greg

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


Re: do people really complain about significant whitespace?

2006-08-10 Thread gslindstrom
Carl Banks wrote:
 Although Python doesn't do this, it is possible to mandate a specific
 indent (4 spaces, say), or at least a reasonable consistent indent  snip

I like running reindent.py (found in your Python source directory under
Tools/Scripts) which cleans up indentations, trailing whitespace, and
other things.  We run our entire source directory through reindent
before we check it into our library.  A very nice routine courtesy of
Tim Peters, I believe.

--greg

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


Re: do people really complain about significant whitespace?

2006-08-08 Thread gslindstrom
infidel wrote:
 Where are they-who-hate-us-for-our-whitespace?  Are they really that
 stupid/petty?  Are they really out there at all?  They almost sound
 like a mythical caste of tasteless heathens that we have invented.
 It just sounds like so much trivial nitpickery that it's hard to
 believe it's as common as we've come to believe.

Some of it may be a reaction from old-timers who remember FORTRAN,
where (if memory serves), code had to start in column 16 and code
continutations had to be an asterik in column 72 (it's been many years
since I've done any work in FORTRAN, but you get the idea)

Or it may be a reaction from Assembler, which is also quite
column-centric (is Assembler still taught in schools??).

But most likely, it's different.  It's easier to complain about things
than to actually check them out.  Recently I had a friend tell me that
they absolutely hated a certain tv personality/author.  When I asked if
they had ever watched the person or read one of their books, they said
Why should I?  I hate them!!.  I think the same attitude comes into
play with computer languages.

One more thing.  I have many friends that love to program Perl.
Without bashing the language, I find it ironic when they say There's
more than one way to do it but inisit that I should be using Perl
while they quote Python as There's only one way to do it though
(most) Python coders I know are fairly comforatble dealing with
multiple languages.

--greg

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


Re: War chest for writing web apps in Python?

2006-07-29 Thread gslindstrom
Sybren Stuvel wrote:
 Vincent Delporte enlightened us with:
  I'm thinking of using Python to build the prototype for a business
  web appplication.

 Why just the prototype?


I don't know about Vincent, but I once worked in a C++ shop where all
other languages were actively discouraged.  I would build my prototypes
in Python to show proof of concept because I could do it quickly.  It
was also nice to show project managers so they could verify it was what
they wanted us to build before we dedicated a full time effort to
development.

I recall once prototype I created in wxWindows; when I showed it to my
boss he exclaimed That's Python!?.  He was amazed because it looked
just like the windows apps we developed!

Having moved on to another company where we develop in Python
full-time, I hear my former shop now has many Python (and Perl and
Java) programmers.

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