Search Discussions

545 discussions - 3,332 posts

  • I'm coaching a group of biologists on basic Python scripting. One of my charges mentioned that he had come across the advice never to use loops beginning with "while True". Of course, that's one way ...
    Oct 10, 2009 at 8:15 pm
    Oct 21, 2009 at 9:52 pm
  • I am very much new to Python, and one of my first projects is a simple data-based website. I am starting with Python 3.1 (I can hear many of you shouting "don't - start with 2.6"), but as far as I ...
    Alan Harris-ReidAlan Harris-Reid
    Oct 25, 2009 at 11:52 pm
    Nov 8, 2009 at 2:08 am
  • [Cross-posted comp.programming and comp.lang.python] Hi. I may finally have found the perfect language for a practically oriented introductory book on programming, namely Python. C++ was way too ...
    Alf P. SteinbachAlf P. Steinbach
    Oct 28, 2009 at 6:52 am
    Nov 3, 2009 at 12:38 am
  • Traceback (most recent call last): File "<stdin ", line 1, in <module TypeError: sum() can't sum strings [use ''.join(seq) instead] Of course it is not a good way to join strings, but it should work, ...
    Alan G IsaacAlan G Isaac
    Oct 16, 2009 at 3:39 pm
    Oct 27, 2009 at 9:12 pm
  • I would assume that putting scripts into a folder with the aim of re- using pieces of them would be called a package, but since this is an "anti-pattern" according to Guido, apparently I'm ...
    Oct 3, 2009 at 1:14 am
    Oct 20, 2009 at 12:45 am
  • This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. RESOLVED: Using ORMs leads lazy programmers to make bad database designs. It's better to carefully ...
    Aaron WattersAaron Watters
    Oct 5, 2009 at 2:25 pm
    Jan 6, 2010 at 2:41 am
  • All I wanted to do is split a binary number into two lists, a list of blocks of consecutive ones and another list of blocks of consecutive zeroes. But no, you can't do that. ['', '', '1', '', '', '', ...
    Oct 16, 2009 at 1:18 am
    Oct 26, 2009 at 10:52 pm
  • Thanks to everyone who helped with my query on reversing integers. I have one more simple problem I'm having trouble solving. I want to check a number for palindromic behavior (reading the same ...
    Benjamin MiddaughBenjamin Middaugh
    Oct 18, 2009 at 7:13 pm
    Oct 22, 2009 at 5:05 pm
  • I have the following files, which are in the directory 'test'. The parent directory of 'test' is in $PYTHONPATH. I have 'from A import A' and 'from B import B' in '__init__.py', because I want to use ...
    Peng YuPeng Yu
    Oct 31, 2009 at 4:07 pm
    Nov 1, 2009 at 11:02 pm
  • If I understand things correctly, the set class uses hash() universally to calculate hash values for its elements. Is there a standard way to have set use a different function? Say I've got a ...
    Austin BinghamAustin Bingham
    Oct 15, 2009 at 11:24 am
    Oct 17, 2009 at 12:55 am
  • Hi, py.folk! I need your help to understand how http://www.spoj.pl/problems/INOUTEST/ can be passed in Python. I see two guys who managed to get accepted: http://www.spoj.pl/ranks/INOUTEST/lang=PYTH ...
    Oct 3, 2009 at 1:54 pm
    Oct 10, 2009 at 11:51 am
  • Challenge: to come up with a sorting task that cannot be achieved by passing to the sort method (or sorted function) suitable values for its key and reverse parameters, but instead *require* giving a ...
    Oct 1, 2009 at 5:08 pm
    Oct 7, 2009 at 5:15 pm
  • hello, * this is not a troll * which kind of help you have with your favorite editor ? personnally, I find emacs very nice, in the current state of my knowledge, when I need to reindent the code. you ...
    Oct 7, 2009 at 4:07 pm
    Oct 27, 2009 at 10:37 am
  • hello, I want to handle datetime vars in a general way, so I use the default time-format, so I can use the standard cinversion procedures. Time format is the time difference since 1-1-1970. So how do ...
    Stef MientkiStef Mientki
    Oct 5, 2009 at 11:54 pm
    Oct 12, 2009 at 6:34 pm
  • Hi; I have the following archaic code that worked just fine for another site. It is called with the following url: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 #!/usr/local/bin/python import ...
    Victor SuberviVictor Subervi
    Oct 6, 2009 at 7:19 pm
    Oct 8, 2009 at 6:06 pm
  • Hello everyone, print hosts hosts = [ s.strip() for s in hosts if s is not '' and s is not None and s is not '\n' ] print hosts ['\n', ' \n', '\n'] ['', ...
    Oct 29, 2009 at 3:12 pm
    Nov 3, 2009 at 3:04 pm
  • I'm looking for code that will calculate the running median of a sequence, efficiently. (I'm trying to subtract the running median from a signal to correct for gradual drift). My naive attempt ...
    Janto DreijerJanto Dreijer
    Oct 13, 2009 at 3:22 pm
    Oct 26, 2009 at 3:28 pm
  • A trivial one, this is the first time I have to deal with Unicode. I am trying to parse a string s='''48? 13' 16.80" N'''. I know the charset is "iso-8859-1". To get the degrees I did [u'48\xc2\xb0', ...
    George TrojanGeorge Trojan
    Oct 19, 2009 at 7:07 pm
    Oct 28, 2009 at 4:41 pm
  • Hi I have been searching through the vast array of python frameworks http://wiki.python.org/moin/WebFrameworks and its quite astounding the choice available. I am looking at using a web framework for ...
    Oct 18, 2009 at 11:01 pm
    Oct 24, 2009 at 8:16 am
  • All, I've got a strange one.. I'm trying to create a class object inside another class object by using the code template below (note.. this isn't the exact code.. I'm having difficulty reproducing it ...
    Oct 4, 2009 at 3:32 am
    Oct 6, 2009 at 11:42 pm
  • Dear all, I have a question concerning the output of the id() function. In particular since is should: "" Return the identity of an object. This is guaranteed to be unique among simultaneously ...
    Raffaele ponziniRaffaele ponzini
    Oct 14, 2009 at 10:46 am
    Oct 17, 2009 at 10:29 pm
  • This is not a request for help but a request for comments: Consider the following code and note that 1)The initializer uses the dictionary style of arguments 2)The check loop executes before all of ...
    Tim JohnsonTim Johnson
    Oct 30, 2009 at 2:16 am
    Nov 4, 2009 at 11:50 pm
  • hello... if anyone know..please help me ! i really want to know...i was searched in google lot of time. but can't found clear soultion. and also because of my lack of python knowledge. i want to use ...
    Oct 25, 2009 at 12:35 am
    Oct 26, 2009 at 6:57 am
  • Is there a way to print to an unbuffered output (like stdout)? I've seen that something like sys.stdout.write("hello") works but it also prints the number of characters!
    Oct 16, 2009 at 9:04 pm
    Oct 19, 2009 at 3:24 pm
  • Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source ...
    Oct 21, 2009 at 5:28 pm
    Nov 6, 2009 at 5:33 pm
  • hello I'm trying to convert 2 c++ functions in python they come from wpkg client https://wpkg.svn.sourceforge.net/svnroot/wpkg/wpkg-client/Sources/Components/XmlSettings.cpp they are CString ...
    Oct 17, 2009 at 4:34 pm
    Oct 21, 2009 at 3:50 pm
  • Hi All; I'm new to Python and moving from C, which is probably a big source of my confusion. I'm struggling with something right now though and I hope you all can help. I have a global configuration ...
    Oct 29, 2009 at 12:50 am
    Nov 5, 2009 at 2:45 pm
  • Hello! I use sqlite3 module for my sqlite database. I am trying to substitute table name in sql query. That's ok That's ok too Traceback (most recent call last): File "<string ", line 1, in <fragment ...
    Oct 30, 2009 at 12:10 pm
    Nov 3, 2009 at 1:19 pm
  • Can I use a pyd compiled on linux in a Windows distribution? Or must I recompile it for windows users?
    Oct 29, 2009 at 4:44 pm
    Nov 1, 2009 at 12:43 am
  • Hi all this has been bugging me for a long time and I do not seem to be able to understand what to do. I always have problems when dealing input text that contains umlauts. Consider the following: In ...
    Arian KuschkiArian Kuschki
    Oct 17, 2009 at 1:54 pm
    Oct 18, 2009 at 1:41 am
  • I wonder the reason for ELIF. it's not aligned with IF, make code ugly IMHO OR maybe better? if foo == bar: ... or foo == baz: ... or foo == bra: ... else: ...
    Oct 11, 2009 at 6:47 am
    Oct 12, 2009 at 12:16 pm
  • Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. ...
    Alf P. SteinbachAlf P. Steinbach
    Oct 28, 2009 at 10:18 pm
    Oct 29, 2009 at 3:46 pm
  • I'm running into an ugly bug, which, IMHO, is really a bug in the design of Python's module import scheme. Consider the following directory structure: ham `-- spam.py ...with the following very ...
    Oct 31, 2009 at 3:12 pm
    Nov 4, 2009 at 10:28 am
  • How can one check that a Python script is lexically correct? As my Python apps grow in complexity and execution, I'm finding it more often the situation in which a program dies after a lengthy (i.e. ...
    Oct 29, 2009 at 8:48 pm
    Nov 3, 2009 at 12:53 pm
  • I need to write a Python script that will call some command line programs (using os.system). I will have many such calls, but I want to control when the calls are made. I won't know in advance how ...
    Oct 15, 2009 at 7:42 pm
    Oct 23, 2009 at 1:17 pm
  • Hi I thought that file objects were supposed to be garbage-collected and automatically closed once they go out of scope, at least that's what I've been told by more merited Python programmers. I'm ...
    Arve KnudsenArve Knudsen
    Oct 19, 2009 at 11:45 am
    Oct 20, 2009 at 7:21 pm
  • hello, By writing the following unicode string (I hope it can be send on this mailing list) B?cken to a file fh.write ( line ) I get the following error: UnicodeEncodeError: 'ascii' codec can't ...
    Stef MientkiStef Mientki
    Oct 15, 2009 at 11:43 pm
    Oct 19, 2009 at 2:02 pm
  • Hi; Okay, here's the code: #! /usr/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login def pic(): user, passwd, db, ...
    Victor SuberviVictor Subervi
    Oct 16, 2009 at 7:23 pm
    Oct 18, 2009 at 10:27 pm
  • Hi I know that in python, we can do the same with regexps or *.split()*, but thats longer and less practical method than *scanf()*. I also found that ( http://code.activestate.com/recipes/502213/ ), ...
    Oct 3, 2009 at 10:06 pm
    Oct 13, 2009 at 5:58 pm
  • Hi group, I am trying to use a weak reference to a bound method: class MyClass(object): def myfunc(self): pass o = MyClass() print o.myfunc import weakref r = weakref.ref(o.myfunc) print r() This is ...
    Ole StreicherOle Streicher
    Oct 2, 2009 at 8:54 am
    Oct 3, 2009 at 9:37 pm
  • Hello, I've been studying the official tutorial, so far it's been fun, but today I ran into a problem with the write(). So, I open the file pw and write "hello" and read: f = open("pw", "r+") ...
    Oct 31, 2009 at 1:10 pm
    Nov 1, 2009 at 11:29 am
  • I was just working with a generator for a tree that I wanted to skip the first result (root node.) And it occurs to me, why do we need to do: import sys from itertools import islice my_iter = ...
    Oct 16, 2009 at 1:29 am
    Oct 27, 2009 at 7:58 am
  • Hi! I'm looking at the 'threading' module and see that other than the 'thread' module it doesn't have a simple function to start a new thread. Instead, you first have to instantiate a threading ...
    Ulrich EckhardtUlrich Eckhardt
    Oct 8, 2009 at 7:17 am
    Oct 10, 2009 at 11:19 pm
  • I'm trying to write a few methods that normalize Windows file paths. I've gotten it to work in 99% of the cases, but it seems like my code still chokes on '\x'. I've pasted my code below, can someone ...
    Dan GuidoDan Guido
    Oct 21, 2009 at 6:13 pm
    Oct 22, 2009 at 2:35 am
  • Hi, The following code does not run because range() does not accept a big number. Is there a way to make the code work. I'm wondering if there is a way to write a for-loop in python similar to that ...
    Peng YuPeng Yu
    Oct 13, 2009 at 9:17 pm
    Oct 16, 2009 at 5:42 am
  • Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly ...
    Oct 6, 2009 at 5:56 pm
    Oct 8, 2009 at 8:20 pm
  • Hi, I am trying to run a python script and got this error. Googling the problem suggested that I install the 'py25-hashlib'. the following does not work for me 'sudo port install py25-hashlib' , ...
    Oct 29, 2009 at 3:13 pm
    Oct 30, 2009 at 8:37 am
  • Greetings, all! I would like to add unicode support to my dbf project. The dbf header has a one-byte field to hold the encoding of the file. For example, \x03 is code-page 437 MS-DOS. My google-fu is ...
    Ethan FurmanEthan Furman
    Oct 22, 2009 at 8:28 pm
    Oct 28, 2009 at 4:59 am
  • I have been following this group for quite some time and I figured (after searching enough on google --and on this group-- and not finding anything useful) I could pose this question here. Can anyone ...
    Oct 9, 2009 at 11:50 pm
    Oct 17, 2009 at 7:29 am
  • I currently have a function that uses a list internally but then returns the list items as separate return values as follows: if len(result)==1: return result[0] if len(result)==2: return result[0], ...
    Dr. Phillip M. FeldmanDr. Phillip M. Feldman
    Oct 8, 2009 at 4:41 pm
    Oct 9, 2009 at 6:36 am
Group Navigation
period‹ prev | Oct 2009 | next ›
Group Overview
grouppython-list @

655 users for October 2009

Gabriel Genellina: 139 posts Diez B. Roggisch: 72 posts Dave Angel: 68 posts Carl Banks: 61 posts Ethan Furman: 57 posts Chris Rebert: 53 posts Steven D'Aprano: 50 posts MRAB: 47 posts Victor Subervi: 47 posts Bruno Desthuilliers: 46 posts Aahz: 42 posts Robert Kern: 42 posts Terry Reedy: 40 posts Alf P. Steinbach: 38 posts Peng Yu: 37 posts Stephen Hansen: 37 posts Mensanator: 35 posts Steven D'Aprano: 34 posts Simon Forman: 33 posts TerryP: 33 posts
show more