FAQ

Search Discussions

305 discussions - 2,471 posts

  • Python uses a data model of "name binding" and "call by object" (also known as "call by sharing"). I trust I don't need to define my terms, but just in case: http://effbot.org/zone/call-by-object.htm ...
    Steven D'ApranoSteven D'Aprano
    May 1, 2011 at 8:45 am
    May 20, 2011 at 9:17 pm
  • Hi, If I want to check if a list is empty, which is the more pythonic way? li = [] (1) if len(li) == 0: ... or (2) if not li: ... Thanks, Laszlo
    Jabba LaciJabba Laci
    May 6, 2011 at 6:36 am
    May 22, 2011 at 8:41 pm
  • might be of interest. ?English Idiom in Unix: Directory Recursively? http://xahlee.org/comp/idiom_directory_recursively.html ------------------------------------------ English Idiom in Unix: ...
    Xah LeeXah Lee
    May 17, 2011 at 10:26 pm
    May 30, 2011 at 11:17 pm
  • I thought this essay on why one startup chose Python was interesting. http://www.quora.com/Why-did-Quora-choose-Python-for-its-development PHP was out of the question. Facebook is stuck on that for ...
    BeliavskyBeliavsky
    May 20, 2011 at 4:39 pm
    May 28, 2011 at 12:37 pm
  • Here's a curiosity. float("nan") can occur multiple times in a set or as a key in a dict: {nan, nan} except that sometimes it can't: {nan}
    MRABMRAB
    May 28, 2011 at 11:41 pm
    Jun 7, 2011 at 1:00 am
  • Hello all: I have been considering writing a couple of programs in Python, but I don't want to distribute the code along with them. So I'm curious of a couple things. First, does there exist a ...
    Littlefield, TylerLittlefield, Tyler
    May 16, 2011 at 2:04 am
    May 21, 2011 at 4:26 am
  • Here's my background: I'm a Windows based Visual FoxPro developer, and I want to start programming in Python. I'll be sticking to Windows (XP & 7) and my immediate needs are to manage & display large ...
    Lew SchwartzLew Schwartz
    May 24, 2011 at 10:17 pm
    May 31, 2011 at 6:42 pm
  • [10, 10, 10, 10, 10, 10, 10, 10, 10, 10] <=== not good ( that was a big surprise! . . . ) ( let's try it another way . . . ) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (aaah, that's better . . . ) (hmmm, let's ...
    Harrismh777Harrismh777
    May 31, 2011 at 6:48 am
    Jun 5, 2011 at 1:10 pm
  • I just spent a considerable amount of time and effort debugging a program. The made-up code snippet below illustrates the problem I encountered: def main(): a = ['a list','with','three elements'] ...
    Henry OldersHenry Olders
    May 29, 2011 at 8:30 am
    Jun 1, 2011 at 1:14 am
  • In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5. Actually, ...
    Ethan FurmanEthan Furman
    May 17, 2011 at 6:47 pm
    May 22, 2011 at 12:24 am
  • I just posted a tutorial and how-to guide for making effective use of super(). One of the reviewers, David Beazley, said, "Wow, that's really great! I see this becoming the definitive post on the ...
    Raymond HettingerRaymond Hettinger
    May 26, 2011 at 4:31 pm
    May 30, 2011 at 9:18 am
  • hi folks, I am puzzled by unicode generally, and within the context of python specifically. For one thing, what do we mean that unicode is used in python 3.x by default. (I know what default means, I ...
    Harrismh777Harrismh777
    May 11, 2011 at 9:37 pm
    May 14, 2011 at 11:47 pm
  • (It occurred to me that I should use a specific subject for this discussion.) I'm less inclined to use comments on each line, or selected lines, but rather use block comments instead. They require ...
    Richard ParkerRichard Parker
    May 26, 2011 at 6:50 pm
    May 31, 2011 at 2:47 pm
  • </troll I still like Python after using it for over a decade, but there are things I don't like. What are your favourite up-and-coming languages of the moment? Here's my wishlist (not really in any ...
    John J LeeJohn J Lee
    May 21, 2011 at 3:49 pm
    May 30, 2011 at 10:37 am
  • I noticed some discussion of recursion..... the trick is to find a formula where the arguments are divided, not decremented. I've had a "divide-and-conquer" recursion for the Fibonacci numbers for a ...
    RJBRJB
    May 17, 2011 at 3:50 pm
    May 24, 2011 at 11:44 pm
  • I think it is time to give some visibility to some of the instructive and very cool recipes in ActiveState's python cookbook. My vote for the coolest recipe of all time is: ...
    Raymond HettingerRaymond Hettinger
    May 2, 2011 at 5:33 pm
    May 9, 2011 at 9:10 pm
  • It doesn't look like a question of local or global. fnc2 is passed a container object and replaces item 1 in that container. You see the results when fnc2 prints the object it knows as `c`, and you ...
    MelMel
    May 29, 2011 at 11:59 am
    May 31, 2011 at 5:33 pm
  • In playing with lists of lists, I found the following: (In 3.1, but the same happens also in 2.7) list = [1,2,3] list.append ( [4,5,6] ) x = list x - [1,2,3,[4,5,6]] as expected. But the shortcut ...
    Uncle BenUncle Ben
    May 26, 2011 at 4:46 am
    May 27, 2011 at 6:56 pm
  • Hello I've stumble to find a solution to get a list from a set <code ['a', 'b', 'c', 'f'] {'a', 'c', 'b', 'f'} ['a', 'b', 'c', 'f'] </code I repute the comprehension list too expensive, is there ...
    TheSaintTheSaint
    May 14, 2011 at 9:02 am
    May 17, 2011 at 1:07 am
  • Hi, Which is the preferred way of string formatting? (1) "the %s is %s" % ('sky', 'blue') (2) "the {0} is {1}".format('sky', 'blue') (3) "the {} is {}".format('sky', 'blue') As I know (1) is old ...
    Jabba LaciJabba Laci
    May 6, 2011 at 7:18 am
    May 10, 2011 at 5:20 pm
  • after a long delay the pyjamas project - http://pyjs.org - has begun the 0.8 series of releases, beginning with alpha1: https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/ pyjamas is a suite ...
    Luke Kenneth Casson LeightonLuke Kenneth Casson Leighton
    May 4, 2011 at 2:06 pm
    May 19, 2011 at 10:40 pm
  • Hello, I have been using a script on several boxes that have been around for a while, and everything works just fine. I am finding though, that on some new OS installs the script fails with: ...
    James WrightJames Wright
    May 9, 2011 at 6:10 pm
    May 10, 2011 at 12:00 am
  • Hi python lovers out there, I am searching for a library to parse data from a graph in an image file something like http://pytseries.sourceforge.net/_images/yahoo.png Any suggestions, hints, links? ...
    Bastian BallmannBastian Ballmann
    May 13, 2011 at 10:19 am
    May 21, 2011 at 2:06 pm
  • Hello everyone, I've already read quite a bit about the reasons for the GIL in CPython, i.e to summarize, that a more-fine graine locking, allowing real concurrency in multithreaded applications, ...
    Pascal ChambonPascal Chambon
    May 27, 2011 at 9:21 pm
    Jun 7, 2011 at 8:23 pm
  • I've just done an update to my system here to Ubuntu 11.04. Mostly no problems ... but I have an important (to me) python/TK program that's stopped working. Well, it works ... mostly. The python ...
    BvdpBvdp
    May 20, 2011 at 6:03 pm
    May 22, 2011 at 9:17 pm
  • I'm a bit new to programming outside of shell scripts (and I'm no expert there), so I was wondering what is considered the best way to handle errors when writing a module. Do I just let exceptions go ...
    Andrew BergAndrew Berg
    May 11, 2011 at 5:29 pm
    May 13, 2011 at 12:56 am
  • I have an RE that should work (it even works in Kodos [1], but not in my code), but it keeps failing to match characters after a newline. I'm writing a little program that scans the webpage of an ...
    Andrew BergAndrew Berg
    May 29, 2011 at 11:45 am
    May 29, 2011 at 7:06 pm
  • Hi, I'm trying to turn off my monitor, pause and then turn it on again. I'm doing this in python 2.6 and windows xp. Here is my script so far (that doesn't work): import time import win32gui import ...
    Astan CheeAstan Chee
    May 14, 2011 at 6:08 am
    May 20, 2011 at 10:37 am
  • Hi, I am currently trying to integrate Python support into my toolchain build (including GDB of course). It is a sysrooted binutils+GCC+GDB+mingw-w64 toolchain. I currently have the basic setup ...
    Ruben Van BoxemRuben Van Boxem
    May 12, 2011 at 4:14 pm
    May 17, 2011 at 8:52 pm
  • Good morning all, Wondering if you could please help me with the following query:- I have just started learning Python last weekend after a colleague of mine showed me how to dramatically cut the ...
    JJ
    May 16, 2011 at 8:19 am
    May 17, 2011 at 1:58 pm
  • where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc. I'm not sure where to look at the logging configuration to figure out the log ...
    FeiFei
    May 17, 2011 at 8:55 pm
    May 19, 2011 at 9:27 am
  • Hi All, I'm new bie to thread programming and I need some assistance in understanding few concepts ... I have a very simple program which runs a thread and prints a string. import threading class ...
    Vijay swaminathanVijay swaminathan
    May 11, 2011 at 6:57 am
    May 12, 2011 at 10:46 am
  • Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns ...
    Raymond HettingerRaymond Hettinger
    May 4, 2011 at 6:17 pm
    May 5, 2011 at 2:33 pm
  • Hi, I am trying to build an application using sqlalchemy. in principle i have the structure #============================================== from sqlalchemy import * from sqlalchemy.orm import * ...
    Wolfgang MeinersWolfgang Meiners
    May 30, 2011 at 9:40 pm
    Jun 1, 2011 at 6:38 pm
  • Hi, I am trying to connect SIGINT (^c) to a custom interrupt handler like this (no threading, just straightforward): if __name__ == "__main__": quit = False def interrupt_handler(signal, frame): ...
    Christoph ScheingraberChristoph Scheingraber
    May 15, 2011 at 9:44 am
    May 20, 2011 at 7:38 am
  • hi all, suppose I have Python dict myDict and I know it's not empty. I have to get any (key, value) pair from the dict (no matter which one) and perform some operation. In Python 2 I used mere key, ...
    DmitreyDmitrey
    May 6, 2011 at 7:40 pm
    May 10, 2011 at 5:25 pm
  • Hi there I am having trouble to install PIL 1.1.7 on CentOS. I read and followed the instructions from http://effbot.org/zone/pil-imaging-not-installed.htm However, I still get the "The _imaging C ...
    Nico GrubertNico Grubert
    May 5, 2011 at 1:35 pm
    May 9, 2011 at 6:16 pm
  • Hello. I'm looking into subprocess.Popen docs. I've launch the program with its arguments and that's smooth. I'm expecting to read the output by *comunicate()* at every line that prgram may blow ...
    TheSaintTheSaint
    May 28, 2011 at 4:01 pm
    May 31, 2011 at 11:33 am
  • hello, must of us will not use single bits these days, but at first sight, this looks funny : 6 2 2 6 cheers, Stef
    Stef MientkiStef Mientki
    May 22, 2011 at 7:23 pm
    May 28, 2011 at 2:04 pm
  • I've tried this in 2.5 - 3.2: -- 'this is a test'.startswith('this') True -- 'this is a test'.startswith('this', None, None) Traceback (most recent call last): File "<stdin ", line 1, in <module ...
    Ethan FurmanEthan Furman
    May 26, 2011 at 11:27 pm
    May 27, 2011 at 5:14 pm
  • I have a vague feeling this may have been discussed a long time ago, but I can't find the thread, so I'll bring it up again. I recently observed in the "checking if a list is empty" thread that a ...
    Roy SmithRoy Smith
    May 12, 2011 at 12:23 pm
    May 13, 2011 at 1:53 am
  • Just learning python. I can see that I can address an individual element of a list of lists by doing something like: row = list[5] element = row[3] But is there a way to directly address an entry in ...
    Chris Roy-SmithChris Roy-Smith
    May 9, 2011 at 3:15 am
    May 10, 2011 at 11:11 am
  • Hi! Here's the demonstrating code: # module foo.py var = 0 def set(): global var var = 1 Script using this module: import foo from foo import * print var, foo.var set() print var, foo.var Script ...
    Dun PealDun Peal
    May 3, 2011 at 4:31 pm
    May 4, 2011 at 8:44 am
  • Well, the subject says it almost all: I'd like to write a small Vector class for arbitrary-dimensional vectors. I am wondering what would be the most efficient and/or most elegant way to compute the ...
    GabrielGabriel
    May 30, 2011 at 9:11 am
    Jun 3, 2011 at 11:12 pm
  • The following function that returns the last line of a file works perfectly well under Python 2.71. but fails reliably under Python 3.2. Is this a bug, or am I doing something wrong? Any help would ...
    TkpmepTkpmep
    May 25, 2011 at 7:33 pm
    May 27, 2011 at 7:21 pm
  • s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? (which should equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff and am ...
    RVinceRVince
    May 24, 2011 at 3:36 pm
    May 25, 2011 at 11:05 am
  • hello, I'm using to launch a program by subprocess.getstatusoutput. I'd like to know whether I can get the program ID, in order to avoid another launch. For clarity sake, I'm calling aria2 (the ...
    TheSaintTheSaint
    May 19, 2011 at 4:02 pm
    May 24, 2011 at 1:36 pm
  • tal 65% python2.7 Python 2.7.1 (r271:86832, May 21 2011, 22:52:14) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. py ...
    James StroudJames Stroud
    May 22, 2011 at 6:02 am
    May 22, 2011 at 1:36 pm
  • I'm trying to understand why HMTLParser.feed() isn't returning the whole page. My test script is this: import urllib.request import html.parser class MyHTMLParser(html.parser.HTMLParser): def ...
    Andrew BergAndrew Berg
    May 15, 2011 at 8:45 pm
    May 19, 2011 at 10:18 pm
  • I want some code to take the items in a semi-colon-delimted string "list" and places each in a python list. I came up with below. In the name of learning how to do things properly, do you experts ...
    NoydbNoydb
    May 13, 2011 at 5:15 pm
    May 14, 2011 at 7:59 pm
Group Navigation
period‹ prev | May 2011 | next ›
Group Overview
grouppython-list @
categoriespython
discussions305
posts2,471
users450
websitepython.org

450 users for May 2011

Chris Angelico: 186 posts Steven D'Aprano: 131 posts Harrismh777: 95 posts Ian Kelly: 91 posts Terry Reedy: 89 posts Hans Georg Schaathun: 73 posts Rustom Mody: 61 posts Ethan Furman: 48 posts Gregory Ewing: 46 posts Ben Finney: 42 posts Chris Rebert: 39 posts Roy Smith: 33 posts Grant Edwards: 31 posts TheSaint: 31 posts Daniel Kluev: 30 posts MRAB: 30 posts Dan Stromberg: 26 posts Raymond Hettinger: 25 posts Tim Golden: 25 posts Andrew Berg: 24 posts
show more
Archives