Re: restriction on sum: intentional bug?

2009-10-17 Thread Alan G Isaac
On 10/16/2009 8:16 PM, Terry Reedy wrote: The fact that two or three people who agree on something agree on the thing that they agree on confirms nothing. On 10/17/2009 7:03 PM, Terry Reedy wrote: If you disagree with this, I think *you* are being silly. Well, ... Alan G Isaac wrote: Of

Web development with Python 3.1

2009-10-25 Thread Alan Harris-Reid
.py, etc.) are Python3 compatible yet. So, what can I use to start my web programming experience using 3.1? Any help would be appreciated. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
Exarkun - thanks for the reply > don't - start with 2.6 Thought you might say that ;-) Regards, Alan On 25 Oct, 11:52 pm, [email protected] wrote: 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 h

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
ce. Looks like I'll have to go the cgi route myself if I want to stick with with Python3. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
r a while now). However, it looks as though I might have to review that decision, but what I've learned so far is pretty simple stuff, so it won't be wasted. Regards, Alan Alan Harris-Reid writes: I am very much new to Python, and one of my first projects is a simple data-based web

Re: Web development with Python 3.1

2009-10-27 Thread Alan Harris-Reid
Aaron Watters wrote: On Oct 25, 7:52 pm, Alan Harris-Reid wrote: 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 can see, none

Re: Re: Web development with Python 3.1

2009-10-28 Thread Alan Harris-Reid
John Nagle wrote: Alan Harris-Reid wrote: 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 Until MySQLdb gets ported to something later than Python 2.5, support for a "data-based web site" probably has to be

Re: Web development with Python 3.1

2009-10-28 Thread Alan Harris-Reid
jango, CherryPy, web.py, etc.) are Python3 compatible yet. That's not entirely true, see http://wiki.python.org/moin/PortingDjangoTo3k Regards, Martin Interesting link. Thanks for the info. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-11-07 Thread Alan Harris-Reid
d, you may see the list of all pypi packages availabe for Python 3 at: http://pypi.python.org/pypi?:action=browse&show=all&c=533 m. Thanks for those links Mario - I'll check them out asap.. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

String prefix question

2009-11-08 Thread Alan Harris-Reid
fix. From what I can gather from the documentation the b prefix represents a bytes literal, but can anyone explain (in simple english) what this means? Many thanks, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: String prefix question

2009-11-09 Thread Alan Harris-Reid
Gerard Flanagan wrote: Alan Harris-Reid wrote: In the Python.org 3.1 documentation (section 20.4.6), there is a simple “Hello World” WSGI application which includes the following method... def hello_world_app(environ, start_response): status ='200 OK' # HTTP Status headers =(b&#x

Re: Re: String prefix question

2009-11-09 Thread Alan Harris-Reid
Benjamin Kaplan wrote: On Sun, Nov 8, 2009 at 9:38 PM, Alan Harris-Reid wrote: In the Python.org 3.1 documentation (section 20.4.6), there is a simple "Hello World" WSGI application which includes the following method... def hello_world_app(environ, start_response): statu

Re: Threading issue with SQLite

2010-02-02 Thread Alan Harris-Reid
Many thanks to all who replied to my questions re. SQLite connections, cursors and threading. Looks like I have got some reading to do regarding connection pooling and a decent SQLite ORM package. Does anyone know of any which are Python 3 compatible? Many thanks, Alanj -- http://mail.pyth

Passing parameters in URL

2010-02-03 Thread Alan Harris-Reid
on? I am currently using CherryPy 3.2, but I guess the theory could apply to any HTTP framework or web app.. Any help would be appreciated. Alan Harris-Reid -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing parameters in URL

2010-02-04 Thread Alan Harris-Reid
Many thanks to all those who replied to my question and clearing-up the differences between GET and POST. I think I know what to do now - if not, I'll be back :-) Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Editor for Python

2010-02-05 Thread Alan Harris-Reid
Hi Laszlo, I use Wing IDE (not free, $35 for personal edition) and PyScripter (free). I find both good, for different reasons. Regards, Alan Laszlo Nagy wrote: Hi All, I know that this question was put up on

