Re: indexed property? Can it be done?

2012-05-07 Thread Chris Rebert
], > parent, dirty, dlu] Why are you using a single opaque list instead of separate, meaningful attributes for each datum? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-07 Thread Chris Angelico
On Tue, May 8, 2012 at 1:54 PM, Steven D'Aprano wrote: > A.k.a. "we had to destroy the project in order to save it". > > http://technogems.blogspot.com.au/2012/05/pyjamas-hijacked.html Great summary, very handily peppered with links to appropriate posts. > Seriously, this was a remarkably ham-fi

Re: indexed property? Can it be done?

2012-05-07 Thread Chris Angelico
On Tue, May 8, 2012 at 2:18 PM, Charles Hixson wrote: > Not as clean as what I'm hoping for, but so far I haven't come up with any > way except functions that doesn't directly expose the data...and if I must > use that approach, then the class doesn't buy me anything for the overhead.) C++ and Ja

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Chris Angelico
On Tue, May 8, 2012 at 11:43 PM, Devin Jeanpierre wrote: > There is no "both projects". there was Luke's project, and then > Risinger stole it and it's Risinger's project. There is only that one > thing -- Luke has no """fork""" of his own codebase. Presumably Luke could fork his own project, tho

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Chris Angelico
On Wed, May 9, 2012 at 2:12 AM, Terry Reedy wrote: > On 5/8/2012 9:47 AM, Chris Angelico wrote: >> >> On Tue, May 8, 2012 at 11:43 PM, Devin Jeanpierre >>  wrote: >>> >>> There is no "both projects". there was Luke's project, and then >&

Re: How to get outer class name from an inner class?

2012-05-08 Thread Chris Rebert
;TooShort" or "TooLong".  But that's not > enough; I also need to know the outer class name, i.e. "Question.TooShort" > or "Question.TooLong".  How do I get the outer class name? Use __qualname__ and chop off the last dotted part (i.e. the innermost class' name, thus yielding its parent's name). PEP 3155 -- Qualified name for classes and functions: http://www.python.org/dev/peps/pep-3155/ Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: tweaking random number

