Re: send() to a generator in a "for" loop with continue(val)??

2009-04-18 Thread Aahz
lly, send() is useful for coroutines, and if you haven't yet read http://dabeaz.com/coroutines/ you really should (assuming you want to continue arguing). -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a prof

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
ode, the timeout is not >respected (albeit the notify()s work as expected). Whether or not there's a bug, you likely will simplify your code if you switch to using a Queue(). -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's

Re: class variables and class methods

2009-04-18 Thread Aahz
uot; and "instance", and I think you're also confusing "variable" and "attribute". You might find it helpful to read the following URLs and then re-post with new phrasing: http://docs.python.org/tutorial/classes.html http://starship.python.net/crew/mwh/hacks/obj

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-18 Thread Aahz
In article <07ad771b-a6d1-4f08-b16c-07caf7462...@e18g2000yqo.googlegroups.com>, Michele Simionato wrote: >On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: >> In article , >> Peter Otten =A0<__pete...@web.de> wrote: >>> >>>If it were up to

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
In article <8373c927-5ef2-4511-a439-25caa3fd6...@v15g2000yqn.googlegroups.com>, wrote: >On Apr 18, 2:05=A0pm, a...@pythoncraft.com (Aahz) wrote: >> >> Whether or not there's a bug, you likely will simplify your code if you >> switch to using a Queue(). > >I&

Re: Too early implementation

2009-04-18 Thread Aahz
is observation was originally made in _The Mythical Man-Month_ by Fred Brooks, which ought to be required reading for all programmers. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job,

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
In article <19475d1c-ee83-4466-ba55-b352ea760...@x5g2000yqk.googlegroups.com>, wrote: >On Apr 18, 4:28=A0pm, a...@pythoncraft.com (Aahz) wrote: >> >> Essentially, you use the Queue instead of the Condition. =A0When you want >> to explicitly give up control in a thr

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Aahz
texts. I had never previously heard that Modula-2 significantly influenced Ada, and the Wikipedia entry says nothing about it. Do you have a cite? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professiona

Re: Please help with problem creating class

2009-04-18 Thread Aahz
z = '1\t2\t3\t4\t5'.split('\t') Traceback (most recent call last): File "", line 1, in ? ValueError: too many values to unpack -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a profes

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: >Aahz wrote: >> In article >> <07ad771b-a6d1-4f08-b16c-07caf7462...@e18g2000yqo.googlegroups.com>, >> Michele Simionato wrote: >>>On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: >>>&

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Aahz
dev community), but each of us has our own hobby horses that we like to push, and none of us keeps completely on top of everything. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job,

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-19 Thread Aahz
nstraint... I couldn't come up with something smarter, so... The redraw thread should keep track of the last time it did a redraw; each time it receives an update event, it should check to see whether it has been more than a specified period of time since the last redraw. -- Aahz

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
on strings. Even Java has that! >> >> Why would it be nice to have? I never missed it... > >First off, it's pretty commonplace in OO languages. What makes you think Python is "an OO language"? What kind of OO language allows you to do this: def squ

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
[BTW, please make sure to retain attributions for quotes] In article , Emmanuel Surleau wrote: >Aahz: >> >> What makes you think Python is "an OO language"? > >Python is a dynamic object-oriented programming language that can be used >for many kinds of soft

Re: The Python standard library and PEP8

2009-04-20 Thread Aahz
In article , Steven D'Aprano wrote: >On Mon, 20 Apr 2009 03:44:59 -0400, Terry Reedy wrote: >> Steven D'Aprano wrote: >>> On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote: >>>> In message , Aahz wrote: >>>>> >>&

What is a real name, round 668 (was Re: when can i expect libraries and third party tools to be updated for python 3 ?)

2009-04-20 Thread Aahz
e sounds annoyed, you are certainly correct; I have little patience for this nonsense.) -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Ad

Re: and [True,True] --> [True, True]?????

2009-04-20 Thread Aahz
In article , =?ISO-8859-1?Q?Gerhard_H=E4ring?= wrote: > >I prefer to write it explicitly: > >if len(lst) > 0: >... At the very least, IMO you should write this as if len(lst): ... There's no reason to be explicit about the numeric comparison. -- Aah

Re: What is a real name, round 668