Re: Re: DreamPie - The Python shell you've always dreamed about!

2010-02-23 Thread Alan Harris-Reid
or all common Windows versions? Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-23 Thread Alan Harris-Reid
Chris Colbert wrote: Do you have gtk and PyGTK installed? Sounds like a missing dependency to me. On Tue, Feb 23, 2010 at 6:56 AM, Alan Harris-Reid mailto:[email protected]>> wrote: gorauskas wrote: I installed it on a Windows 7 machine with CPython 2.6.4

Super() function

2010-03-24 Thread Alan Harris-Reid
name of the current method (ie. something like super().thismethod()) or do I always have to repeat the method name after super()? TIA, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: Super() function

2010-03-27 Thread Alan Harris-Reid
³p wrote: Hi: On 25 March 2010 11:17, Alan Harris-Reid <mailto:[email protected]>> wrote: Hi, Using Python 3.1, I sometimes use the super() function to call the equivalent method from a parent class, for example def mymethod(self): super()

Re: Re: Super() function

2010-03-27 Thread Alan Harris-Reid
Gabriel Genellina wrote: En Thu, 25 Mar 2010 00:17:52 -0300, Alan Harris-Reid escribió: Using Python 3.1, I sometimes use the super() function to call the equivalent method from a parent class, for example def mymethod(self): super().mymethod() some more code... Is there any way

SQLite date fields

2010-11-24 Thread Alan Harris-Reid
le, and I could use datetime() functions if I needed to perform any date-arithmetic. How have other developers overcome this problem? Any help would be appreciated. For the record, I am using SQLite3 with Python 3.1. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite date fields

2010-11-26 Thread Alan Harris-Reid
To all those who have replied on this thread - many thanks. It looks as though I've got to look further into date objects, SQLite's native date functions, detect_types, etc.. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Framework design question

2010-12-05 Thread Alan Harris-Reid
view, does the data-conversion belong to page-object processing or data-object processing? Any opinions would be appreciated. Alan -- http://mail.python.org/mailman/listinfo/python-list

Career path - where next?

2011-01-12 Thread Alan Harris-Reid
ieving my goal, I would be grateful for any advice. Regards, Alan Harris-Reid -- http://mail.python.org/mailman/listinfo/python-list

Re: Career path - where next?

2011-01-15 Thread Alan Harris-Reid
To all those who answered my original post so far (Jon Clements, Terry Jan Reedy, Philip Semanchuk) - many thanks. Your suggestions have given me a number of avenues to follow. I'll let you know how I get on. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Career path - where next?

2011-01-17 Thread Alan Harris-Reid
nt to follow. Still, at least I've let them know what I am doing now and you never know where word-of-mouth may lead. I tried C# for a while, but after Foxpro it appeared to me to be such a horrible, clunky language. Then I discovered Python about a year ago and have loved it ev

Code redundancy

2010-04-20 Thread Alan Harris-Reid
language was Visual Foxpro, which had the syntax... with class1 .attr1 = 1 .attr2 = 2 .attr3 = 3 .attr4 = 4 etc. endwith Is there any equivalent to this in Python? Any help would be appreciated. Alan Harris-Reid -- http://mail.python.org/mailman/listinfo/python-list

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Jean-Michel Pichavant wrote: Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Peter Otten wrote: Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Iain King wrote: On Apr 20, 2:43 pm, Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = class1.attr2 = class1.attr3 = class1.attr4 = etc. Is there any way to achieve the same result without having to repeat

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Stefan Behnel wrote: Alan Harris-Reid, 20.04.2010 15:43: During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Xavier Ho wrote: On Wed, Apr 21, 2010 at 7:59 AM, Alan Harris-Reid mailto:[email protected]>> wrote: The code is not usually in class.__init__ (otherwise I would have used the self. prefix) Alan, if your variables are not usually in __init__, what's preventin

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Chris Rebert wrote: On Tue, Apr 20, 2010 at 2:59 PM, Alan Harris-Reid wrote: Stefan Behnel wrote: Alan Harris-Reid, 20.04.2010 15:43: During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Ethan Furman wrote: Alan Harris-Reid wrote: The code is not usually in class.__init__ (otherwise I would have used the self. prefix), but I like your self.__dict__.update(...) solution and I'll try and remember it. The code I was thinking of goes something like as follows (don'