2012-05-09 Thread Chris Angelico
On Wed, May 9, 2012 at 5:01 PM, Nikhil Verma wrote: > Hi All > > I want to generate a random number of 8 digits which involve 3 number and 5 > digits. (That's 3 digits and 5 letters) Pretty easy. Do you want to distinguish between uppercase and lowercase letters? Your current random_number funct

Re: tee-like behavior in Python

2012-05-09 Thread Chris Rebert
per escaping/quoting yourself, which defeats the entire purpose of bypassing the shell. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-09 Thread Chris Angelico
On Thu, May 10, 2012 at 10:12 AM, Mark Lawrence wrote: > Google was a right PITA but eventually I found this > http://www.legalcentre.co.uk/intellectual-property/guide/intellectual-property-and-employees/ >  It appears to contradict what you've said above, or have I misread it?  E.g > "Under the (

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-09 Thread Chris Angelico
On Thu, May 10, 2012 at 12:12 PM, Cameron Simpson wrote: > Patents _are_ IP. You may mean "copyright", also IP. Copyright goes to > the author, except that most companies require employees to assign it to > the company, including the Berne Convention "moral rights" (such as > attribution). Oh. Th

Mailing list assistance: manual unsubscribing of failed recipient?

2012-05-09 Thread Chris Angelico
a useless bounce message. Who is in charge of the list? Can [email protected] be unsubscribed manually? I've already forwarded a bounce to [email protected] but have heard nothing back. This isn't the list's fault, but maybe the listowner can deal with the spam coming back. Chris

Re: Mailing list assistance: manual unsubscribing of failed recipient?

2012-05-10 Thread Chris Angelico
On Thu, May 10, 2012 at 3:21 PM, Cameron Simpson wrote: > On 10May2012 13:13, Chris Angelico wrote: > | The azet.sk MTA is behaving badly wrt bounced messages from > | python-list. Instead of sending them to the list software (where > | they'll result in the subscriptio

Re: Dealing with the __str__ method in classes with lots of attributes

2012-05-10 Thread Chris Angelico
On Thu, May 10, 2012 at 11:33 PM, Andreas Tawn wrote: > Say I've got a class... > > class test(object): >    def __init__(self): >        self.foo = 1 >        self.bar = 2 >        self.baz = 3 > > I can say... > > def __str__(self): >   return "foo: {0}\nbar: {1}\nbaz: {2}".format(self.foo, self

Re: Mailing list assistance: manual unsubscribing of failed recipient?

2012-05-10 Thread Chris Angelico
On Fri, May 11, 2012 at 3:55 AM, Ned Deily wrote: > In article > , >  Chris Angelico wrote: >> Who is in charge of the list? Can [email protected] be unsubscribed manually? > > http://mail.python.org/mailman/listinfo/python-list Doh! I checked the top of that page ("W

Re: Dealing with the __str__ method in classes with lots of attributes

2012-05-10 Thread Chris Angelico
On Fri, May 11, 2012 at 1:15 AM, Andreas Tawn wrote: > I considered the triple quote string one, but it's not very PEP 8 compatible > in a real class because it includes the indentation in the formatted string. Yeah, that is an annoying side effect. My personal view is that code should be writte

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-10 Thread Chris Angelico
n to start on me! Your message is fine. Believe you me, I'd much rather read a message posted by a non-native English speaker, or a dyslexic person, or someone who has a clinical aversion to the letter 'q', than someone who's simply sloppy and doesn't care about their language at

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-10 Thread Chris Angelico
On Fri, May 11, 2012 at 10:21 AM, Adrian Hunt wrote: > lol, Cheers Chris. > > Just so you know, I care about what and how I write... I almost always run > my emails though a word-processor before sending. And, that has paid off for > me: thanks to MS Word, MS Works and Open Office

Re: Retrieving result from embedded execution

2012-05-10 Thread Chris Angelico
tly; otherwise, just manually replace the To address with the list address. As long as you use reply (rather than starting a fresh email), all posts will be correctly threaded both on the list and on the synchronized newsgroup (comp.lang.python). Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie naive question ... int() throws ValueError

2012-05-10 Thread Chris Angelico
aller. If it helps, think of all Python's exceptions as deriving from RuntimeException - anything can happen, worry only about what really worries you :) > Thanks for your help - and sorry again for such a naive question. It's a perfectly legitimate question, and you clearly did re

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Chris Angelico
On Sat, May 12, 2012 at 2:15 AM, Christian Heimes wrote: > Am 11.05.2012 17:51, schrieb Terry Reedy: >> If the domain of a function is truly all Python objects, it cannot raise >> an error. I believe id(x) is such an example. > > Even id() can raise an exception, for example MemoryError when you a

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Chris Angelico
On Sat, May 12, 2012 at 3:12 AM, Ian Kelly wrote: > I believe that a MemoryError instance is pre-allocated for just this > scenario. Ah, wise move. It's one of those largely-imponderables, like figuring out how to alert the sysadmin to a router failure. ChrisA -- http://mail.python.org/mailman/

Re: Retrieving result from embedded execution

2012-05-11 Thread Chris Angelico
On Sat, May 12, 2012 at 3:36 AM, Devin Jeanpierre wrote: > On Fri, May 11, 2012 at 12:45 AM, Stefan Behnel wrote: >> However, have you tried using a pipe for them instead of a real file? That >> would allow you to retrieve the output without needing to pass through a >> file in the file system. Y

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Chris Angelico
On Sat, May 12, 2012 at 5:34 AM, Devin Jeanpierre wrote: > On Fri, May 11, 2012 at 2:10 AM, Chris Angelico wrote: >> Unlike in Java, a function's list of things it can throw isn't part of >> its signature. Instead of trying to catch every possible exception, >> it

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Chris Angelico
On Sat, May 12, 2012 at 2:11 PM, Devin Jeanpierre wrote: > I'm not talking about unexpected exceptions. I'm saying, if I expect > invalid input for int, where should I go to find out how to deal with > said invalid input properly? How do I know that int raises ValueError > on failure, and not, for

Re: Minor gripe about module names

2012-05-12 Thread Chris Angelico
On Sat, May 12, 2012 at 8:41 PM, John O'Hagan wrote: > Not sure if this is only package-manager specific, but occasionally I come > across a module that sounds interesting, install it (in my case by apt-get), > and then can't find it, because the actual module has a different name from > what it s

Re: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Chris Angelico
On Sun, May 13, 2012 at 4:25 AM, Devin Jeanpierre wrote: > What having to try-it-and-see does is give me extra steps to know what > it does. Instead of only reading the documentation, now I have to both > read the documentation *and* try it out in the interactive interpreter > to see its behaviour

Re: How to call and execute C code in Python?

2012-05-13 Thread Chris Angelico
On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: > Can anyone tell me how to call and exectute C code in Python? Browse the documentation about Extending and Embedding Python, there's an extensive API. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call and execute C code in Python?

2012-05-13 Thread Chris Angelico
On Mon, May 14, 2012 at 3:23 AM, Mark Lawrence wrote: > On 13/05/2012 16:39, Chris Angelico wrote: >> >> On Sun, May 13, 2012 at 11:25 PM, David Shi  wrote: >>> >>> Can anyone tell me how to call and exectute C code in Python? >> >> >> Browse the

Re: How to call and execute C code in Python?

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 12:36 AM, Michael Torrie wrote: > On 05/13/2012 11:27 AM, Mark Lawrence wrote: >> Stefan, you appear to have a lot to do with Cython. It would be polite >> to mention this when replying. > > Why?  Do you think this is some sort of weird conflict of interest?  As > anyone wh

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Chris Angelico
> direct way of updating the dictionary. Agreed, you shouldn't normally need to exec to achieve what you want! But post your failing code and we'll be better able to help. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 5:09 AM, Steve Sawyer wrote: > Thanks - now, given my query that returns the table structure, this > works fine: > > table_dict = {} > table_specs = cursor.execute(query_string) > for row in table_specs: >        row_dict = {} >        row_dict['type'] = row.DataType >    

Re: Hashability questions

2012-05-14 Thread Chris Kaynor
On Sun, May 13, 2012 at 12:11 PM, Bob Grommes wrote: > Noob alert: writing my first Python class library. > > I have a straightforward class called Utility that lives in Utility.py. > > I'm trying to get a handle on best practices for fleshing out a library.  As > such, I've done the following fo

Re: Hashability questions

2012-05-14 Thread Chris Rebert
ation of _eq_() has somehow broken it.  Can anyone explain > what's going on? See the 3rd, 5th, and 4th paragraphs of: http://docs.python.org/dev/reference/datamodel.html#object.__hash__ Also, for future reference, it's advisable to state whether your question concerns Python 2.x or Python 3.x. Cheers, Chris -- http://chrisrebert.com -- http://mail.python.org/mailman/listinfo/python-list

Re: tiny script has memory leak

2012-05-14 Thread Chris Angelico
On Sat, May 12, 2012 at 7:29 AM, gry wrote: > f = open(sys.argv[1], 'w') What are you passing as the file name argument? Could that device be the cause of your memory usage spike? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Newby Python Programming Question

2012-05-14 Thread Chris Angelico
On Sat, May 12, 2012 at 8:25 AM, Coyote wrote: > I've been playing around with a couple of IDEs because I liked the one I used > with IDL and I wanted to use something similar for Python. The IDLDE was an > Eclipse variant, but I've tried installing Eclipse before for something else > and I'm p

Re: Hashability questions

2012-05-15 Thread Chris Angelico
On Tue, May 15, 2012 at 3:27 PM, Ian Kelly wrote: > Why?  I can't see any purpose in implementing __eq__ this way, but I > don't see how it's "broken" (assuming that __hash__ is actually > implemented somehow and doesn't just raise TypeError).  The > requirement is that if two objects compare equa

Re: How to call and execute C code in Python?

2012-05-15 Thread Chris Angelico
ve been given two or three separate lines of inquiry to follow up; have you looked into any of them? What did you find out? Also, this might be a handy reference: http://www.catb.org/~esr/faqs/smart-questions.html Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: ucs2 and ucs4 python

2012-05-16 Thread Chris Angelico
On Wed, May 16, 2012 at 6:36 PM, zayatzz wrote: > There is one problem though... > > when i start script with shebang like > #!/opt/bin/python > > and then try to run the script i get: > > /opt/bin/python^M: bad interpreter: No such file or directory You have a Windows end-of-line \r\n instead of

Re: How to embed python2 into python3?

2012-05-16 Thread Chris Rebert
ious approach to connect the two interpreters would be to use some form of IPC or RPC (e.g. XML-RPC, Unix domain sockets, etc.). There will be some degree of extra overhead involved no matter which route you go. Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: cPython, IronPython, Jython, and PyPy (Oh my!)

2012-05-16 Thread Chris Angelico
On Thu, May 17, 2012 at 9:01 AM, Ethan Furman wrote: > A record is an interesting critter -- it is given life either from the user > or from the disk-bound data;  its fields can then change, but those changes > are not reflected on disk until .write_record() is called;  I do this > because I am fr

Re: Newbie questions on import & cmd line run

2012-05-16 Thread Chris Rebert
n Windows. On Unix-like systems, one typically writes: #!/usr/bin/env python > # Filename: newbie00.py > > if __name__ == '__main__': Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: bash/shell to python

2012-05-17 Thread Chris Angelico
On Thu, May 17, 2012 at 12:16 PM, Rita wrote: > Hello, > > I currently build a lot of interfaces/wrappers to other applications using > bash/shell. One short coming for it is it lacks a good method to handle > arguments so I switched to python a while ago to use 'argparse' module. Its > a great co

Re: bash/shell to python

2012-05-17 Thread Chris Rebert
http://plumbum.readthedocs.org/en/latest/index.html There are also a few 3rd-party wrapper libraries for the `subprocess` module available to make using it more convenient (e.g. `envoy`). Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: SocketServer.BaseRequestHandler and __init__/super()

2012-05-17 Thread Chris Angelico
On Fri, May 18, 2012 at 10:32 AM, Tim Chase wrote: > Any thoughts on this? (other than "SocketServer should > have inherited from object which is a 2.x best-practice") Well, Python 3 dodges the issue by making all classes inherit from object. That might be a solution :) ChrisA -- http://mail.py

