Search Discussions

341 discussions - 2,059 posts

  • Hi all, When writing a long expresion, one usually would like to break it into multiple lines. Currently, you may use a '\' to do so, but it looks a little awkward (more like machine-oriented thing). ...
    Yingjie LanYingjie Lan
    Aug 10, 2011 at 4:42 am
    Sep 4, 2011 at 6:08 pm
  • With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users accidentally re-assigning built-in names. For example, they'll innocently call some variable, ...
    Gerrat RickertGerrat Rickert
    Aug 15, 2011 at 9:52 pm
    Aug 31, 2011 at 9:57 pm
  • Follow these simply rules to become an accepted member of the Python community. ------------------------------------------------------------ 1. Bash rantingrick and Xah Lee every chance you get. 2. ...
    Aug 14, 2011 at 5:57 am
    Aug 17, 2011 at 10:48 pm
  • i have heard that function invocation in python is expensive, but make lots of functions are a good design habit in many other languages, so is there any principle when writing python function? for ...
    Smith jackSmith jack
    Aug 23, 2011 at 11:59 am
    Aug 29, 2011 at 10:17 pm
  • I really like this list as part of my learning tools but the amount of spam that I've been getting from it is CRAZY. Doesn't anything get scanned before it sent to the list? Jason ..? <((((?
    Jason StaudenmayerJason Staudenmayer
    Aug 18, 2011 at 12:58 pm
    Aug 20, 2011 at 5:48 pm
  • Hi all, I am completely new to Python, but I'm confronted with a problem I can't solve. This is my question: I'm running a PC with XP Pro32, which acts as a file server/print server/FTP server and ...
    Fokke NautaFokke Nauta
    Aug 30, 2011 at 8:00 pm
    Sep 8, 2011 at 2:10 pm
  • Hi Folks, I was arguing with a guy who was sure that incrementing a variable i with "i += 1" is faster than "i = i + 1". I couldn't tell if he was right or wrong so I did a little benchmark with the ...
    Aug 21, 2011 at 4:52 pm
    Aug 22, 2011 at 5:22 pm
  • hi list, what is the best way to check if a given list (lets call it l1) is totally contained in a second list (l2)? for example: l1 = [1,2], l2 = [1,2,3,4,5] - l1 is contained in l2 l1 = [1,2,2,], ...
    Aug 15, 2011 at 11:26 pm
    Aug 20, 2011 at 4:06 pm
  • Hi Python users, I have been using try...except statements in the situations where I can expect a certain type of errors might occur. But sometimes I don't exactly know the possible error types, or ...
    Yingjie LinYingjie Lin
    Aug 19, 2011 at 7:09 pm
    Sep 10, 2011 at 10:17 am
  • My program does not need a prompt, it just needs to wait for any key to be pressed before it continues. This is in Windows. char=0 while not char: char=msvcrt.getch() That doesn't delay anything ...
    John DoeJohn Doe
    Aug 8, 2011 at 12:04 am
    Aug 22, 2011 at 2:02 am
  • I?m new to Python, and I love it. The philosophy of the language (and of the community as a whole) is beautiful to me. But one of the things that bugs me is the requirement that all class methods ...
    T. GoodchildT. Goodchild
    Aug 31, 2011 at 2:35 pm
    Sep 7, 2011 at 11:01 pm
  • I have a Python (2.6.x) script on Linux that loops through many directories and does processing for each. That processing includes several "os.system" calls for each directory (some to other Python ...
    Russ P.Russ P.
    Aug 29, 2011 at 1:15 am
    Sep 11, 2011 at 5:08 am
  • Hi everyone! Longtime lurker, hardly an expert, but I've been using Python for various projects since 2007 and love it. I'm looking for either (A) suggestions on how to do a very common operation ...
    Aug 3, 2011 at 1:45 am
    Aug 18, 2011 at 1:13 pm
  • Hello, I'd like to write a python (2.6/2.7) script which connects to database, fetches hundreds of thousands of rows, concat them (basically: create XML) and then put the result into another table. ...
    Przemyslaw BakPrzemyslaw Bak
    Aug 10, 2011 at 11:17 am
    Aug 16, 2011 at 9:38 am
  • As I understand it, Python exclusively late-binds names; when you define a function, nothing is ever pre-bound. This allows a huge amount of flexibility (letting you "reach into" someone else's ...
    Chris AngelicoChris Angelico
    Aug 2, 2011 at 4:55 pm
    Aug 4, 2011 at 7:49 pm
  • if a list L is composed with tuple consists of two elements, that is L = [(a1, b1), (a2, b2) ... (an, bn)] is there any simple way to divide this list into two separate lists , such that L1 = [a1, ...
    Smith jackSmith jack
    Aug 6, 2011 at 5:07 pm
    Aug 7, 2011 at 5:11 pm
  • Hi, i am sorry if this doesn't quite match the subject of the list. If someone takes offense please point me to where this question should go. Anyway, i have a problem using regular expressions. I ...
    Matt FunkMatt Funk
    Aug 18, 2011 at 7:49 pm
    Aug 22, 2011 at 1:59 pm
  • I'm writing a Scheme interpreter and I need to be able to create and return a Python function from a string. This is a port of another Scheme interpreter I wrote in Scheme. What I'm trying to do ...
    Jack TradesJack Trades
    Aug 29, 2011 at 2:41 pm
    Aug 31, 2011 at 2:25 pm
  • I am trying to hardlink all files in a directory structure using os.link. This works fine for files, but the directory also contains sub- directories (which themselves contain files and ...
    Aug 2, 2011 at 9:32 am
    Aug 8, 2011 at 7:07 am
  • In what order are the addresses returned by socket.gethostbyname_ex()? We know that gethostbyname() is indeterministic but hope that gethostbyname_ex() has a specified order. Best regards, Tomas
    Tomas LidénTomas Lidén
    Aug 22, 2011 at 6:37 am
    Aug 22, 2011 at 10:46 pm
  • I'm looking for good ways to ensure that attributes are only writable such that they retain the characteristics the class requires. My particular case is a class attribute which is initialised as a ...
    John O'HaganJohn O'Hagan
    Aug 7, 2011 at 3:35 pm
    Aug 11, 2011 at 8:15 am
  • See All details on http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html . See All details on http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html . ...
    Sajjad AhmadSajjad Ahmad
    Aug 19, 2011 at 6:38 pm
    Aug 20, 2011 at 2:59 pm
  • Is it possible to put a doc string on a class attribute? Something like this class Test (object): '''classx''' fred = 10 '''attribute''' print Test.__doc__ print Test.fred.__doc__ This code produces ...
    Aug 8, 2011 at 12:37 pm
    Aug 11, 2011 at 12:59 am
  • Twice in a couple of weeks, I have locked up my PC by running a Python 2.5 script that tries to create a list that is insanely too big. In the first case, I (stupidly) did something like: mylist = ...
    Steven D'ApranoSteven D'Aprano
    Aug 31, 2011 at 12:33 pm
    Sep 15, 2011 at 7:27 pm
  • Dear All, I have some complicated loops of the following form for c in configurations: # loop 1 while nothing_bad_happened: # loop 2 while step1_did_not_work: # loop 3 for substeps in step1 # loop 4a ...
    Aug 31, 2011 at 3:51 pm
    Sep 2, 2011 at 1:04 am
  • (This may be a shortened double post) I have a development version of a library in c:\dev\XmlDB\xmldb After testing the setup script I also have c:\python27\lib\site-packages\xmldb Now I'm continuing ...
    Josh EnglishJosh English
    Aug 27, 2011 at 4:56 pm
    Aug 28, 2011 at 5:20 am
  • Hello, I am looking for the Python Windows Extensions to see if they can be installed on a Mac.THanks.
    Aug 19, 2011 at 8:02 pm
    Aug 23, 2011 at 1:40 pm
  • How would you convert a list of strings into a list of variables using the same name of the strings? So, ["red", "one", "maple"] into [red, one, maple] Thanks for any help!
    Aug 18, 2011 at 2:57 pm
    Aug 19, 2011 at 2:32 pm
  • Hi all, Apologies I'm sure this has been asked many times, but I'm trying to figure out the most efficient way to do a complex sort on very large files. I've read the recipe at [1] and understand ...
    Aug 1, 2011 at 3:33 pm
    Aug 9, 2011 at 10:20 pm
  • Hey all, I have been trying to get my head around how to do something, but i am missing how to pull it off. I am reading a packet from a radio over a serial port. i have " two bytes containing the ...
    Aug 4, 2011 at 6:26 pm
    Aug 5, 2011 at 4:01 pm
  • Hi, i've created a twisted server application and i want that the server send me a message when someone stops or kills the process. I want to override reactor.stop(), but do this way send me message ...
    Andrea Di MarioAndrea Di Mario
    Aug 1, 2011 at 9:56 am
    Aug 4, 2011 at 3:47 am
  • # Get Fibonacci Value # Fibonacci(N) = Fibonacci(N-1) + Fibonacci(N-2) # # n = 900 is OK # n = 1000 is ERROR , Why # # What Wrong? # cache = [] def fibo( n ): try: if cache[n] != -1: return cache[n] ...
    Aug 1, 2011 at 9:11 am
    Aug 2, 2011 at 2:40 pm
  • I am trying to write an algorithms library in Python. Most of the functions will accept functions as parameters. For instance, there is a function called any: def any(source, predicate): for item in ...
    Travis ParksTravis Parks
    Aug 28, 2011 at 9:20 pm
    Aug 29, 2011 at 11:36 pm
  • Is there an equivelent for the AWK RS in Python? as in RS='\n\n' will seperate a file at two blank line intervals -- maus . . ... NO CARRIER
    Aug 26, 2011 at 6:39 pm
    Aug 28, 2011 at 10:03 am
  • Folks, What might be a good replacement for the shelve module, but one that can handle a few gigs of data. I'm doing some calculations on daily stock prices and the result is a nested list like: ...
    Forafo SanForafo San
    Aug 19, 2011 at 3:31 pm
    Aug 21, 2011 at 12:54 am
  • Hi Python users, I have two lists: li1 = ['a', 'b'] li2 = ['1', '2'] and I wish to obtain a list like this li3 = ['a1', 'a2', 'b1', 'b2'] Is there a handy and efficient function to do this, ...
    Yingjie LinYingjie Lin
    Aug 17, 2011 at 8:22 pm
    Aug 18, 2011 at 9:51 pm
  • Hey c.l.p., I wrote a little python script that finds the file that a python module came from. Does anyone see anything wrong with this script? #!/usr/bin/python import sys if __name__ == '__main__': ...
    Billy MaysBilly Mays
    Aug 4, 2011 at 12:43 pm
    Aug 5, 2011 at 2:56 pm
  • The following is intended as a helpful small extension to the xrange() range() discussion brought up this past weekend by Billy Mays... With Python2 you basically have two ways to get a range of ...
    Aug 2, 2011 at 7:12 am
    Aug 4, 2011 at 9:56 am
  • I was a little disappointed the other day when I realized that closures were read-only. I like to use closures quite a bit. Can someone explain why this limitation exists? Secondly, since I can cheat ...
    Travis ParksTravis Parks
    Aug 31, 2011 at 4:45 pm
    Sep 5, 2011 at 2:23 pm
  • I'm looking for a good IDE -- easy to setup, easy to use -- for Python. Any suggestions? I use Eclipse for other projects and have no problem with using it for Python, except that I can't get PyDev ...
    Dave BolandDave Boland
    Aug 26, 2011 at 2:18 pm
    Aug 31, 2011 at 4:53 am
  • Hi all, I'm wondering what advice you have about formatting if statements with long conditions (I always format my code to <80 colums) Here's an example taken from something I'm writing at the moment ...
    Arnaud DelobelleArnaud Delobelle
    Aug 27, 2011 at 7:08 am
    Aug 27, 2011 at 9:25 pm
  • I have a class like this: class MySeq(): def __init__(self, *seq, c): self.__c = c self.__pc = sorted(set([i % __c for i in seq])) self.order = ([[self.__pc.index(i % __c), i // __c] for i in seq]) ...
    John O'HaganJohn O'Hagan
    Aug 22, 2011 at 5:04 am
    Aug 24, 2011 at 11:09 am
  • I suspect that learning how to integrate python with wordperfect will end up being much more work than learning wordperfect macros. Just my two cents. -- John Gordon A is for Amy, who fell down the ...
    John GordonJohn Gordon
    Aug 18, 2011 at 4:51 pm
    Aug 19, 2011 at 11:59 pm
  • Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a ...
    Aug 16, 2011 at 4:32 am
    Aug 19, 2011 at 5:21 am
  • Hello all Ive had what I think is a great idea for pure-python templates (I can almost hear the groans, bear with me...) For the impatient, proof of concept is at http://pastie.org/2379978 ...
    Paul WrayPaul Wray
    Aug 16, 2011 at 11:33 am
    Aug 17, 2011 at 1:10 am
  • *Please* forgive me for asking a Java question in a Python forum. My only excuse for this no-no is that a Python forum is more likely than a Java one to have among its readers those who have had to ...
    Aug 12, 2011 at 5:02 pm
    Aug 15, 2011 at 4:16 pm
  • 10


    I've noticed that python-list gets significantly more spam than the other lists I subscribe to. There's an example below. I'm wondering how the list is managed. Can anyone post, or only members? I've ...
    Aug 1, 2011 at 4:56 am
    Aug 3, 2011 at 12:52 am
  • Hello, I need a generator to create the cellname in a excell (using pyuno) document to assign value to the correct cell. The following code does this but do you have some optimizations on it, for ...
    Aug 2, 2011 at 11:45 am
    Aug 2, 2011 at 2:19 pm
  • I am writing a simple algorithms library that I want to work for both Python 2.7 and 3.x. I am writing some functions like distinct, which work with dictionaries under the hood. The problem I ran ...
    Travis ParksTravis Parks
    Aug 31, 2011 at 1:43 am
    Sep 2, 2011 at 8:29 pm
  • Hi, Say I have a very big string with a pattern like: akakksssk3dhdhdhdbddb3dkdkdkddk3dmdmdmd3dkdkdkdk3asnsn..... I want to split the sting into separate parts on the "3" and process each part ...
    Aug 12, 2011 at 2:03 am
    Aug 28, 2011 at 7:52 pm
Group Navigation
period‹ prev | Aug 2011 | next ›
Group Overview
grouppython-list @

442 users for August 2011

Chris Angelico: 158 posts Steven D'Aprano: 139 posts Seebs: 62 posts Terry Reedy: 60 posts Chris Rebert: 56 posts Peter Otten: 40 posts Roy Smith: 35 posts Ethan Furman: 34 posts Rantingrick: 34 posts Dan Stromberg: 33 posts Ben Finney: 31 posts Thomas Jollans: 29 posts John Gordon: 27 posts Gelonida N: 26 posts Philip Semanchuk: 25 posts MRAB: 24 posts Nobody: 21 posts Ian Kelly: 18 posts Smith jack: 18 posts Aspineux: 17 posts
show more