Re: Re: Code redundancy

2010-04-21 Thread Alan Harris-Reid
namespace. But be aware, that this is not recommended. If you mess with __dict__, you won't be able to replace it with some logic (parameter) if you need to do something more than setting a variable. Best Hi Andreas, thanks for the reply, Looks like I'll be sticking with repeating th

Re: Code redundancy

2010-04-21 Thread Alan Harris-Reid
Ryan Kelly wrote: On Tue, 2010-04-20 at 14:43 +0100, Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result

Email attachment problem

2010-04-29 Thread Alan Harris-Reid
sg.as_string() because no part of the attachment can have a None value. (Traceback shows "'NoneType' object has no attribute 'get_content_maintype'" in line 118 of _dispatch in generator.py, many levels down from msg.as_string()) Has anyone any idea what

Re: Email attachment problem

2010-04-29 Thread Alan Harris-Reid
Chris Rebert wrote: On Thu, Apr 29, 2010 at 1:06 PM, Alan Harris-Reid wrote: Hi there, I want to send an email with an attachment using the following code (running under Python 3.1, greatly simplified to show example) from email.mime.multipart import MIMEMultipart from email.mime.text

Binary file email attachment problem

2010-05-09 Thread Alan Harris-Reid
in the encoding somewhere, but I've no idea where. I have also tried MIMEApplication and MIMEImage, but the error still remains. I have seen many similar code examples on the web, all of which fail for me, so I wonder if there is something wrong with my environment. Has anyone any ide

documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
10.5f') ' 3.2' >>> format(3.2,'<10.5f') '3.2 ' Am I somehow misreading the documentation? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
On 5/11/2010 3:19 PM, MRAB wrote: You usually want numbers to be right-aligned so that the decimal points line up when writing a columns of them. Yes. I'm not questioning the wisdom of the implementation, just the documentation of it. Thanks, Alan -- http://mail.python.org/mailman/lis

Re: documentation bug? (format spec mini language)

2010-05-12 Thread Alan G Isaac
On 5/11/2010 5:05 PM, Terry Reedy wrote: http://bugs.python.org/issue8691 Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

modify XMP data (Python/Windows)

2010-06-05 Thread Alan G Isaac
use on Windows. I found Chilkat's XMP library http://www.chilkatsoft.com/python-xmp.asp but it is not open source and I found no encouraging reviews. Is there a Python package providing functinonality comparable to Image::ExifTool (perl)? Thanks, Alan Isaac -- http://mail.python.org/ma

Re: [ANNC] pynguin-0.8 python turtle graphics application

2010-06-09 Thread Alan G Isaac
are working with Gregor Lingl to make turtle.py even better. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Removing anti-Jewish postings from Python list

2010-06-16 Thread Alan Harris-Reid
Any idea how we get rid of this 'noise'? Will it eventually go away if we ignore it, or is there anything the moderators can do to clean-up this (normally) wonderful resource for Python programmers? Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

ttk Scale: missing attributes

2010-06-23 Thread Alan G Isaac
Tkinter's Scale widget had a `label` and a `resolution` attribute. These appear to be missing from the Ttk Scale widget. Is there a reason? These were important attributes. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

best way to increment an IntVar?

2010-06-23 Thread Alan G Isaac
Of course one can do myintvar.set(myintvar.get()+1) but surely there is a better way? I'm surprsied that myintvar += 1 is not allowed. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
2 is temp) (5, True) Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue? http://bugs.python.org/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

value of: None is None is None