Re: How to hide console with Popen on Windows?

2012-05-18 Thread Chris Angelico
On Fri, May 18, 2012 at 6:22 PM, xliiv wrote: > Like the topic, more details in followed links.. > > > http://stackoverflow.com/questions/10637450/how-to-hide-console-with-popen-on-windows As you've already been advised, the way to avoid a console is to use pythonw.exe (which is a windowed Python

Re: serial module

2012-05-18 Thread Chris Rebert
tely opened** on object creation, when a port is given. It is not opened when port is None and a successive call to open() will be needed." So the port is indeed already open since you specified port='/dev/ttyUSB0'; thus, your .open() call is redundant. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: setdefault behaviour question

2012-05-19 Thread Chris Angelico
On Sun, May 20, 2012 at 5:44 AM, pete McEvoy wrote: > I am confused by some of the dictionary setdefault behaviour, I think > I am probably missing the obvious here. > > def someOtherFunct(): >    print "in someOtherFunct" >    return 42 > >    x = myDict.setdefault(1, someOtherFunct())   # <

Re: what do these mean

2012-05-20 Thread Chris Angelico
On Mon, May 21, 2012 at 2:52 AM, e-mail mgbg25171 wrote: > def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()] > def rJz  (cod,p) : return (p+1,cod[p])[ds.pop()==0] > > Specifically I'm stuck on what (code[p], followed by p+1 does inside the > brackets (cod[p],p+1) is a two-item tuple with [0] equal

