Search Discussions
-
All: Finding .ini configuration files too limiting, JSON and XML to hard to manually edit, and YAML too complex to parse quickly, I have started work on a new configuration file parser. I call the ...
Patrick Maupin
Mar 1, 2010 at 2:09 am
Mar 10, 2010 at 9:56 pm -
Hi, how can I write the popular C/JAVA syntax in Python? Java example: return (a==b) ? 'Yes' : 'No' My first idea is: return ('No','Yes')[bool(a==b)] Is there a more elegant/common python expression ...
Gentlestone
Mar 30, 2010 at 3:40 pm
Apr 19, 2010 at 12:16 pm -
Is there a sequence-oriented equivalent to the sum built-in? E.g.: seq_sum(((1, 2), (5, 6))) -- (1, 2) + (5, 6) -- (1, 2, 5, 6) ? (By "sequence" I'm referring primarily to lists and tuples, and ...
Kj
Mar 24, 2010 at 3:29 pm
Apr 6, 2010 at 2:51 pm -
For C++ Petru Marginean once invented the "scope guard" technique (elaborated on by Andrei Alexandrescu, they published an article about it in DDJ) where all you need to do to ensure some desired ...
Alf P. Steinbach
Mar 3, 2010 at 3:10 pm
Mar 8, 2010 at 2:03 pm -
recently i wrote a blog article on The NoSQL Movement at http://xahlee.org/comp/nosql.html i'd like to post it somewhere public to solicit opinions, but in the 20 min or so, i couldn't find a proper ...
Xah Lee
Mar 3, 2010 at 5:36 pm
Mar 15, 2010 at 4:57 am -
Does anyone know of a good python to stand alone exe compiler? Thanks, -Robin
Robin
Mar 13, 2010 at 3:26 am
Mar 14, 2010 at 11:18 pm -
What's the word on using "classes as namespaces"? E.g. class _cfg(object): spam = 1 jambon = 3 huevos = 2 breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) Granted, this is not the "intended use" for ...
Kj
Mar 26, 2010 at 2:49 pm
Apr 12, 2010 at 10:31 am -
In a module, how do I create a conditional that will do something based on whether or not another module has been loaded? Suppose I have the following: import foo import foobar print foo() print ...
Pete Emerson
Mar 5, 2010 at 7:24 pm
Mar 16, 2010 at 11:55 pm -
Given some known data/crc pairs, how feasible is it to figure out the polynomial being used to generate the crc? In the case I'm looking at, it appears that the crc size may be at least 24 bits, so ...
Gregory Ewing
Mar 8, 2010 at 3:09 am
Mar 20, 2010 at 5:24 pm -
Want to switch __call__ behavior. Why doesn't this work? What is the correct way to write this? class X (object): def __init__(self, i): if i == 0: def __call__ (self): return 0 else: def __call_ ...
Neal Becker
Mar 10, 2010 at 1:12 pm
Mar 12, 2010 at 3:30 am -
True True Huh? True Huh?! Regards, mk
Mk
Mar 5, 2010 at 5:14 pm
Mar 8, 2010 at 8:53 am -
I need to create a class solely for the purpose of encapsulating a large number of disparate data items. At the moment I have no plans for any methods for this class other than the bazillion ...
Kj
Mar 20, 2010 at 10:15 pm
Mar 23, 2010 at 9:13 am -
Hello, Learning Python from the help file and online resources can leave one with many gaps. Can someone comment on the following: # --------- class X: T = 1 def f1(self, arg): print "f1, arg=%d" % ...
Lallous
Mar 15, 2010 at 4:39 pm
Mar 20, 2010 at 7:32 am -
I have been learning Python, and it is amazing .... I am using the tutorial that comes with the official distribution. At the end my goal is to develop applied mathematic in engineering applications ...
Jose Manuel
Mar 23, 2010 at 4:55 pm
May 10, 2010 at 11:35 am -
I must be having a brain cramp. Given a list of objects, how can I sort the list on one attribute in descending order, then sort within each group in ascending order on another attribute. For ...
Chris Curvey
Mar 31, 2010 at 5:08 pm
Apr 1, 2010 at 2:23 pm -
Hi, i have a serious problem and I am looking for a solution. I pass an instance of a class from a file to PyObject_Call. When something fails, I get a full traceback. If it succeeds, I get the ...
Moerchendiser2k3
Mar 16, 2010 at 11:52 am
Mar 20, 2010 at 9:44 am -
Hello, So I set out to write generic singleton, i.e. the one that would do a singleton with attributes of specified class. At first: class Singleton(object): instance = None def __new__(cls, ...
Mk
Mar 3, 2010 at 6:54 pm
Mar 6, 2010 at 1:45 am -
I've got a subclass of fractions.Fraction called Value; it's a mostly trivial class, except that it overrides __eq__ to mean 'nearly equal'. However, since Fraction's operations result in a Fraction, ...
JLundell
Mar 13, 2010 at 5:03 pm
Dec 23, 2010 at 11:21 pm -
To get the decimal representation of a binary number, I can just do this: int('11',2) # returns 3 But decimal binary numbers throw a ValueError: int('1.1',2) # should return 1.5, throws error ...
Aditya
Mar 30, 2010 at 3:13 pm
Mar 30, 2010 at 9:05 pm -
Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, J?germonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Sorry for the off topic question, but what ...
Luis M. González
Mar 26, 2010 at 1:14 pm
Mar 29, 2010 at 11:59 pm -
Hi everybody! The "Where is CPAN for Python?" question keeps popping up, with answers ranging from "There is no CPAN for Python" and "We already have CPAN for Python" (confusing). I'm wondering - is ...
Olof Bjarnason
Mar 3, 2010 at 12:45 pm
Mar 4, 2010 at 6:06 pm -
Hi all, I have a question about decorators. I would like to use them for argument checking, and pre/post conditions. However, I don't want the additional overhead when I run in non-debug mode. I ...
LX
Mar 30, 2010 at 12:54 am
Apr 1, 2010 at 5:01 pm -
I've posted "Usability, the Soul of Python: An Introduction to the Python Programming Language Through the Eyes of Usability", at: http://JonathansCorner.com/python/ The basic suggestion is that much ...
Jonathan Hayward
Mar 29, 2010 at 7:41 pm
Mar 31, 2010 at 7:21 pm -
Have you people embraced Python 3.x or still with 2.5 or 2.6? I personally want to switch over but not too sure how many people are using 3.x as opposed to 2 so I want to keep my programs compatible ...
Harishankar
Mar 26, 2010 at 1:23 pm
Mar 29, 2010 at 12:58 pm -
Hi Vinay Sajip, I'm very glad discoverd your logging module ;-) (That's what I would have liked 25 years ago when I was working as a technical software developper!) Now I'm writing just some personal ...
Hellmut Weber
Mar 10, 2010 at 9:23 pm
Mar 31, 2010 at 7:52 am -
I am loading a dictionary from a text file and constructing a trie data structure in memory. However, it takes longer than I'm happy with - about 12 seconds on my computer. I profiled it, came up ...
Weeble
Mar 19, 2010 at 12:13 am
Mar 24, 2010 at 1:39 am -
So I am trying to write a bit of code and a simple numerical subtraction y_diff = y_diff-H is giving me the error Syntaxerror: Non-ASCII character '\x96' in file on line 70, but no encoding declared. ...
Joel Pendery
Mar 15, 2010 at 5:37 pm
Mar 22, 2010 at 2:26 pm -
"EURO GIRLS" "MISS EUROPE" "MISS FRENCH" "FRENCH" "PRETTY GIRLS" "SEXY FRENCH GIRLS" on www.sexyandpretty-girls.blogspot.com "SEXY RUSSIAN GIRLS" "SEXY GREEK GIRLS" "SEXY DUTCH GIRLS" "SEXY UK GIRLS" ...
Naeem
Mar 20, 2010 at 4:18 am
Mar 21, 2010 at 10:06 pm -
Is there any tutorial how to write a bindings for a exe ( dos) program? I would like to run it from a Python directly ( using import command and a particular function from the binding) not using ...
Johny
Mar 16, 2010 at 4:20 pm
Mar 19, 2010 at 7:01 am -
Hello, I am still learning python, thus developnig small scripts. Some of them consist only of the main module. While testing them (debugging) I sometimes want to stop the script at a certain point, ...
Vsoler
Mar 14, 2010 at 11:34 am
Mar 15, 2010 at 6:50 pm -
I ran a comparison that timed 1e6 file seeks. The tests were run with Python 2.6.4 and Microsoft Visual C 6.0 on Windows XP with an Intel 3GHz single processor with hyperthreading. Results: C : 0.812 ...
Metalone
Mar 9, 2010 at 11:56 pm
Mar 13, 2010 at 4:13 am -
Hi, I have two related lists: x = [1 ,2, 8, 5, 0, 7] y = ['a', 'a', 'b', 'c', 'c', 'c' ] what I need is a list representing the mean value of 'a', 'b' and 'c' while maintaining the number of items ...
Dimitri pater - serpia
Mar 8, 2010 at 10:34 pm
Mar 9, 2010 at 6:24 pm -
15
Queue peek?
Hi all I'm looking for a queue that I can use with multiprocessing, which has a peek method. I've seen some discussion about queue.peek but don't see anything in the docs about it. Does python have a ...Veloz
Mar 2, 2010 at 4:29 pm
Mar 9, 2010 at 1:47 am -
I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is ...
Pete Emerson
Mar 4, 2010 at 6:39 pm
Mar 5, 2010 at 6:50 pm -
Dear friends . I have two simple questions: It is possible to encrypt with md5 python source code? What option do I have to protect my python source code? Thank you .
Catalinfest
Mar 28, 2010 at 6:59 am
Apr 5, 2010 at 2:58 am -
On 2010-02-28 06:31:56 -0800, ssteinerX at gmail.com said: But somehow the question is not in the FAQ, though the answer is. See: ...
R Fritz
Mar 2, 2010 at 9:14 pm
Mar 30, 2010 at 5:19 pm -
I know that unicode is the way to go in Python 3.1, but it is getting in my way right now in my Unix scripts. How do I write a chr(253) to a file? #nntst2.py import sys,codecs mychar=chr(253) ...
Nn
Mar 23, 2010 at 5:33 pm
Mar 24, 2010 at 7:35 pm -
What does a slice as [N::-1] ? It looks that in the first it reverses the slice and then it shows only N items, right? Could you add an example to get the same result without use `::` to see it more ...
Joan Miller
Mar 5, 2010 at 6:01 pm
Mar 6, 2010 at 3:05 am -
Subject line pretty much says it all: is there a book like "Effective Java" for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, ...
Kj
Mar 10, 2010 at 3:19 pm
Mar 12, 2010 at 8:36 pm -
__dict__. I know I can just do: FOO = 'bar' at the module top-level, but I've got 'FOO' as a string and what I really need to do is __dict__['Foo'] = 'bar' When I do that, I get "NameError: name ...
Roy Smith
Mar 2, 2010 at 4:27 am
Mar 4, 2010 at 10:43 am -
Folks: Every couple of years I run into a problem where some Python code that worked well at small scales starts burning up my CPU at larger scales, and the underlying issue turns out to be the idiom ...
Zooko O'Whielacronx
Mar 12, 2010 at 7:11 am
Mar 30, 2010 at 1:46 pm -
Hi, I'm trying to do something like : if m = re.match(r'define\s+(\S+)\s*{$', line): thing = m.group(1) elif m = re.match(r'include\s+(\S+)$', line): thing = m.group(1) else thing = "" But in fact ...
Samb
Mar 16, 2010 at 7:45 am
Mar 16, 2010 at 3:40 pm -
Say that "m" is a tuple of 2-tuples m=(('as',3), ('ab',5), (None, 1), ('as',None), ('as',6)) and I need to build a "d" dict where each key has an associated list whose first element is the count, and ...
Vsoler
Mar 13, 2010 at 3:05 pm
Mar 14, 2010 at 1:28 pm -
Hours of Googling has not helped me resolve a seemingly simple question - Given a string s, how can I tell whether it's ascii (and thus 1 byte per character) or UTF-8 (and two bytes per character)? ...
C. Benson Manica
Mar 9, 2010 at 4:54 pm
Mar 9, 2010 at 10:15 pm -
Hi all, I'd like to ask about the possibility of negative "counts" in collections.Counter (using Python 3.1); I believe, my usecase is rather trivial, basically I have the word frequencies of two ...
Vlastimil Brom
Mar 7, 2010 at 9:04 pm
Mar 8, 2010 at 10:44 pm -
I've been wrestling with dicts. I hope at the very least what I discovered helps someone else out, but I'm interested in hearing from more learned python users. I found out that adding a two ...
Pete Emerson
Mar 6, 2010 at 1:22 am
Mar 8, 2010 at 1:14 am -
hi, i've to convert from Pascal this code: iterations=0; count=0; REPEAT; iterations = iterations+1; ... IF (genericCondition) THEN count=count+1; ... CASE count OF: 1: m = 1 2: m = 10 3: m = 100 ...
Tracubik
Mar 2, 2010 at 5:46 pm
Mar 4, 2010 at 10:58 am -
I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of ...
Victor Eijkhout
Mar 30, 2010 at 11:25 pm
Apr 1, 2010 at 2:59 pm -
Hello I've just realized recently that sys.exc_info() didn't return a full traceback for exception concerned : it actually only contains the frame below the point of exception catching. That's very ...
Pakal
Mar 17, 2010 at 10:42 am
Mar 25, 2010 at 5:41 pm -
I have a list of items L, and a test function is_invalid that checks the validity of each item. To check that there are no invalid items in L, I could check the value of any(map(is_invalid, L)). But ...
Kj
Mar 22, 2010 at 2:45 pm
Mar 23, 2010 at 10:55 am
Group Overview
group | python-list |
categories | python |
discussions | 508 |
posts | 2,733 |
users | 601 |
website | python.org |
601 users for March 2010
Archives
- September 2015 (591)
- August 2015 (1,058)
- July 2015 (1,440)
- June 2015 (1,704)
- May 2015 (1,841)
- April 2015 (1,231)
- March 2015 (1,717)
- February 2015 (1,612)
- January 2015 (889)
- December 2014 (1,283)
- November 2014 (1,600)
- October 2014 (1,447)
- September 2014 (1,031)
- August 2014 (1,867)
- July 2014 (1,618)
- June 2014 (1,357)
- May 2014 (1,431)
- April 2014 (1,285)
- March 2014 (2,093)
- February 2014 (1,999)
- January 2014 (2,089)
- December 2013 (2,060)
- November 2013 (2,507)
- October 2013 (1,932)
- September 2013 (1,634)
- August 2013 (1,532)
- July 2013 (2,062)
- June 2013 (2,795)
- May 2013 (1,935)
- April 2013 (1,980)
- March 2013 (1,953)
- February 2013 (1,789)
- January 2013 (1,924)
- December 2012 (1,569)
- November 2012 (1,579)
- October 2012 (1,961)
- September 2012 (2,311)
- August 2012 (1,808)
- July 2012 (1,577)
- June 2012 (1,199)
- May 2012 (1,197)
- April 2012 (1,416)
- March 2012 (1,373)
- February 2012 (1,442)
- January 2012 (1,446)
- December 2011 (1,895)
- November 2011 (1,291)
- October 2011 (1,188)
- September 2011 (1,587)
- August 2011 (2,069)
- July 2011 (2,140)
- June 2011 (1,908)
- May 2011 (2,475)
- April 2011 (2,098)
- March 2011 (1,761)
- February 2011 (1,746)
- January 2011 (2,123)
- December 2010 (1,671)
- November 2010 (2,355)
- October 2010 (2,518)
- September 2010 (2,187)
- August 2010 (3,098)
- July 2010 (2,579)
- June 2010 (3,238)
- May 2010 (2,458)
- April 2010 (2,356)
- March 2010 (2,759)
- February 2010 (3,486)
- January 2010 (3,294)
- December 2009 (2,899)
- November 2009 (3,396)
- October 2009 (3,346)
- September 2009 (3,087)
- August 2009 (3,903)
- July 2009 (3,761)
- June 2009 (3,321)
- May 2009 (3,370)
- April 2009 (4,272)
- March 2009 (4,228)
- February 2009 (3,965)
- January 2009 (4,732)
- December 2008 (4,335)
- November 2008 (3,799)
- October 2008 (4,123)
- September 2008 (3,816)
- August 2008 (4,056)
- July 2008 (4,238)
- June 2008 (3,737)
- May 2008 (4,976)
- April 2008 (4,708)
- March 2008 (4,122)
- February 2008 (4,132)
- January 2008 (4,145)
- December 2007 (3,686)
- November 2007 (3,419)
- October 2007 (4,234)
- September 2007 (4,332)
- August 2007 (4,189)
- July 2007 (3,771)
- June 2007 (4,142)
- May 2007 (5,018)
- April 2007 (4,912)
- March 2007 (4,365)
- February 2007 (3,951)
- January 2007 (3,864)
- December 2006 (4,449)
- November 2006 (4,229)
- October 2006 (5,506)
- September 2006 (5,244)
- August 2006 (4,829)
- July 2006 (4,720)
- June 2006 (5,054)
- May 2006 (5,302)
- April 2006 (4,845)
- March 2006 (5,729)
- February 2006 (4,839)
- January 2006 (5,249)
- December 2005 (5,011)
- November 2005 (5,677)
- October 2005 (5,387)
- September 2005 (4,458)
- August 2005 (4,428)
- July 2005 (4,472)
- June 2005 (4,562)
- May 2005 (4,269)
- April 2005 (5,019)
- March 2005 (5,070)
- February 2005 (5,159)
- January 2005 (5,194)
- December 2004 (5,211)
- November 2004 (4,048)
- October 2004 (5,191)
- September 2004 (5,534)
- August 2004 (6,168)
- July 2004 (4,217)
- June 2004 (4,202)
- May 2004 (3,890)
- April 2004 (4,285)
- March 2004 (5,077)
- February 2004 (4,213)
- January 2004 (3,988)
- December 2003 (3,818)
- November 2003 (4,940)
- October 2003 (6,297)
- September 2003 (4,299)
- August 2003 (5,654)
- July 2003 (4,912)
- June 2003 (4,933)
- May 2003 (4,938)
- April 2003 (5,017)
- March 2003 (5,031)
- February 2003 (7,701)
- January 2003 (6,229)
- December 2002 (4,102)
- November 2002 (4,346)
- October 2002 (3,307)
- September 2002 (4,206)
- August 2002 (4,919)
- July 2002 (4,826)
- June 2002 (4,215)
- May 2002 (5,295)
- April 2002 (5,967)
- March 2002 (5,323)
- February 2002 (5,245)
- January 2002 (5,617)
- December 2001 (4,443)
- November 2001 (4,565)
- October 2001 (3,669)
- September 2001 (3,719)
- August 2001 (5,208)
- July 2001 (6,528)
- June 2001 (4,905)
- May 2001 (5,492)
- April 2001 (4,713)
- March 2001 (4,478)
- February 2001 (3,871)
- January 2001 (4,187)
- December 2000 (3,099)
- November 2000 (2,336)
- October 2000 (3,820)
- September 2000 (3,933)
- August 2000 (4,253)
- July 2000 (4,199)
- June 2000 (4,089)
- May 2000 (4,269)
- April 2000 (3,217)
- March 2000 (3,719)
- February 2000 (4,000)
- January 2000 (2,682)
- December 1999 (2,283)
- November 1999 (1,896)
- October 1999 (2,048)
- September 1999 (2,001)
- August 1999 (2,151)
- July 1999 (2,351)
- June 1999 (2,386)
- May 1999 (2,201)
- April 1999 (1,706)
- March 1999 (6)
- February 1999 (1)