2010-06-25 Thread Alan G Isaac
Surprising for a moment, if you don't immediatelyrecognize it as a chained comparison. (Just sharing.) Alan Isaac None is None is None True (None is None) is None False None is (None is None) False -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
vior" is supposed to mean. Mutable objects like a list will generally modify in place. Immutable objects of course will not. An IntVar is mutable. You have given no reason for it not to handle ``+=`` in an unsurprising fashion. It is not an int. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: improving IDLE

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! On Jun 25, 12:46 pm, Alan G Isaac wrote: Did you open an issue?http://bugs.python.org/ On 6/25/2010 4:26 PM, rantingrick wrote: If *I* open an issu

Re: Plot problem.. ?? No sign at all

2010-07-05 Thread Alan G Isaac
xt line V0 = ... #create an array plt.plot(V0) plt.show() hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Plot problem.. ?? No sign at all

2010-07-06 Thread Alan G Isaac
ible. But create it however you wish. (Note than numpy arrays have a fixed length; create a Python list if you wish to append to it.) Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Plot problem.. ?? No sign at all

2010-07-06 Thread Alan G Isaac
don't see how). Unfortunately I cannot make sense of the code you posted. Provide a detailed description in words (or psuedocode) of what you are trying to accomplish. Be very careful and detailed is you want a useful response. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: matplotlib installation

2009-06-12 Thread Alan G Isaac
.6. I assume this is of great concern to the Python community, but I do not know where the discussion is taking place. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to understand dictionaries

2009-06-12 Thread Alan G Isaac
k close to your example, reverse the use of lists and dicts. worst_musicians = list() entry = dict(fname='ricky',lname='martin') worst_musicians.append(entry) entry = dict(fname='britney',lname='spears') worst_musicians.append(entry) for musician in worst_musicians: print "%(fname)s %(lname)s"%musician hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's @foo[3,7,1,-1] ?

2009-06-16 Thread Alan G Isaac
anted = @foo[3, 7, 1, -1]; >>> a = np.arange(10) >>> a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> a[[3,7,1,-1]] array([3, 7, 1, 9]) hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's @foo[3,7,1,-1] ?

2009-06-17 Thread Alan G Isaac
On 6/17/2009 4:03 PM J. Cliff Dyer apparently wrote: > example code > should always include relevant imports. Agreed. It was a cut and paste failure. Apologies. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: please help...writing set to a file

2009-06-18 Thread Alan G Isaac
functions.html#sorted http://docs.python.org/library/itertools.html#itertools.izip_longest http://docs.python.org/library/stdtypes.html#str.format http://docs.python.org/library/functions.html#open hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding Python is scripting language or not

2009-06-19 Thread Alan G Isaac
On 6/17/2009 8:38 AM Jean-Michel Pichavant apparently wrote: > I'm pretty sure you'll be able to find OOP scripting > language. http://www.amazon.com/Scripting-Objects-Comparative-Presentation-Object-Oriented/dp/047039725X/ref=sr_1_1?ie=UTF8&s=books&qid=1245276357&a

Re: Open source python projects

2009-06-22 Thread Alan G Isaac
ience here, I believe quite a few projects would profit, not to mention the SimpleParse users themselves. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 (pinin' for the fjords)

2009-07-02 Thread Alan G Isaac
Using the 3.1 Windows installer, I chose that I did not want the extensions registered, and the installer unregistered the .py and .pyw extensions (which I had wanted to keep associated with Python 2.6). Is this intentional? Alan Isaac PS I already fixed the problem. My question is about

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Alan G Isaac
2. from scipy.optimize import bisect def _binary_search(lo, hi, func, target, epsilon): def f(x): return func(x) - target return bisect(f, lo, high, xtol=epsilon) 3. If you don't want to use SciPy (why?), have them implement http://en.wikipedia.org/wiki/Bisection_method#Pseudo-code to produce their own `bisect` function. hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Alan G Isaac
> In Alan G Isaac > writes: >> 1. Don't use assertions to test argument values! On 7/3/2009 12:19 PM kj apparently wrote: > Out of curiosity, where does this come from? http://docs.python.org/reference/simple_stmts.html#grammar-token-assert_stmt "The current cod

3.1 Windows Installer trashes extension registrations

2009-07-03 Thread Alan G Isaac
> Alan G Isaac wrote: >> Using the 3.1 Windows installer, I chose that I did not >> want the extensions registered, and the installer >> unregistered the .py and .pyw extensions (which I had >> wanted to keep associated with Python 2.6). >> Is this intentional?

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Alan G Isaac
ng to understand, but perhaps less useful. Alan Isaac PS For additional explanation: http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html -- http://mail.python.org/mailman/listinfo/python-list

invoke method on many instances

2009-07-16 Thread Alan G Isaac
, **kwargs) for item in itr: f(item) (Comment: in the case at hand, the methods return None.) Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: invoke method on many instances