Re: A question of style (finding item in list of tuples)

2012-05-21 Thread Chris Angelico
to keep the dictionary around? That would surely be the most logical thing to do. (With, of course, no quotes around self.level.) But out of your two options, I'd go with the loop. It's clear what you're doing and doesn't fiddle around with multiple translations. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Please use the Python Job Board for recruiting

2012-05-23 Thread Chris Angelico
On Wed, May 23, 2012 at 7:27 PM, Jean-Michel Pichavant wrote: > Sorry for asking but what do you mean by "doing latitude and longitude". I > tried dictionaries + google and didn't find how these geographical terms > apply to job boards. Since you said it's important... My understanding of that is

Re: Please use the Python Job Board for recruiting

2012-05-23 Thread Chris Withers
ad experience of how incompetent the majority of recruiters are, you'd realise that this is a pretty futile hope ;-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: append method

2012-05-23 Thread Chris Kaynor
On Wed, May 23, 2012 at 12:42 PM, Dave Angel wrote: > On 05/23/2012 03:13 PM, Emile van Sebille wrote: >> A design decision -- there's currently a mix of methods that return >> themselves and not.  Mostly is appears to me that mutables modify in >> place without returning self and immutables retur

Re: other languages API to python

2012-05-24 Thread Chris Angelico
irectly call a variety of C-provided functions. http://docs.python.org/library/ctypes.html http://docs.python.org/py3k/library/ctypes.html The resulting code isn't nearly as Pythonic as it could be if you write a proper wrapper, but you save the work of writing C code. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Id Verification

