FAQ

Search Discussions

455 discussions - 2,893 posts

  • In most cases, `list(generator)` works as expected. Thus, `list(<generator expression )` is generally equivalent to `[<generator expression ]`. Here's a minimal case where this equivalence breaks, ...
    Tom MachinskiTom Machinski
    Dec 13, 2009 at 12:15 am
    Jan 2, 2010 at 8:27 pm
  • List, Python does not have switch statement. Any other option does similar work? Thanks for help. --henry
    Hong zhangHong zhang
    Dec 9, 2009 at 1:53 am
    Dec 24, 2009 at 4:06 pm
  • I was trying to reimplement some of the c++ library of generic algorithms in c++ in python, but I was finding that this is problematic to do this in a generic way because there isn't any equivalent ...
    Brendan MillerBrendan Miller
    Dec 16, 2009 at 3:39 am
    Dec 20, 2009 at 6:18 am
  • I've produced a 4 page document that provides a very concise summary of Python 2<- 3 differences plus the most commonly used new Python 3 features. It is aimed at existing Python 2 programmers who ...
    Mark SummerfieldMark Summerfield
    Dec 1, 2009 at 2:03 pm
    Dec 10, 2009 at 6:03 pm
  • Dear friends, I plan to port a Monte Carlo engine from Matlab to Python. However, when I timed randn(N1, N2) in Python and compared it with Matlab's randn, Matlab came out as a clear winner with a ...
    Carl Johan RehnCarl Johan Rehn
    Dec 19, 2009 at 10:05 am
    Dec 23, 2009 at 2:15 am
  • Hi; I'm using python 2.4.3 which apparently requires that I import Set: from sets import Set I've done this. In another script I successfully manipulated MySQL sets by so doing. Here's the code ...
    Victor SuberviVictor Subervi
    Dec 28, 2009 at 4:17 pm
    Dec 30, 2009 at 9:21 am
  • According to one web source, this program: import datetime bree = datetime.datetime(1981, 6, 16, 4, 35, 25) nat = datetime.datetime(1973, 1, 18, 3, 45, 50) difference = bree - nat print "There were", ...
    W. eWatsonW. eWatson
    Dec 28, 2009 at 4:54 am
    Jan 14, 2010 at 6:08 pm
  • Does anyone have any recommendations on which version of the MSVC?90.DLL's need to be distributed with a Python 2.6.4 PY2EXE (0.6.9) based executable? (I assume I need just a matching pair of ...
    PythonPython
    Dec 17, 2009 at 4:08 pm
    Jan 4, 2010 at 2:45 am
  • I recently read that many libraries, including Numpy have not been ported to Python 3. When do you think that Python 3 will be fully deployed? Should I stick, so far, to Python 2.6? Regards Vicente ...
    VsolerVsoler
    Dec 6, 2009 at 6:21 pm
    Dec 21, 2009 at 5:18 am
  • I am having a problem when substituting a raw string. When I do the following: re.sub('abc', r'a\nb\nc', '123abcdefg') I get """ 123a b cdefg """ what I want is r'123a\nb\ncdefg' How do I get what I ...
    Ed KeithEd Keith
    Dec 16, 2009 at 2:09 pm
    Jan 2, 2010 at 6:56 am
  • Hello everybody, I need to read a text file byte after byte. Eache byte is sent to a function that scramble it and I need to write the result to binary file. I've got some questions - 1) How do I ...
    Daved170Daved170
    Dec 12, 2009 at 7:16 am
    Dec 16, 2009 at 9:54 pm
  • To whom it may concern, I am the author of "Honeywell Avoids Documentation Costs with Python and other Open Standards!" I was laid off by Honeywell several months after I had made my presentation in ...
    Andrew Jonathan FineAndrew Jonathan Fine
    Dec 28, 2009 at 7:32 am
    Jan 15, 2010 at 11:59 am
  • I'd like to do calculations with floats and at some point equality of two number will be checked. What is the best way to make sure that equality of floats will be detected, where I assume that ...
    Anton81Anton81
    Dec 5, 2009 at 3:37 pm
    Dec 11, 2009 at 8:37 am
  • FYI: http://twitter.com/gvanrossum Python is a truly awesome programming language. Not only is Guido a genius language designer, but he is also a great project leader. What an accomplishment. ...
    Steve HowellSteve Howell
    Dec 31, 2009 at 10:06 pm
    Jan 19, 2010 at 11:42 am
  • Hi, I happened upon this youtube link: http://www.youtube.com/watch?vWnWm984wdY It fairly blew my socks off. In it a fellow by the name of David Roberts demos a zui written in Python. Aside from the ...
    DonnDonn
    Dec 11, 2009 at 4:41 am
    Dec 17, 2009 at 6:43 pm
  • Just curious if anybody prefers web2py over django, and visa versa. I know it's been discussed on a flame war level a lot. I am looking for a more intellectual reasoning behind using one or the other.
    AppRe GodeckAppRe Godeck
    Dec 19, 2009 at 6:42 am
    Mar 3, 2011 at 10:50 am
  • Hi All, I am new to Python and the list so I hope I am posting this correctly... I am working on a way to have text automatically formated in a Tkiniter Text widget and would like some input on my ...
    Dave McCormickDave McCormick
    Dec 30, 2009 at 5:58 pm
    Jan 8, 2010 at 10:21 pm
  • I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how ...
    Joel DavisJoel Davis
    Dec 28, 2009 at 11:54 pm
    Dec 31, 2009 at 5:48 am
  • Hi; What type does python consider a MySQL Set?? if isinstance(colValue[0], (str, int, long, float, long, complex, unicode, list, buffer, xrange, tuple)): pass else: print 'XXX' And the following ...
    Victor SuberviVictor Subervi
    Dec 12, 2009 at 9:34 pm
    Dec 13, 2009 at 9:35 pm
  • Hi; I'll trouble-shoot bare excepts as I work on new code. I'll trouble-shoot the others that don't (seem to) cause problems later. Here's a new one: for optionsStore, storeOptions in ...
    Victor SuberviVictor Subervi
    Dec 30, 2009 at 10:09 am
    Jan 22, 2010 at 9:52 pm
  • I finally finished (draft), I believe!, chapter 2... Chapter 1 gets the reader up & running, i.e. it's "Hello, world!", basic tool usage, without discussing anything about programming really. One ...
    Alf P. SteinbachAlf P. Steinbach
    Dec 18, 2009 at 6:00 pm
    Dec 20, 2009 at 1:50 pm
  • Hi; I'm checking the best way to validate attributes inside a class. Of course I can use property to check it, but I really want to do it inside the __init__: class A: def __init__(self, foo, bar): ...
    Denis DoriaDenis Doria
    Dec 21, 2009 at 5:41 pm
    Jan 11, 2010 at 1:52 pm
  • Greetings. I'm 35 yrs old self learner and who do daily PHP coding for food more than a decade. After ten years of PHP coding I'm getting bored and give try for learning new things. After 3 days of ...
    Sancar SaranSancar Saran
    Dec 11, 2009 at 10:26 am
    Dec 30, 2009 at 12:12 am
  • Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. Following example comes from projecteuler.net problem 166. The Numeric community would ...
    DaveDave
    Dec 14, 2009 at 6:03 pm
    Dec 19, 2009 at 3:53 pm
  • How can I insert non-duplicate data in a list? I mean, is there a particular option in the creation of a list that permit me not to use something like: def append_unique(l, val): if val not in l: ...
    MattiaMattia
    Dec 13, 2009 at 4:37 pm
    Dec 15, 2009 at 10:17 pm
  • 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 ...
    Tim GoldenTim Golden
    Dec 26, 2009 at 8:06 pm
    Jan 15, 2010 at 4:38 pm
  • Ok, so I got a MacBook Air. Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed. So I install Xcode, download macports and download gmpy-1.11rc1. Following the instructions in ...
    MensanatorMensanator
    Dec 25, 2009 at 2:11 am
    Dec 27, 2009 at 7:43 pm
  • Dear Group, I am a researcher in India's one of the premier institutes.(Indian Institute of Science,Bangalore). I have done one MA in Linguistics, did a PhD in Natural Language Processing and doing a ...
    Joy99Joy99
    Dec 1, 2009 at 7:06 pm
    Dec 11, 2009 at 8:34 am
  • Hi; I have these lines: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = ...
    Victor SuberviVictor Subervi
    Dec 29, 2009 at 7:42 pm
    Jan 1, 2010 at 7:48 am
  • When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=====\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast ...
    W. eWatsonW. eWatson
    Dec 21, 2009 at 2:16 am
    Dec 31, 2009 at 4:55 am
  • Hi Guys, When python reads in a file, can lines be referred to via an index? Example: for line in file: if line[0] == '0': a.write(line) This works, however, I am unsure if line[0] refers only to the ...
    SeafoidSeafoid
    Dec 18, 2009 at 3:42 pm
    Dec 23, 2009 at 12:13 am
  • Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions that are only useful in interactive mode. Kind regards, Roald
    Roald de VriesRoald de Vries
    Dec 29, 2009 at 3:09 pm
    Dec 31, 2009 at 3:06 am
  • Is there an os independent way to check if a python app is running? Goal: I have a server program based on cherrypy that I only want to have running once. If a system administrator accidentally ...
    PythonPython
    Dec 14, 2009 at 7:14 pm
    Dec 28, 2009 at 5:23 am
  • Format: PDF <url: http://preview.tinyurl.com/ProgrammingBookP3 The new stuff, section 2.7, is about programs as simulations and handling data, focusing on modeling things. It includes some Python GUI ...
    Alf P. SteinbachAlf P. Steinbach
    Dec 9, 2009 at 3:38 pm
    Dec 18, 2009 at 2:25 am
  • Dear Group, I am encountering a small question. Suppose, I write the following code, input_string=raw_input("PRINT A STRING:") string_to_word=input_string.split() len_word_list=len(string_to_word) if ...
    Joy99Joy99
    Dec 27, 2009 at 2:44 pm
    Jan 13, 2010 at 8:37 pm
  • I have a problem and I am trying to find a solution to it that is both efficient and elegant. I have a list call it 'l': l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr'] Notice that ...
    Ed KeithEd Keith
    Dec 11, 2009 at 8:49 pm
    Dec 29, 2009 at 1:50 am
  • Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() ...
    Victor SuberviVictor Subervi
    Dec 15, 2009 at 6:05 pm
    Dec 21, 2009 at 10:16 am
  • Hi All Not an expert in Python, so sorry if this sounds like a silly question. I went through other few threads in the mailing list but they are not helping me much. I have run into a problem related ...
    LordofcodeLordofcode
    Dec 23, 2009 at 9:41 am
    Jan 13, 2010 at 2:27 am
  • Is this guaranteed to work in Python 3.x? ... 222 Cheers, - Alf
    Alf P. SteinbachAlf P. Steinbach
    Dec 4, 2009 at 10:03 am
    Dec 7, 2009 at 7:36 am
  • I'm trying to store analytic data in a folder called Analysis. If the user doesn't have the folder, I make one for him, and then write a txt file into it. In this case a histogram of values, x and ...
    W. eWatsonW. eWatson
    Dec 5, 2009 at 10:57 am
    Dec 6, 2009 at 10:12 pm
  • Hi; I have spent 2-3 hours trying to track this bug. Here's the code snippet: form = cgi.FieldStorage() fn = getattr(options, 'products') ourOptionsNames = [] optionsNames, doNotUse = fn('names') for ...
    Victor SuberviVictor Subervi
    Dec 2, 2009 at 8:18 pm
    Dec 4, 2009 at 10:05 pm
  • Hi there, I have a rather lengthy program that troubles me for quite some time. After some debugging, I arrived at the following assertion error: for e in edges.keys(): assert edges.has_key(e) Oops!? ...
    JohnJohn
    Dec 22, 2009 at 4:33 pm
    Dec 23, 2009 at 9:01 am
  • If I create a module xyz.py with a docstring """xyz does everything you could possibly want.""" at the top, the command ?xyz issued at the IPython prompt does not display this docstring. What am I ...
    Dr. Phillip M. FeldmanDr. Phillip M. Feldman
    Dec 6, 2009 at 7:04 am
    Dec 18, 2009 at 7:04 pm
  • Hi; I've googled, found where cookies are supposed to be, the folders and files don't exist. I've opened my latest and greatest FF and seen cookies in there, but when I search for the name of the ...
    Victor SuberviVictor Subervi
    Dec 15, 2009 at 3:30 pm
    Dec 17, 2009 at 11:40 am
  • I am trying to write/run a python script which imports from another script which is located in my /usr/lib64/python2.6/site-packages/ dir, but getting the following error. $ python ./mytest.py ...
    JoeJoe
    Dec 8, 2009 at 3:08 pm
    Dec 11, 2009 at 12:54 pm
  • Hello,. everyone. I've a string that looks something like ---- lksjdfls <div id ='amazon_345343' kdjff lsdfs </div sdjfls <div id = "amazon_35343433" sdfsd</div <div id='amazon_8898' welcome</div ...
    OltmansOltmans
    Dec 21, 2009 at 11:38 am
    Jan 7, 2010 at 10:38 pm
  • I routinely use large numbers in my Collatz Conjecture work. Really large. As in a quarter million bits. You wouldn't think that the processor would make all that much difference. But using the ...
    MensanatorMensanator
    Dec 28, 2009 at 6:50 am
    Dec 30, 2009 at 11:02 pm
  • I'm looking for a small, simple, fast, Python based web server for a simple, client side application we're building. We don't want to distrubute and support a "real" web server like Apache or Tomcat ...
    PythonPython
    Dec 9, 2009 at 7:34 pm
    Dec 27, 2009 at 2:08 pm
  • Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColNames[i]) if len(trueVal) 1: trueVal = string.join(trueVal, ',') values.append(trueVal) elif ...
    Victor SuberviVictor Subervi
    Dec 24, 2009 at 8:05 pm
    Dec 26, 2009 at 1:37 pm
  • Hi; I have this code: i = 0 nameNos = [] nos = [] for option in ourOptions(): nameNos.append('optionNo%d' % i) nos.append(i) i += 1 The idea is that through every iteration of option, I can create a ...
    Victor SuberviVictor Subervi
    Dec 18, 2009 at 6:55 pm
    Dec 20, 2009 at 9:19 pm
Group Navigation
period‹ prev | Dec 2009 | next ›
Group Overview
grouppython-list @
categoriespython
discussions455
posts2,893
users578
websitepython.org

578 users for December 2009

Victor Subervi: 127 posts Lie Ryan: 108 posts Steven D'Aprano: 89 posts MRAB: 69 posts Gabriel Genellina: 57 posts R0g: 53 posts Terry Reedy: 52 posts Dave Angel: 51 posts Diez B. Roggisch: 42 posts Geremy condra: 37 posts Stephen Hansen: 37 posts Alf P. Steinbach: 36 posts Steve Holden: 36 posts W. eWatson: 36 posts Carsten Haese: 35 posts Peter Otten: 34 posts Chris Rebert: 33 posts Mensanator: 32 posts Bruno Desthuilliers: 30 posts Jean-Michel Pichavant: 28 posts
show more
Archives