Re: regex help

2009-12-16 Thread Intchanter / Daniel Fackrell
tation for several built-in options, and I'm sure there are many community projects that may fit the bill if none of those happen to. Personally, I consider regular expressions of any substantial length and complexity to be bad practice as it inhibits readability and maintainability. They are a

Re: Odd json encoding erro

2009-12-15 Thread Intchanter / Daniel Fackrell
: "Johnson, S", "name_first": "Steven", "name_full": "Johnson, Steve", "name_last": "Johnson", "name_matrilineal": "", "name_middle": "David", "name_nick": "", "name_prefix": "", "name_title": "", "name_use": "Steve", "player_id": "489002", "primary_position": "1", "primary_position_txt": "P", "primary_sport_code": "", "pro_debut_date": "", "start_date": "2009-12-10T00:00:00", "status": "Active", "status_code": "A", "status_date": "2009-12-10T00:00:00", "team_abbrev": "SF", "team_code": "sfn", "team_id": "137", "team_name": "San Francisco Giants", "throws": "R", "weight": "200" }, "totalSize": "1" }}}' import json print json.loads(data) (I'm running 2.6.4 on Mac OS X) Intchanter Daniel Fackrell -- http://mail.python.org/mailman/listinfo/python-list

Re: accessing gmail

2009-12-15 Thread Intchanter / Daniel Fackrell
http://mail.google.com/support/bin/answer.py?hl=en&answer=77654 -- http://mail.python.org/mailman/listinfo/python-list

Re: Immediate Help with python program!

2009-12-09 Thread Intchanter / Daniel Fackrell
On Dec 9, 5:18 pm, Jon Clements wrote: > Someone's homework assignment is overdue/due very soon? And, I don't > believe for a second this is your code. In fact, just searching for > (the obvious Java based) function names leads me to believe you've > 'butchered' it from Java code (do you not th

Re: Parsing json where object keys are not quoted?

2009-12-09 Thread Intchanter / Daniel Fackrell
On Dec 9, 3:51 pm, Wells wrote: > Is there some way to finagle the json module to parse JSON (well, > almost JSON) where the object keys are not in quotes? I know it's not > 100% valid JSON, but I'm just curious. > > I don't have control over the data, so I can't make it fit the spec :) Hopefully

Re: Perl to Python conversion

2009-12-09 Thread Intchanter / Daniel Fackrell
to learn Python and ending up with a useful tool is secondary, I'd recommend rewriting the tool from scratch, possibly keeping the Perl source handy. If the existing tool is command-line based, you might also be able to write a short script through which you can pipe the output of the original

Re: Wrong with this script?

2005-03-05 Thread Daniel Fackrell
k" out of the loop and continue executing. You may also want to look at the rest of your script for another place you can use "break" in order to eliminate a flag. Happy scripting, and welcome to the bliss that is Python. Daniel Fackrell -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong with this script?

2005-03-05 Thread Daniel Fackrell
stead here. > if again!="yes": > mainloop = 0 This last line needs indented. And a couple of minor points: 1. Choose an amount of indentation per level and stick to it. 4 is rather common in Python code. 2. When posting to the list, make sure that the lines in your code are short enough that they will not wrap and be posted as broken code. 70 chars is usually safe. Daniel Fackrell -- http://mail.python.org/mailman/listinfo/python-list

Re: assert 0, "foo" vs. assert(0, "foo")

2005-02-23 Thread Daniel Fackrell
> "Thomas Guettler" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Hi, > Python 2.3.3 (#1, Feb 5 2005, 16:22:10) [GCC 3.3.3 (SuSE Linux)] on linux2 > >>> assert 0, "foo" Assert that 0 is true. If that fails, raise AssertionError("foo"). > Traceback (most recent call last): >

Re: [perl-python] text pattern matching, and expressiveness

2005-02-08 Thread Daniel Fackrell
ower in expression, with respect to semantics (i.e. > > algorithms), showcases Perl's poverty in specification. > > Clarify :-D. Clarification: He (XL) is a troll and admits it. If only he would include that information up-front in his (IMO worthless) [perl-python] post

Re: [perl-python] string pattern matching

2005-02-01 Thread Daniel Fackrell
somebody is still guarding against misleading information to newbies continue dealing with it manually. Daniel Fackrell -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] string pattern matching

2005-02-01 Thread Daniel Fackrell
n order to avoid having to spend the time to find the inaccuracies in each one individually. Considering the response so far, a list of frequent posters and not-so-frequent posters who will vouch for the accuracy of the disclaimer might even be added. Daniel Fackrell -- http://mail.python.o