2012-05-24 Thread Chris Angelico
arset check, read the appropriate RFCs and figure out what really is and isn't legal. You will be surprised. (For instance, "foo@localhost" is a perfectly valid address, because "localhost" is a top-level domain.) Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Id Verification

2012-05-24 Thread Chris Angelico
On Thu, May 24, 2012 at 11:45 PM, Dennis Lee Bieber wrote: >        And maybe follow-up with a review of this monster: > http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html That is awesome. Epic. Eyeball-bleeding. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Id Verification

2012-05-24 Thread Chris Angelico
On Fri, May 25, 2012 at 9:03 AM, Cameron Simpson wrote: > On 24May2012 05:32, niks wrote: > | Hello everyone.. > | I am new to asp.net... > > Time to run away fast before you're commited then:-) > You're aware this is a _python_ list/group, yes? Committed to an asylum or to source control? Pyth

Re: Scoping Issues

2012-05-24 Thread Chris Rebert
through the Python Language Reference (http://docs.python.org/release/3.1.5/reference/index.html ) prior to asking further questions, as it may well answer them for you. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Id Verification

2012-05-24 Thread Chris Angelico
On Fri, May 25, 2012 at 11:35 AM, Paul Rubin wrote: > Steven D'Aprano writes: >> Why do you want to write buggy code that makes your users hate your >> program? ... >> The only way to validate an email address is to ACTUALLY SEND AN EMAIL TO >> IT. > > Of course spamming people will make them hat

Re: Namespace hack

2012-05-24 Thread Chris Angelico
On Fri, May 25, 2012 at 1:02 PM, Temia Eszteri wrote: > But then we've got "Simple is better than complex", and "Complex is > better than complicated". Of course if we decided to start iterating > through the zen of Python's verses and continually modifying the > example code to fit, it would get

Re: Email Id Verification

2012-05-25 Thread Chris Angelico
On Sat, May 26, 2012 at 2:25 AM, Peter Pearson wrote: > Amusingly, every time I log into Discovercard's web site, I > get a red-letter warning that my registered email address is > invalid.  Inquiring, I was told that the presence of the > substring "spam" anywhere in the address (including > "@sp

Re: Email Id Verification

2012-05-25 Thread Chris Angelico
On Sat, May 26, 2012 at 3:04 AM, Ian Kelly wrote: > I would think that it is not an anti-spam measure, but simply due to > the fact that most addresses containing "spam" tend to be something > like "[email protected]", being either a fake address or a junk inbox > that is only checked when an imp

Re: Smallest/cheapest possible Python platform?

2012-05-26 Thread Chris Angelico
On Sun, May 27, 2012 at 5:22 AM, Paul Rubin wrote: > If C is really intolerable I know there are some micros that can be > programmed in BASIC. Ugh. Of those, I would strongly recommend going with C. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Object cleanup

2012-05-30 Thread Chris Rebert
one >> type or another. I'm not declaring BeautifulSoup objects anywhere else. > > What's guppy? http://pypi.python.org/pypi/guppy/ "...a library and programming environment for Python, currently providing in particular the Heapy subsystem, which supports object and heap

Re: python3 raw strings and \u escapes

2012-05-31 Thread Chris Angelico
a regular expression in its docstring? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: While stack:

2012-06-01 Thread Chris Angelico
On Sat, Jun 2, 2012 at 3:59 AM, David Shi wrote: > Can any one clarify what "while stack:" mean? It iterates as long as 'stack' has something that evaluates as true. My guess is that stack is a list, and the loop is removing elements from that list, so it'll keep going as long as there's anything

Re: understanding operator overloading

2012-06-01 Thread Chris Rebert
s are `object` subclasses). Also, as a general point of coding style, one normally omits the parentheses after the class name if one isn't subclassing anything. Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread Chris Angelico
On Sun, Jun 3, 2012 at 7:18 AM, MRAB wrote: > Putting "LaunchPad", "Python" and "MakerFaire" into Google, plus the > "It has an m somewhere in it and it's 3 letters", quickly led me to: > > http://www.mpyprojects.com > -- Heh, Google's awesome :) I was just thinking "Hm, three letters with an M?

Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread Chris Angelico
On Sun, Jun 3, 2012 at 8:09 AM, MRAB wrote: > Look at the "Software" page: > > """We use the mpy language to program the MSP430 microcontroller. MPY is > short for Microcontroller PYthon.   mpy is based on the Python computer > language. In fact to keep things simple it is only a small subset of t

Re: ./configure

2012-06-03 Thread Chris Angelico
On Mon, Jun 4, 2012 at 7:19 AM, Janet Heath wrote: > configure:3534: error: no acceptable C compiler found in $PATH The configure script is used to build Python from source. To do that, you need a C compiler (such as gcc, which it went looking for a few lines earlier). Perhaps you want a binary d

Re: Installing Mailman

2012-06-03 Thread Chris Rebert
all the -devel package, or install Python > * from source.  See sec. 15.1 of the Installation Manual for > * details > > When I try to check the configuration ./configure for Mailman, I get > the above messages. What *nix flavor or Linux distro are you running? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: file pointer array

2012-06-04 Thread Chris Rebert
read the files at > the same time. > > for index in range(N): >     fid[index] = open('data%d.txt' % index,'r') That loop will start at 0, not 1, so so you'll try to open "data0.txt". To rectify that, use range(1, N+1), though you'll then n

Re: Documentación desde la terminal de comandos.

2012-06-07 Thread Chris Rebert
ra terminal usando "# Python" > > Gracias > > -- >  Diego Alonso Uribe Gamez Hola Diego, Esta lista de correo (python-list) es en inglés. Recomiendo que usted le pregunte a python-es (http://mail.python.org/mailman/listinfo/python-es ), que es la lista equivalente pero en es

Re: Career related question

2012-06-07 Thread Chris Angelico
cross-communicates with the newsgroup comp.lang.python, so you can be on either (and there are web-based newsgroup readers too). Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

xlrd 0.7.8 released!

2012-06-07 Thread Chris Withers
hes turn up). If you're interested in this, it would be great if you could try out the master branch and let us know if you find any problems: https://github.com/python-excel/xlrd There's also details of all things Python and Excel related here: http://www.python-excel.or

Re: what gui designer is everyone using

2012-06-08 Thread Chris Angelico
On Fri, Jun 8, 2012 at 7:18 AM, Kevin Walzer wrote: > On 6/5/12 10:10 AM, Mark R Rivet wrote: >> >> I want a gui designer that writes the gui code for me. I don't want to >> write gui code. what is the gui designer that is most popular? >> I tried boa-constructor, and it works, but I am concerned

Re: Where is the lastest step by step guide to compile Python into an executable?

2012-06-08 Thread Chris Angelico
On Sat, Jun 9, 2012 at 3:41 AM, Prasad, Ramit wrote: >> > Where is the lastest step by step guide to compile Python into an >> executable? >> >> Google. > > I think you mean the Internet as Google is just an index. > Unless you are referring to Google's cache. He means this: http://www.catb.org/

Re: Passing ints to a function

2012-06-09 Thread Chris Angelico
On Sat, Jun 9, 2012 at 6:29 PM, Jussi Piitulainen wrote: > The point is that the function itself can be passed as an argument to > the auxiliary function ... And unlike in Javascript, a bound method is fully callable too. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-09 Thread Chris Angelico
On Sat, Jun 9, 2012 at 11:25 PM, Dietmar Schwertberger wrote: > ... for many purposes only simple GUIs are required > and it should be possible to create these without studying manuals > (on toolkit and GUI editor). > A typical simple GUI would e.g. be for a measurement / data aquisition > program

Re: mode for file created by open

2012-06-09 Thread Chris Angelico
On Sun, Jun 10, 2012 at 12:08 AM, Devin Jeanpierre wrote: > I do, although I'm hesitant, because this only applies when mode == > 'w', and open has a large and growing list of parameters. True, but keyword arguments don't cost much complexity. open(file, mode='r', buffering=-1, encoding=None, er

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-09 Thread Chris Angelico
On Sun, Jun 10, 2012 at 3:07 AM, Dietmar Schwertberger wrote: > None of these were such that I could propagate it as GUI development > tool for non-programmers / casual users. > Sure, some are good for designing the GUI, but at the point where > the user code is to be added, most people would be l

Re: which one do you prefer? python with C# or java?

2012-06-10 Thread Chris Angelico
On Sun, Jun 10, 2012 at 11:40 PM, Matej Cepl wrote: > Just my personal experience, but after passively learning many many > languages, I came to the conclusion that I (and I suppose many others) am > able to learn only one platform well. The point is that you are never > interested in learning *a

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-10 Thread Chris Angelico
On Mon, Jun 11, 2012 at 5:37 AM, Dietmar Schwertberger wrote: > Chris Angelico wrote (in two posts): > >> There was a time when that was a highly advertisable feature - "build >> XYZ applications without writing a single line of code!". I've seen it >> in

Re: [newbie] Equivalent to PHP?

2012-06-12 Thread Chris Angelico
On Tue, Jun 12, 2012 at 7:39 PM, Gilles wrote: > Since web scripts are usually very short anyway (user sends query, > server handles request, sends response, and closes the port) because > the user is waiting and browsers usually give up after 30 seconds > anyway... why did Python solutions go for

Re: [newbie] Equivalent to PHP?

2012-06-12 Thread Chris Angelico
On Tue, Jun 12, 2012 at 8:36 PM, Gilles wrote: > Thanks for the input. > > But I read that PHP-based heavy-duty web servers compile the scripts > once and keep them in a cache, so they don't have to be > read/parsed/executed with each new query. > > In that case, what is the benefit of using a lon

Re: Where to set default data - where received, or where used

2012-06-12 Thread Chris Angelico
all config entries, and builds your config file parser... but that may be beyond the scope of your project. Anything you can imagine can be done in code. It's just a question of how much work. :) Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Equivalent to PHP?

2012-06-12 Thread Chris Angelico
On Wed, Jun 13, 2012 at 9:59 AM, Gilles wrote: > On Tue, 12 Jun 2012 20:18:21 +1000, Chris Angelico > wrote: >>Think of it as Apache + PHP versus Python. Apache keeps running, it's >>only your PHP script that starts and stops. With a long-running >>process, you ke

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Chris Angelico
the simple answer for simple tasks is: Don't bother with frameworks, run an HTTP server. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Chris Angelico
On Wed, Jun 13, 2012 at 7:49 PM, Gilles wrote: > On Wed, 13 Jun 2012 19:41:41 +1000, Chris Angelico > wrote: >>For high-availability servers, I can't speak for Python, as I've never >>done that there; but it seems likely that there's good facilities. My >>

Re: string to list

2012-06-13 Thread Chris Rebert
for consumption by the `csv` module: http://docs.python.org/library/stringio.html Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: string to list

2012-06-14 Thread Chris Rebert
a `str` literal. Implicit adjacent string literal concatenation then occurs. Thus: >>> print '"aa","bb ' b'","cc"' "aa","bb ","cc" Compare: >>> print '''"aa","bb 'b'","cc"''' "aa","bb 'b'","cc" But really, literal_eval() should not be used for CSV; it won't handle unquoted fields at all, among other issues. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: python's future?

2012-06-15 Thread Chris Angelico
On Fri, Jun 15, 2012 at 5:04 PM, Yesterday Paid wrote: > I'm very new to programing though I learn very little of java,C > I love python and have fun to do something with it > but some people said python's future perhaps not that bright. > I know this question maybe looks like an idiot:( > I reall

PyCon Australia 2012 Conference Programme Revealed!

2012-06-15 Thread Chris Neugebauer
Neugebauer Conference Coordinator and Sponsor Liaison PyCon Australia: Hobart 2012 -- http://2012.pycon-au.org -- @pyconau Conference registration and accommodation deals now available! See our website for details. Jabber: [email protected] -- IRC: chrisjrn on irc.freenode.net -- WWW: http:

Re: python's future?

2012-06-15 Thread Chris Angelico
On Fri, Jun 15, 2012 at 6:05 PM, Mark Lawrence wrote: > "an active and helpful mailing list/newsgroup (hi!)"?  Gmane lists 322 > entries under comp.python :) Sorry, should have said: A set of active and helpful mailing lists/newsgroups! You're quite right, there's a lot of them :) I wonder... is

Re: Need a Python Developer...

2012-06-15 Thread Chris Withers
On 05/06/2012 19:18, o2kcompliant wrote: Hi Guys, I have a need for a Python Developer... How about using the Python job board rather than spamming the mailing list: http://www.python.org/community/jobs/howto/ cheers, Chris -- Simplistix - Content Management, Batch Processing & Py

Re: Create thumbnail image (jpg/png) of PDF file using Python

2012-06-16 Thread Chris Angelico
On Fri, Jun 15, 2012 at 9:15 AM, Dennis Lee Bieber wrote: >        PDF is not an "image" file format; it is a "program" describing how > to render each page. Some of the page contents can be image bitmap data, > but a "proper" PDF has text AS text. Plus, JPG is very poor at handling text. It's de

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-16 Thread Chris Angelico
On Sun, Jun 17, 2012 at 12:15 PM, Yesterday Paid wrote: > I'm making cipher program with random.seed(), random.random() as the > key table of encryption. > I'm not good at security things and don't know much about the > algorithm used by random module. For security, you don't want any algorithm,

Re: Pythonic cross-platform GUI desingers ?? la Interface Builder (Re: what gui designer is everyone using)

2012-06-16 Thread Chris Angelico
On Fri, Jun 15, 2012 at 7:47 AM, Dietmar Schwertberger wrote: > The point is, that if you want to promote Python as replacement > for e.g. VB, Labview etc., then an easy-to-use GUI builder is required. > The typical GUI programs will just have an input mask, a button and one > or two output fields

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-16 Thread Chris Angelico
On Sun, Jun 17, 2012 at 2:18 PM, Steven D'Aprano wrote: > Safe from what? What is your threat model? Are you worried about your > little sister reading your diary? Or the NSA discovering your plans to > assassinate the President? Or something in between? > > Python's random module is not cryptogra

Re: Pythonic cross-platform GUI desingers ?? la Interface Builder (Re: what gui designer is everyone using)

2012-06-17 Thread Chris Fox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/06/2012 03:42, Chris Angelico wrote: > On Fri, Jun 15, 2012 at 7:47 AM, Dietmar Schwertberger > wrote: >> The point is, that if you want to promote Python as replacement >> for e.g. VB, Labview etc., then an easy-to-

Re: Pythonic cross-platform GUI desingers ?? la Interface Builder (Re: what gui designer is everyone using)

2012-06-17 Thread Chris Angelico
On Sun, Jun 17, 2012 at 7:01 PM, Chris Fox wrote: > On 17/06/2012 03:42, Chris Angelico wrote: >> I want to promote Linux as a replacement for Windows. But I do not >> see that Linux needs to be able to run Internet Explorer in order >> to do that. Maybe when people move t

<    22   23   24   25   26   27   28   29   30   31   >