2009-07-18 Thread Alan G Isaac
> On Fri, 17 Jul 2009 05:19:50 +0000, Alan G Isaac wrote: >> def apply2(itr, methodname, *args, **kwargs): >> f = operator.methodcaller(methodname, *args, **kwargs) >> for item in itr: >> f(item) On 7/17/2009 3:45 AM Steven D'Aprano appare

are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
ks for any insights, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
> * Alan G Isaac [2009-07-19 13:48:16 +]: >> Are user defined classes hashable? >> (The classes; *not* the instances!) >> I'm inclined to guess it will be hashed by id and this is >> OK. On 7/19/2009 10:07 AM Nicolas Dandrimont apparently wrote: > Y

Re: invoke method on many instances

2009-07-22 Thread Alan G Isaac
>>> On Fri, 17 Jul 2009 05:19:50 +0000, Alan G Isaac wrote: >>>> def apply2(itr, methodname, *args, **kwargs): >>>> f = operator.methodcaller(methodname, *args, **kwargs) >>>> for item in itr: >>>> f(item) >> On 7/1

csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
Given a csv.DictWriter instance `dw` I think it would be nice to be able to say dw.write_header() instead of dw.writer.writerow(dw.fieldnames) Good idea? Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
> On Aug 13, 6:45 am, Alan G Isaac wrote: >> Given a csv.DictWriter instance `dw` >> I think it would be nice to be able to >> say dw.write_header() >> instead of >> dw.writer.writerow(dw.fieldnames) >> >> Good idea? On 8/12/2009 10:24 PM John Mac

Re: csv.DictWriter.write_header()

2009-08-14 Thread Alan G Isaac
> On Aug 13, 1:15 pm, Alan G Isaac wrote: >> I do not understand the reason for your silly, sarcastic response. On 8/13/2009 7:58 AM John Machin apparently wrote: > Duck typing: ask a silly question, get a silly answer. Maybe if you learned to be a more generous reader, fewer que

retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
7;*len(tpl)%tpl). It works but seems rather ugly. I kind of like reduce(list.__getitem__, tpl, lst) but the reliance on reduce remains controversial enough to see i removed from the Python 3 built-ins ... Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
On 8/14/2009 1:09 PM Steven D'Aprano apparently wrote: > Try this instead: > >>>> from operator import getitem >>>> reduce(getitem, (2, 1, 0), lst) > 'aaa' >>>> reduce(getitem, (2, 1, 0, 0), lst) > 'a' > >

random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
have some offsetting disadvantage. What is it? Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
> On Aug 15, 12:49 pm, Alan G Isaac wrote: >> Quotinghttp://docs.python.org/3.1/library/random.html#random.gauss: >> Gaussian distribution. mu is the mean, and sigma is the >> standard deviation. This is slightly faster than the >> normalvariate() funct

Re: flatten a list of list

2009-08-16 Thread Alan G Isaac
On 8/16/2009 5:47 AM Terry apparently wrote: > Is there a simple way (the pythonic way) to flatten a list of list? > rather than my current solution: > new_list=[] > for l in list_of_list: > new_list.extend(l) new_list = list(xi for lst in list_of_list for xi in lst)

Re: Select column from a list

2009-08-28 Thread Alan G Isaac
asked but ... >>> rows = [(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)] >>> cols = map(None,*rows) >>> cols [(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)] Now you can have any "column" you want. Alan Isaac PS You can also use imap if you prefer not to create