2009-04-20 Thread Aahz
In article <87hc0iltal@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> In article <87tz4jl66c@benfinney.id.au>, >> Ben Finney wrote: >>> >>>(Is there hope that you could set your From field using your real >>

Re: Self-intro and possible offtopic: creation of group integrating translators and experts in the fields they translate

2009-04-20 Thread Aahz
unify them. There is no need, but should you >feel like joining both groups, you're welcome. There's also a small minority (of whom I'm a member) that despises both... ;-) -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think

Re: The Python standard library and PEP8

2009-04-20 Thread Aahz
ce > >I'd be happy to contribute to this if it was considered worthwhile. That's precisely what's been vetoed (among other things). Guido thinks the maintenance cost is too high. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If

Re: A Special Thanks

2009-04-21 Thread Aahz
a wonderful feeling. Not quite: you can be 100% sure you didn't break anything you had appropriate tests for. If you use pure TDD (test-driven development), you can be pretty close to 100% comfortable, but my impression is that few people do pure TDD. -- Aahz (a...@pythoncraft.com)

Re: who is calling the base class __new__ method

2009-04-21 Thread Aahz
In article , Andreas Otto wrote: > > Question: What is the difference between these both functions >and why is one working and the other not ? If you don't get an answer here, try capi-sig. -- Aahz (a...@pythoncraft.com) <*> http://www.pytho

Re: Would you support adding UNC support to os.path on Windows?

2009-04-22 Thread Aahz
in the patch. After all, it's has >been declined before; I submitted a similar patch for 1.5.2 way back in >1999. (You can read the details of that on the tracker page too.) You should bring this up on python-dev. -- Aahz (a...@pythoncraft.com) <*> http://www.p

Re: pyflakes, pylint, pychecker - and other tools

2009-04-22 Thread Aahz
y, so PEP 8 is indeed somewhat prescriptive. Second, you can configure pylint to respect your personal style; I think that pylint's default PEP 8 configuration makes a lot of sense. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you

Re: Regular expression to capture model numbers

2009-04-22 Thread Aahz
1234', 'Test123AB-x'] > >This is not working. What isn't working? Why not just split() on ";"? You need to define your problem more precisely if you want us to help. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "

Re: Configuring pylint for local conventions (was: pyflakes, pylint, pychecker - and other tools)

2009-04-23 Thread Aahz
In article <874owf4gky.fsf...@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> >> Second, you can configure pylint to respect your personal style > >How? I haven't seen any decent documentation on doing so. Actually, I don't

Re: Supply a plugin interface

2009-04-23 Thread Aahz
untime with Python? You might consider using execfile() but probably __import__ works better for your purposes. There's also importlib on PyPI, which is the backport from 2.7. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it'

Re: Large data arrays?

2009-04-23 Thread Aahz
ably want to ask on a NumPy or SciPy list: http://scipy.org/Mailing_Lists -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: Using optparse

2009-04-23 Thread Aahz
In article , loial wrote: > >A shell script is passing parameters to my python script in the >following format > >-PARAM1 12345 -PARAM2 67890 > >Can I parse these with optparse ? If so how? You might try using shlex instead. -- Aahz (a...@pythoncraft.com)

Re: Cython + tuple unpacking

2009-04-23 Thread Aahz
is line segfault Does this crash if you unpack the a,b tuple inside the loop? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -

Re: JOB: Statistical Programmer | LOCATION: London, England, UK

2009-04-23 Thread Aahz
t your job. Wrong, there's no Python mentioned in the job ad, therefore the job board won't accept it. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an

Re: Convert numpy.ndarray into "normal" array

2009-04-24 Thread Aahz
>picture). > >So now I've been trying to somehow convert the array in a fast manner, >but just couldn't do it. What exactly is "array" anyways? I know >"array.array", but that's something completely different, right? Does >anyone have hints on

Re: Superclass initialization

2009-04-24 Thread Aahz
Anyway, I suggest that you subscribe to one of the NumPy mailing lists and ask there: http://scipy.org/Mailing_Lists -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: Help AIX 5.3 build on Python-3.1a2

2009-04-25 Thread Aahz
foibles, this is likely to be unfixable. Can you try trimming down the compilation to a small reproducible case? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-26 Thread Aahz
Java has mostly given up on thread-killing. The only way to kill threads safely is to have them terminate themselves. Your other option is to use multiple processes. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to

Re: An unexpected visit_decref assertion fail (code works under python 2.4, doesn't under 2.5)

2009-04-26 Thread Aahz
nce for any insights or tips! Try capi-sig -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird lambda behavior (bad for)

2009-04-26 Thread Aahz
doSomething(x) Obviously, this case could be rewritten fairly easily to hoist doSomething into the loop before the break, but I've seen other cases less amenable. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire

Re: Lisp mentality vs. Python mentality

2009-04-26 Thread Aahz
not smart enough to debug it." --Brian W. Kernighan -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-26 Thread Aahz
In article <793a5176-ec2d-4ffd-b1e7-762077733...@v35g2000pro.googlegroups.com>, Vsevolod wrote: >On Apr 26, 6:28 pm, a...@pythoncraft.com (Aahz) wrote: >> >> The problem is that thread-killing (in the literal sense) doesn't work. >> Unlike processes, there'

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-26 Thread Aahz
g it up to date. Are you volunteering to maintain trn3.6? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: mailbox.mbox.add() also seems to set file permissions

2009-04-26 Thread Aahz
n due to hardware problems). -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list

Re: Get item from set

2009-04-27 Thread Aahz
equivalent(set([1, 2, 3]), 2.0) # 2.0 is equivalent to 2 2 >>> get_equivalent([1, 2, 3], 4, default=0) 0 ''' t = _CaptureEq(item) if t in container: return t.match return default -- Aahz (a...@pythoncraft.com) <*>

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Aahz
In article , Steven D'Aprano wrote: >On Sun, 26 Apr 2009 21:51:00 -0700, John Machin wrote: >> >> ἐδάκρυσεν ὁ Ἰησοῦς > >Alright, I give up. Is that APL code? *grin* base64 encoding -- Aahz (a...@pythoncraft.com) <*> http

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
n (and that is how it's implemented >in the current version of the language). Did you see my comment about Java? This particular issue has little to do with Python. I won't disagree that what you're describing is sometimes a problem in the Python community, but you're picking th

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
there's no response to make; the original post was a joke, and trying to have a serious discussion about it rarely excites people. If you want to talk about Python and problems you're running into, you should start a new thread. -- Aahz (a...@pythoncraft.com) <*>

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
In article <9a827369-b36f-4a86-870a-e5a505e34...@q33g2000pra.googlegroups.com>, Vsevolod wrote: >On Apr 27, 8:18 pm, a...@pythoncraft.com (Aahz) wrote: >> >> If you want to talk about Python and problems you're running into, you >> should start a new thr

Re: dict is really slow for big truck

2009-04-28 Thread Aahz
e.strip().split('\t') > dict[arr[0]]=arr > >but, the dict is really slow as i load more data into the memory, by >the way the mac i use have 16G memory. >is this cased by the low performace for dict to extend memory or >something other reason. Try gc.disable() before th

Re: Why bool( object )?

2009-04-29 Thread Aahz
won't be a good programmer if you can't wrap your head around metaphor. All programming is about translating human thought into human language -- albeit a very special language with (mostly) precise rules. Repeat: programming languages are human languages. -- Aahz (a...@

Re: Get item from set

2009-04-29 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: >Aahz wrote: >> In article , >> Peter Otten <__pete...@web.de> wrote: >>> >>>Here's a trick to find the actual element. I think Raymond Hettinger >>>posted an implementation

Re: Get item from set

2009-04-29 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: >Aahz wrote: >> In article , >> Peter Otten <__pete...@web.de> wrote: >>>Aahz wrote: >>>> In article , >>>> Peter Otten <__pete...@web.de> wrote: >>>>> >>

Re: ctypes

2009-04-30 Thread Aahz
In article , Lawrence D'Oliveiro wrote: > >-- >Lawrence "Death To Wildcard Imports" D'Oliveiro +1 QOTW -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the

Re: list active variables

2009-04-30 Thread Aahz
you are using them or not, by using the dir() or vars() >functions. You can also get a complete list of Python container objects with gc.get_objects(); however, that does not show you strings and ints that aren't in container objects. Still, that gets you most of it. -- Aahz (

Re: urllib2 and threading

2009-05-01 Thread Aahz
and urllib2, so its possible that >the SNAFU is quite obvious. For an example, see http://www.pythoncraft.com/OSCON2001/index.html -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Typing is cheap. Thinking is expensive." --Roy Smith -- http://

Re: for with decimal values?

2009-05-02 Thread Aahz
>but I thought I'd check (my search yielded nothing). Write a function -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Typing is cheap. Thinking is expensive." --Roy Smith -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure the memory cost in Python?

2009-05-03 Thread Aahz
hat the OP is asking to track the >size of every element returned by that? Perhaps. gc.get_objects() only returns objects tracked by GC (i.e. containers). You would need to also check all the object references held by the containers. -- Aahz (a...@pythoncraft.com) <*>

Re: Code works fine except...

2009-05-04 Thread Aahz
if doubles == True: > doubles_week = len(week)/2.0 > byes = doubles_week - courts Side note: thou shalt indent four spaces, no more, no fewer For more info, see PEP 8. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to

Re: find sublist inside list

2009-05-04 Thread Aahz
all >occurrences of ['a','c'] by 6 (result [6,6,'c','g',6]). What's your goal? After you do this once, you cannot repeat the operation with a different sublist because you are not tracking the source of the numbers. You might loo

Re: replacing numbers in LARGE MATRIX with criterium in 2 columns (a--> b)

2009-05-04 Thread Aahz
In article <68d22002-fc0a-4590-9395-c78b6ee41...@r34g2000vba.googlegroups.com>, Alexzive wrote: > >I have this matrix [20*4 - but it could be n*4 , with n~100,000] in >file "EL_list" like this: Take a look at NumPy -- Aahz (a...@pythoncraft.com) <*>

Re: Self function

2009-05-04 Thread Aahz
ot going to help >me significantly. Most times I use recursion, I think it can't be >optimized away by simple means (think about a visit to a binary tree). When have you ever had a binary tree a thousand levels deep? Consider how big 2**1000 is... -- Aahz (a...@pythoncraft.com)

Re: problem in using sendmail in multi thread

2009-05-05 Thread Aahz
In article <343747e9-549f-4336-9b15-522411a78...@x1g2000prh.googlegroups.com>, gganesh wrote: > >I'm a beginner in using Python script >I'm trying to send mails using multi-thread You need a separate SMTP connection for each thread. -- Aahz (a...@pythoncraft.com)

Re: python docs for beginner programmer?

2009-05-06 Thread Aahz
In article <81f82d8c-80fa-4ba0-a402-3a8b5757a...@s16g2000vbp.googlegroups.com>, Deep_Feelings wrote: > >anyone did that ? learning from python docs straight away ? Yes. Admittedly that was ten years ago and the docs have improved some since then.... -- Aahz (a...@pyt

Re: FLV download script works, but I want to enhance it

2009-05-07 Thread Aahz
in parallel from a single terminal window: #!/bin/bash echo "Downloading $1" wget "$1" > /dev/null 2>&1 & -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized

Re: IIR filter conversion routines for Python?

2009-05-07 Thread Aahz
le, I would be grateful for any hints helping >me to implement them myself. Even though they're not in SciPy, the mailing lists for NumPy/SciPY are probably good places to get advice. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easie

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-08 Thread Aahz
In article , Geoff Gardiner wrote: > >How do I assure myself of the integrity of a Python installation >acquired using apt-get install on Debian and Ubuntu? How important is the apt-get requirement? Building Python yourself in this situation sounds like it would be simpler/safer. --

Re: About twisted.mail.smtp.SMTPDeliveryError

2009-05-09 Thread Aahz
doing this from your local machine? If yes, you probably need to use your ISP's SMTP server; blocking non-local access is one technique for keeping zombied machines from spewing malware. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ &q

Re: Simple programme - Just want to know whether this is correct way of coding

2009-05-09 Thread Aahz
f mail. >> 1.For every mail id i send It creates a new SMTP object,in case, if i >> send to 1000 or more ids > >why should I help a spammer... ;) How many subscribers do you think there are to python-list? -- Aahz (a...@pythoncraft.com) <*> http://www.pytho

Re: Simple programme - Just want to know whether this is correct way of coding

2009-05-09 Thread Aahz
s the Right Way to do this: install your a local mailserver on your own machine and configure it to send to your external server. You should be able to pump hundreds of messages through it in minimal time. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is

Missing c.l.py posts (was Re: php to python code converter)

2009-05-10 Thread Aahz
ist but not the newsgroup. In each case, reposting as plain text fixed the problem. I suggest that anyone having similar problems on c.l.py do the same thing. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan -- http://mail.python.org/mailman/listinfo/python-list

Re: OT (humor): 'import antigravity' in action!

2009-05-10 Thread Aahz
In article , Shawn Milochik wrote: > >I know you've probably all seen this 50 times, but just in case: >http://xkcd.com/353/ > >And here's the result: >http://icanhascheezburger.com/2009/05/06/funny-pictures-behavior-20/ Thanks! -- Aahz (a...@pythoncraft.com

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-10 Thread Aahz
from test import test_socket_ssl >ImportError: cannot import name test_socket_ssl What directory are you running this from? What happens if you switch to running "python Lib/test/regrtest.py"? Taking a closer look, this looks more like a plain import error. -- Aahz (a...@pyt

Re: FLV download script works, but I want to enhance it

2009-05-10 Thread Aahz
In article , The Music Guy wrote: >On Thu, May 7, 2009 at 9:29 AM, Aahz wrote: >> >> Here's my download script to get you started figuring this out, it does >> the wget in the background so that several downloads can run in parallel >> from a single terminal wind

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Aahz
In article , Geoff Gardiner wrote: >Aahz wrote: >> >> What directory are you running this from? What happens if you switch to >> running "python Lib/test/regrtest.py"? Taking a closer look, this looks >> more like a plain import error. > >I couldn&

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread Aahz
>''', > (v['uid'],s.SID, v['uid']) > ) This will be more efficient if you do "select uid from users". -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan -- http://mail.python.org/mailman/listinfo/python-list

Switchover: mail.python.org

2009-05-12 Thread Aahz
On Monday 2009-05-11, mail.python.org will be switched to another machine starting roughly at 14:00 UTC. This should be invisible (expected downtime is less than ten minutes). -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize c

Re: Fill Javascript form

2009-05-12 Thread Aahz
e latter problem; you could also look into using WebKit. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread Aahz
In article , Rob Williscroft wrote: >Aahz wrote in news:guao50$1j...@panix3.panix.com in comp.lang.python: >> In article , >> Rob Williscroft wrote: >>> >>>db.execute( ''' >>> update "sessions"

Re: How to build Python 2.6.2 on HP-UX Itanium with thread support?

2009-05-13 Thread Aahz
d was GCC 4.2.3 You probably want to start by figuring out which threading library is being used -- Python normally wants Posix threads, but IIRC, that's not the default on HP-UX, and you may need to fix the build process to use Posix. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan -- http://mail.python.org/mailman/listinfo/python-list

Re: introspection question: get return type

2009-05-14 Thread Aahz
x27;s dynamic typing. >> >> Unless he's really trying to write in Nohtyp, > >You meant "Notype" ?-) Marco's spelling is correct. Try "Nohtyp".reverse() -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ &quo

Re: introspection question: get return type

2009-05-15 Thread Aahz
In article <4a0d2e07$0$9422$426a7...@news.free.fr>, Bruno Desthuilliers wrote: >Aahz a écrit : >> In article <4a0c6e42$0$12031$426a7...@news.free.fr>, >> Bruno Desthuilliers wrote: >>> Marco Mariani a écrit : >>>> Bruno Desthuilliers wrote: >

Re: Parsing Strings in Enclosed in Curly Braces

2009-05-16 Thread Aahz
ording, the docs will probably stay as-is. If you do come up with something better, please file it on bugs.python.org. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In 1968 it took the computing power of 2 C-64's to fly a rocket to the moon. Now,

Re: Difference between list() and [] with dictionaries

2009-05-16 Thread Aahz
l to the built-in function "list", [...] Actually, list() is not a function: >>> list Rather, ``list`` is an object (specifically a ``type`` object) with a __call__() method. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In 196

Re: Python system with exemplary organization/coding style

2009-05-16 Thread Aahz
les (although I haven't looked at the code recently, so I can't vouch for its quality). Another option would be dnspython, but that's getting a bit larger than you're looking for. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In 1968 it t

Re: Concurrency Email List

2009-05-16 Thread Aahz
chose not to create a list on python.org? I'm not joining the list because Google requires that you create a login. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In 1968 it took the computing power of 2 C-64's to fly a rocket to the moon. No

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Aahz
hat you have to digest a much bigger chunk of Java before you can start being productive. Consider how simple it is to write a non-regex grep in Python. In addition, Python's object model is simpler than Java's, not even talking about the contortions that Java's static class model force

Re: Concurrency Email List

2009-05-18 Thread Aahz
On Mon, May 18, 2009, Pete wrote: > On May 16, 2009, at 7:26 PM, Aahz wrote: >> On Sat, May 16, 2009, Pete wrote: >>> >>> python-concurre...@googlegroups.com is a new email list >>> for discussion of concurrency issues in python. It arose >>> out of

Re: How to build Python 2.6.2 on HP-UX Itanium with thread support?

2009-05-19 Thread Aahz
In article , wrote: >Aahz: >> >> You probably want to start by figuring out which threading library is >> being used -- Python normally wants Posix threads, but IIRC, that's not >> the default on HP-UX, and you may need to fix the build process to use >> Po

Re: identifying live hosts on a network

2009-05-19 Thread Aahz
In article <069f821d-1b73-4ed9-b298-09e7c0548...@p6g2000pre.googlegroups.com>, wrote: > >I am new to python and am having trouble coming up with a script that >idenifies all the live hosts on my network. First you need to define what constitutes a "live host". -- A

Re: python3 module for dbus ?

2009-05-19 Thread Aahz
-hand, but what's wrong with using 2.x? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines." --Ralph Waldo Emerson -- http://mail.python.org/mailman/listinfo/python-list

Re: Import and absolute file names, sys.path including ''... or not

2009-05-20 Thread Aahz
sent in the shell form of sys.path. Why are you calling this a malicious issue? When I do this test, I find that the current working directory's full path is prepended to sys.path, so if you're having problems, I bet that you're changing your working directory during program e

Re: Performance java vs. python

2009-05-20 Thread Aahz
relevance without an IDE automatically pumping out lots of >scaffold code for you. Well, I wouldn't go quite that far; after all, I managed to integrate BouncyCastle into a Java app without an IDE (or really knowing Java, for that matter). But you have a valid point once the excessive generali

Re: Adding a Par construct to Python?

2009-05-20 Thread Aahz
tended to be simple/easy to integrate with random C libraries. Therefore you have to write explicit code from the C side in order to drop the GIL. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "A foolish consistency is the hobgoblin of little minds, a

Re: Streaming pdf with URLLib

2009-05-21 Thread Aahz
rowser renders a >pdf just fine. So now I'm attempting to use this python app on an >external webserver, access it as a cgi, to pull the pdf, and then re- >render it, but at that point it just shows me the raw pdf in >the browser. What application type does the browser report? --

Re: python3 module for dbus ?

2009-05-22 Thread Aahz
In article <4a15b88c$0$90265$14726...@news.sunsite.dk>, Timothy Madden wrote: >Aahz wrote: >> In article <4a1281ef$0$90271$14726...@news.sunsite.dk>, >> Timothy Madden wrote: >[...] >>> Do you know if I can get dbus bindings for python3 and glib bindings

Re: Cursor movement question

2009-05-22 Thread Aahz
In article , Jive Dadson wrote: > >Gosh, you guys are slow. :-) I figured it out. Perhaps you could post the solution for posterity's sake? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "A foolish consistency is the hobgoblin of l

Re: 4 hundred quadrillonth?

2009-05-28 Thread Aahz
widely available. I even learned a little bit here and I've been following this stuff for a while (though by no means any kind of numerical expert). -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In many ways, it's a dull language, borrowin

Re: formating query with empty parameter

2009-05-29 Thread Aahz
data['g'], >] > params = ', '.join('%s' for _ in values) > query = """ > BEGIN; > INSERT INTO table > (a,b,c,d,e,f,g) > VALUES (%s); > COMMIT; > """ % params > self.db.execute(que

Syntax highlighting, round 42 (was Re: What text editor is everyone using for Python)

2009-05-29 Thread Aahz
have this discussion just a few weeks ago, when I said that highlighting made my eyes bleed? [] Oh, Gooja sez that we did it at the beginning of February, so almost four months. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ my-python-code-runs-5x-faster-this-month-thanks-to-dumping-$2K- on-a-new-machine-ly y'rs - tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Network programming ?

2009-05-29 Thread Aahz
kits available >for windows? I already knew about PyGtk and PyQT, but will they work >properly in Windows platform? Any suggestions? You likely want to use Twisted, you should at least investigate it. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ my

Re: formating query with empty parameter

2009-05-29 Thread Aahz
In article , Tim Chase wrote: >Aahz wrote: >> Tim Chase wrote: >>> To stave off this problem, I often use: >>> >>> values = [ >>>data['a'], >>>data['b'], >>>data['c'], >>>

Re: How to ask smart questions question

2009-05-30 Thread Aahz
t in the work of reading and understanding it is also unwilling to put in the effort to ask good questions. I mean, I re-read most of that essay once every couple of years myself. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ my-python-code-runs-5x-fast

<    4   5   6   7   8   9   10   11   12   13   >