incorrect DeprecationWarning?

2009-09-04 Thread Alan G Isaac
:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception.__init__(self) ... self.msg = message ... e = My

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
Alan G Isaac wrote: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception._

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
creams on "unPythonic" on this list would be deafening. I am not sure how best to deprecate dependence on the Python 2.5 mistake, but this is not it. And I know at least one important library that is affected. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
I've filed a bug report: http://bugs.python.org/issue6844 Sadly the Twisted developers apparently did not file a bug report when they were bitten by this ... Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning (patch needed)

2009-09-08 Thread Alan G Isaac
On 9/5/2009 5:50 PM, Alan G Isaac wrote: I've filed a bug report: http://bugs.python.org/issue6844 This is now an accepted bug with a patch request. Can someone on this list please assist with a patch? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
error report is produced both times. So this is a Python 2.6 change. Clues? Bug or feature? I'm going to hazard a guess that there was an undocumented (in What's New) change to the __unicode__ method of BaseException. Thanks, Alan Isaac .. [1] Following is the rst file to process

Re: Use python to execute a windows program

2009-09-11 Thread Alan G Isaac
Does the Windows application offer a COM interface? http://oreilly.com/catalog/pythonwin32/chapter/ch12.html http://sourceforge.net/projects/pywin32/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
>>> unicode(e) u"(2, 'No such file or directory')" >>> str(e) "[Errno 2] No such file or directory: 'flooble'" >>> u'%s' % e u"(2, 'No such file or directory')&quo

Re: string interpolation mystery in Python 2.6

2009-09-12 Thread Alan G Isaac
quot;%s %s" % (u'foo', C()) u'foo [unicode]' I.e., as soon as a Unicode element is interpolated into a string, further interpolations automatically request Unicode via __unicode__, if it exists. Pretty subtle ... Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Alan G Isaac
to display them. But really, Matplotlib is both cross platform and great. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Alan G Isaac
Alan G Isaac wrote: There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. On 9/16/2009 12:33 AM, John Nagle wrote: "The package is a wrapper around Tkinter". It runs Tkinter in a separate thread and sends commands to it.

Re: Programming ideas?

2009-09-20 Thread Alan G Isaac
You could learn a lot of Python contributing to docutils or bibstuff, and if you write papers or presentations, it may pay off directly. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-10-31 Thread Alan Harris-Reid
wouldn't want to edit those, would you?) Regards, Alan On 19:59, jf wrote: Hi, I've a project with tabs and spaces mixed (yes I know it's bad). I edit each file to remove tabs, but it's so easy to ma

Fwd: Re: AUTO EDITOR DIDN'T WORK

2023-06-12 Thread Alan Gauld via Python-list
s a python interpreter? ie. Did you get a >>> prompt in a terminal? and without involvement from your video editor? If so, what did you do to link it to the video editor? And what was the result? Or did Python not even start? How did you try to use it? What OS are you on? Did the installer

Fwd: AUTO EDITOR DIDN'T WORK

2023-06-13 Thread Alan Gauld via Python-list
d and reinstalled about twice and still no success hence I uninstalled it. On Mon, 12 Jun 2023, 23:33 Alan Gauld via Python-list, mailto:[email protected]>> wrote: On 12/06/2023 10:26, Real Live FootBall Tv via Python-list wrote: > I did it because I was going to use it with another

Re: Fwd: AUTO EDITOR DIDN'T WORK

2023-06-15 Thread Alan Gauld via Python-list
onsole/terminal window by typing python at the command prompt. If you get the Python prompt: >>> Then Python is installed OK. After that it's back into auto-editor and resolve and this is not the best place to get answers for those. Resolve at least has an active support forum, s

Re: Multiple inheritance and a broken super() chain

2023-07-04 Thread Alan Gauld via Python-list
GC, but then neither does it have an Object superclass so very often MI in C++ does not involve creating diamonds! And especially if the MI style is mixin based. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follo

<    6   7   8   9   10   11   12   13   >