Re: Inexplicable timings

2008-08-02 Thread MRAB
On Aug 2, 12:43 am, MRAB <[EMAIL PROTECTED]> wrote: > I'm looking at the implementation of regular expressions in Python and > wrote a script to test my changes. This is the script: > > import re > import time > > base = "abc" > final = "d" > > for n in [100, 1000, 1]: >     for f in [final, ""

Re: Interconvert a ctypes.Structure to/from a binary string?

2008-08-02 Thread Uwe Schmitt
On 2 Aug., 08:35, Andrew Lentvorski <[EMAIL PROTECTED]> wrote: > Basically, I'd like to use the ctypes module as a much more descriptive > "struct" module. > > Is there a way to take a ctypes.Structure-based class and convert it > to/from a binary string? > > Thanks, > -a My first idea was : f

Searching for some kind of data type

2008-08-02 Thread Giampaolo Rodola'
Hi, for an FTP server I wrote I'd need to group the FTP commands in one table that defines the command itself, the syntax string, required permission, whether it requires authorization, whether it takes argument and whether there's a need to validate the path from the argument. The more obvious way

Re:Histogram and \lambda parameter of the laplacian curve.

2008-08-02 Thread Andrew Reed
even i am trying to generate this curve. are you able to generate this curve using matplotlib, because i was thinking to write a library for it. -- Andrew. >Thanks everyone for your earlier help. >I have to plot a histogram of values lets say [0.5,0.6,0.8,0.9].I guess the >histogram would show

Concise way to format list/array to custom(hex) string

2008-08-02 Thread Kurien Mathew
Hello, What will be a concise & efficient way to convert a list/array.array of n elements into a hex string? For e.g. given the bytes [116, 111, 110, 103, 107, 97] I would like the formatted string 0x74 0x6f 0x6e 0x67 0x6b 0x61 Is there an approach better than below: hex = '' for b in bytes:

Multiline text in XML file

2008-08-02 Thread King
Is there any other way to define multiline text in a XML file: -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiline text in XML file

2008-08-02 Thread Zoltán Nagy
King wrote: > Is there any other way to define multiline text in a XML file: > > > Unless someone has to edit the XML manually (which is bad anyway): first line\nsecond line -- http://mail.python.org/mailman/listinfo/python-list

Re: Concise way to format list/array to custom(hex) string

2008-08-02 Thread John Machin
On Aug 2, 9:53 pm, Kurien Mathew <[EMAIL PROTECTED]> wrote: > Hello, > > What will be a concise & efficient way to convert a list/array.array of > n elements into a hex string? For e.g. given the bytes > [116, 111, 110, 103, 107, 97] > I would like the formatted string > 0x74 0x6f 0x6e 0x67 0x6b 0x

Re: Concise way to format list/array to custom(hex) string

2008-08-02 Thread Zoltán Nagy
Kurien Mathew írta: > Hello, > > What will be a concise & efficient way to convert a list/array.array of > n elements into a hex string? For e.g. given the bytes > [116, 111, 110, 103, 107, 97] > I would like the formatted string > 0x74 0x6f 0x6e 0x67 0x6b 0x61 > > Is there an approach better tha

Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-02 Thread ssecorp
I am not clear about the results here. from timeit import Timer import Decorators def fib(n): a, b = 1, 0 while n: a, b, n = b, a+b, n-1 return b @Decorators.memoize def fibmem(nbr): if nbr > 1: return fibmem(nbr-1) + fibmem(nbr-2) if nbr == 1: return

Re: Strong/weak typing

2008-08-02 Thread D'Arcy J.M. Cain
On Fri, 01 Aug 2008 22:47:04 -0400 Mel <[EMAIL PROTECTED]> wrote: > middle_name = raw_input ('Name?') > middle_name = middle_name.split() > middle_name = middle_name[1] > > It works, but I don't like it enough to actually use it. Especially since this works better anyway: middle_name = raw_input

Re: Concise way to format list/array to custom(hex) string

2008-08-02 Thread Grant Edwards
On 2008-08-02, Zoltán Nagy <[EMAIL PROTECTED]> wrote: > Kurien Mathew írta: >> Hello, >> >> What will be a concise & efficient way to convert a list/array.array of >> n elements into a hex string? For e.g. given the bytes >> [116, 111, 110, 103, 107, 97] >> I would like the formatted string >> 0x7

Re: Strong/weak typing

2008-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. Is this good software engineering practice, or am I missing something Pythonic? Others pointed out the wrong wording. As often, this is not a questio

Terminology (Re: Strong/weak typing)

2008-08-02 Thread Derek Martin
On Fri, Aug 01, 2008 at 03:57:10PM +, Alan Franzoni wrote: > [EMAIL PROTECTED] was kind enough to say: > > > I'm writing Python as if it were strongly typed, never recycling a > > name to hold a type other than the original type. [...] > Python *is* strongly typed. That's debatable. It depen

Unit testing type comparison

2008-08-02 Thread Mike Wyatt
I have a problem where type comparisons don't work in a second module when unit tests in the first module are run. In the example below, class Test is declared in one.py. When one.py is executed, it calls a method in two.py that imports Test from one.py. The problem is that the Test object passe

Re: Change PC to Win or Windows

2008-08-02 Thread Derek Martin
On Tue, Jul 22, 2008 at 08:19:05PM +0700, Lie Ryan wrote: > But until the dictionary is rewritten, it is incorrect usage. That's complete nonsense, much like the rest of your argument. People use words all the time that aren't even IN a dictionary. Their absence from any dictionary makes them n

Re: Concise way to format list/array to custom(hex) string

2008-08-02 Thread josh logan
On Aug 2, 9:29 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-08-02, Zoltán Nagy <[EMAIL PROTECTED]> wrote: > > > > > > > Kurien Mathew írta: > >> Hello, > > >> What will be a concise & efficient way to convert a list/array.array of > >> n elements into a hex string? For e.g. given the byte

Re: applescript/python question

2008-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I can't seem to figure this out. I just installed Python 2.5.2 a few days ago on my OS X 10.4.11 system. It runs fine and if I type "Python -V" in the Terminal it outputs "Python 2.5.2" which is correct. However, if I try to run a 'do shell script' in AppleScript w

Re: Searching for some kind of data type

2008-08-02 Thread Larry Bates
Giampaolo Rodola' wrote: Hi, for an FTP server I wrote I'd need to group the FTP commands in one table that defines the command itself, the syntax string, required permission, whether it requires authorization, whether it takes argument and whether there's a need to validate the path from the arg

ANN: pyspread 0.0.8

2008-08-02 Thread mmanns
pyspread 0.0.8 has been released. About: pyspread is a spreadsheet that accepts a pure python expression in each cell. New features: New macro dialog that allows defining python functions, which can be used in the grid. Bug fixes within the copy paste and print code. Highlights: + Numpy high pe

embedded python doesn't like socket.accept() and SegFaults

2008-08-02 Thread Riccardo Di Meo
Hi everyone, I'm practicing with embedding python into C code and i have encountered a very strange problem: I'm unable to call the "accept" method of a (correctly created) server socket without receiving a "Segmentation fault" (inside the PyObject_CallMethod). My code to be correct (at lea

Re: PIL (etc etc etc) on OS X

2008-08-02 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Decided to try to install PIL on my Mac (OS X.5). > > > > I know nothing about installing programs on Linux, > > nothing about building C programs, nothing about > > installing libraries, nothi

Re: Agnostic fetching

2008-08-02 Thread Diez B. Roggisch
Bruce Frederiksen schrieb: On Fri, 01 Aug 2008 17:05:00 -0700, jorpheus wrote: OK, that sounds stupid. Anyway, I've been learning Python for some time now, and am currently having fun with the urllib and urllib2 modules, but have run into a problem(?) - is there any way to fetch (urllib.retriev

Re: Searching for some kind of data type

2008-08-02 Thread Gary Herron
Larry Bates wrote: Giampaolo Rodola' wrote: Hi, for an FTP server I wrote I'd need to group the FTP commands in one table that defines the command itself, the syntax string, required permission, whether it requires authorization, whether it takes argument and whether there's a need to validate t

Re: PIL (etc etc etc) on OS X

2008-08-02 Thread David C. Ullrich
>From the other reply it seems I may not need to worry about any of this. Otoh I've had issues with pythonmac versus OSX versions, etc, in the past. Just in case, also in the spirit of that curious idea that learning things is good: First, it occurred to me that I've got wxPython installed and it

Re: How to request data from a lazily-created tree structure ?

2008-08-02 Thread méchoui
On 17 juin, 13:53, méchoui <[EMAIL PROTECTED]> wrote: > On Jun 17, 9:08 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > > Yes, I need to make sure my requests are properly written so that the > > > generic XPath engine does not need all the structure in memory. > > > > There are quite a

Re: PIL (etc etc etc) on OS X

2008-08-02 Thread Kevin Walzer
First, it occurred to me that I've got wxPython installed and it includes jpeg support. I don't suppose that means that wxPython has already put a libjpeg somewhere and I just need to tell PIL where it is? I doubt it. You're probably better off building libjpeg yourself. Presumably jibjpeg

Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
Beginner, so please bare with me. I'm not sure what to call what it is I'm looking for. If I have an object class, let's call it "Creature": class Creature: def __init__(self, status): self.status = "happy" def change_status(self, new_status): self.status = new_status

Re: Continually check object status

2008-08-02 Thread Gary Herron
[EMAIL PROTECTED] wrote: Beginner, so please bare with me. I'm not sure what to call what it is I'm looking for. If I have an object class, let's call it "Creature": class Creature: def __init__(self, status): self.status = "happy" def change_status(self, new_status):

Help me

2008-08-02 Thread ahmadoubay_20240
The assignment aims at enforcing the encryption and communication techniques. It helps the student in acquiring the necessary knowledge in developing client/server application and in securing data transfer using encryption techniques. Objectives can be summarized as: • Designing and im

Re: Continually check object status

2008-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Beginner, so please bare with me. I'm not sure what to call what it is I'm looking for. If I have an object class, let's call it "Creature": class Creature: def __init__(self, status): self.status = "happy" def change_status(self, new_status):

Re: Help me

2008-08-02 Thread Heiko Wundram
Am 02.08.2008, 18:02 Uhr, schrieb <[EMAIL PROTECTED]>: I'll help you by giving some good advice: homework is meant to be homework, so you should get started reading and processing the assignment. If you have any specific questions besides text comprehension, come back to ask. --- Heiko

Re: ANN: pyspread 0.0.8

2008-08-02 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: pyspread 0.0.8 has been released. About: pyspread is a spreadsheet that accepts a pure python expression in each cell. New features: New macro dialog that allows defining python functions, which can be used in the grid. Bug fixes within the copy paste and print code.

Re: Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
On Aug 2, 12:58 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Beginner, so please bare with me.  I'm not sure what to call what it > > is I'm looking for. > > > If I have an object class, let's call it "Creature": > > > class Creature: > >     def __init__(self, status):

Re: Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
On Aug 2, 1:05 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > Beginner, so please bare with me.  I'm not sure what to call what it > > is I'm looking for. > > > If I have an object class, let's call it "Creature": > > > class Creature: > >     def __init__(

Re: Searching for some kind of data type

2008-08-02 Thread Giampaolo Rodola'
On 2 Ago, 18:18, Gary Herron <[EMAIL PROTECTED]> wrote: > Larry Bates wrote: > > Giampaolo Rodola' wrote: > >> Hi, > >> for an FTP server I wrote I'd need to group the FTP commands in one > >> table that defines the command itself, the syntax string, required > >> permission, whether it requires au

RE: Continually check object status

2008-08-02 Thread Edwin . Madari
updated creature running in its own thread will get you started. try it for yourself, change sleep times per your need. import os, sys, threading, time class Creature: def __init__(self, status): self.status = status self.state = 'run' def start(self): self.athread = thr

Re: interpreter vs. compiled

2008-08-02 Thread Tim Roberts
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Thu, 31 Jul 2008 06:17:59 GMT, Tim Roberts <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > >> And again, I never said that it did. CPython is an interpreter. the >> user's code is never translated into machine language. > >

Re: Searching for some kind of data type

2008-08-02 Thread Paul Hankin
On Aug 2, 1:12 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > for an FTP server I wrote I'd need to group the FTP commands in one > table that defines the command itself, the syntax string, required > permission, whether it requires authorization, whether it takes > argument and whether

Re: interpreter vs. compiled

2008-08-02 Thread Tim Roberts
castironpi <[EMAIL PROTECTED]> wrote: > >And furthermore, I think I'm getting >confused about what exactly constitutes an interpreter: it is whether >there is a process that runs product instructions, or the product >instructions can run standalone. I would take 'compiler' to mean, >something that

Re: Swap memory in Python ? - three questions

2008-08-02 Thread Tim Roberts
John Nagle <[EMAIL PROTECTED]> wrote: >Robert LaMarca wrote: >> >> I am using numpy and wish to create very large arrays. My system is AMD 64 >> x 2 Ubuntu 8.04. Ubuntu should be 64 bit. I have 3gb RAM and a 15 GB swap >> drive. > > Does a full 64-bit version of CPython, one where all point

Re: Newbie Python questions

2008-08-02 Thread Tim Roberts
binaryjesus <[EMAIL PROTECTED]> wrote: > >One great open source GUI package that you left out is GTK ie. pygtk. >i cant compare it with wx as i have never used it but isay its much >better than QT. > >Anyway for ur q if u want to compair qt n wx. QT should be faster coz >it has a better documentati

Re: Continually check object status

2008-08-02 Thread Diez B. Roggisch
I was afraid that someone was going to mention threading. I have read about it before but not been able to do much with it. My ultimate goal is to create some sort of tamagotchi style virtual pet to interact with. Over time it gets hungry or bored, but the process can be fixed by a user "feed

Re: interpreter vs. compiled

2008-08-02 Thread Paul Boddie
On 2 Aug, 08:33, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 1, 5:24 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > > > a + b # in Python > > > > ...is not sufficiently represented by... > > > > ldr r1, a > > ldr r2, b > > add r3, r1, r2 > > > > ...in some assembly language (and the result

I donä't get while-loops

2008-08-02 Thread ssecorp
in read2 it never quits when I write quit, why? def read(): expr = raw_input("Lisp> ") if expr != "quit": print parse(expr) read() else: print "Good session!" def read2(): expr = "" while expr != "quit": expr = raw_input("Lisp> ") print

raw_input on several lines

2008-08-02 Thread TP
Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. Thanks Julien -- python -c "print ''.

Re: I donä't get while-loops

2008-08-02 Thread Stefaan Himpe
def read2(): expr = "" while expr != "quit": expr = raw_input("Lisp> ") print parse(expr) read2() ^ print "Good session!" You shouldn't call read2() inside read2()... just remove that line and retry... Each time you call read2() recursivel

Re: I donä't get while-loops

2008-08-02 Thread Larry Bates
ssecorp wrote: in read2 it never quits when I write quit, why? def read(): expr = raw_input("Lisp> ") if expr != "quit": print parse(expr) read() else: print "Good session!" def read2(): expr = "" while expr != "quit": expr = raw_input("Lisp>

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-02 Thread Stefaan Himpe
Nothing weird about this ... The difference will become larger as your input value becomes larger. You can easily understand why if you try to calculate fib(10) by hand, i.e. work through the algorithm with pencil and paper, then compare the work you have to do to the memoized version which just

Re: raw_input on several lines

2008-08-02 Thread Larry Bates
TP wrote: Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. Thanks Julien Just put raw

Re: I donä't get while-loops

2008-08-02 Thread ssecorp
oops, embarrassing, I created the while loop not to use recursion then I still did... -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input on several lines

2008-08-02 Thread Stefaan Himpe
How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. I don't think you can change raw_input's behaviour in this respect, but you could build something yourself that's based on interpretation o

Re: raw_input on several lines

2008-08-02 Thread David
TP wrote: Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. Thanks Julien How abou

why goes the time change after import statement ?

2008-08-02 Thread binaryjesus
hi i am working on a S3 project and facing a really weird problem! take a look at the following import statements and the time output >>> import time >>> time.strftime("%a, %d %b %Y %X GMT", time.gmtime()) 'Sat, 02 Aug 2008 20:21:56 GMT' # OK >>> import pygtk >>> time.strftime("%a, %d %b %Y %X G

Re: why goes the time change after import statement ?

2008-08-02 Thread Paul Hankin
On Aug 2, 10:35 pm, binaryjesus <[EMAIL PROTECTED]> wrote: > hi i am working on a S3 project and facing a really weird problem! > take a look at the following import statements and the time output > > >>> import time > >>> time.strftime("%a, %d %b %Y %X GMT", time.gmtime()) > > 'Sat, 02 Aug 2008 20

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-02 Thread Rob Williscroft
Stefaan Himpe wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Nothing weird about this ... > The difference will become larger as your input value becomes larger. > > You can easily understand why if you try to calculate fib(10) by hand, > i.e. work through the algorithm with pencil and p

Re: Help me

2008-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: The assignment aims at enforcing the encryption and communication techniques. It helps the student in acquiring the necessary knowledge in developing client/server application and in securing data transfer using encryption techniques. Nice! Finally someone who upf

SMTP via GMAIL

2008-08-02 Thread mmm
After reading about and using the smtplib module, I thought code such as below would ignore the 'Cc: ' body line below when sending messages and instead simply use the RECEIVERS list session = smtplib.SMTP(SMTPserver,port) session.set_debuglevel(1) session.ehlo(SMTPuser) # say hello session.start

Re: embedded python doesn't like socket.accept() and SegFaults

2008-08-02 Thread Riccardo Di Meo
Solved (with the help of the guys on #python on freenode). Long story short: i forgot the static in the function definitions and the libc's "accept" got replaced with mine... Riccardo Di Meo wrote: Hi everyone, I'm practicing with embedding python into C code and i have encountered a very

Re: Agnostic fetching

2008-08-02 Thread Michael Torrie
jorpheus wrote: > OK, that sounds stupid. Anyway, I've been learning Python for some > time now, and am currently having fun with the urllib and urllib2 > modules, but have run into a problem(?) - is there any way to fetch > (urllib.retrieve) files from a server without knowing the filenames? > For

RE: applescript/python question

2008-08-02 Thread jyoung79
Hi Diez, Thanks for your reply. I gave this a try too, but it doesn't seem to work either. However, a gentleman just emailed me off-list recommending to use the full path to Python that is in /usr/local/bin. This is where Python 2.5 looks to be installed rather than Python 2.3 which is in /u

Re: current week / weeks in year - best practice

2008-08-02 Thread Tim Roberts
Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > >what if i know current context week = 20 (example), what would be the >best way to get datetime objects for first and last day of current >context week? >by "current context week" i don't mean current week for current year >but current week when progra

Re: base-96

2008-08-02 Thread Tim Roberts
Kless <[EMAIL PROTECTED]> wrote: > >I think that would be very interesting thay Python would have a module >for working on base 96 too. [1] Well, then, write one. However, I'm not sure I see the point. Base 64 is convenient because 6 bits becomes 8 bits exactly, so 3 bytes translates exactly to

Re: Interconvert a ctypes.Structure to/from a binary string?

2008-08-02 Thread Andrew P. Lentvorski, Jr.
On Aug 1, 11:35 pm, Andrew Lentvorski <[EMAIL PROTECTED]> wrote: > Basically, I'd like to use the ctypes module as a much more descriptive > "struct" module. > > Is there a way to take a ctypes.Structure-based class and convert it > to/from a binary string? > > Thanks, > -a After chugging through

Re: interpreter vs. compiled

2008-08-02 Thread castironpi
On Aug 2, 2:02 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > >And furthermore, I think I'm getting > >confused about what exactly constitutes an interpreter: it is whether > >there is a process that runs product instructions, or the product > >instructions c

Re: base-96

2008-08-02 Thread Terry Reedy
see http://en.wikipedia.org/wiki/Base-85 for something more practical -- http://mail.python.org/mailman/listinfo/python-list

Re: base-96

2008-08-02 Thread Tim Roberts
Kless <[EMAIL PROTECTED]> wrote: >I think that would be very interesting thay Python would have a module >for working on base 96 too. [1] > >It could be converted to base 96 the digests from hashlib module, and >random bytes used on crypto (to create the salt, the IV, or a key). > >As you can see

Re: ANN: pyspread 0.0.8

2008-08-02 Thread mmanns
On Sat, 02 Aug 2008 13:39:25 -0400 "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > pyspread 0.0.8 has been released. > Are you planning any documentation? Actually, yes. 0.0.10 will feature some docs. Any help writing and doing the layout is highly appreciated ;-)

Re: I donä't get while-loops

2008-08-02 Thread Tyler Breisacher
You're actually calling the read2() function from within read2(). This is called recursion, and it is *not* what you want in this case, since it unnecessarily fills up your call stack. Remember that a while loop automatically goes back to the top without you having to re-call your function. I w

Teething troubles with Python on a Mac

2008-08-02 Thread Thomas Philips
I've got a new iMac, have installed Python 2.5.2 on it, and am now trying to run my existing Python programs on it (these are typically number crunching programs that I run from IDLE). Some things work, while others don't, and as this is my first time grappling with Unix and MacOS X, I appreciate s

Re: Help me

2008-08-02 Thread Steven D'Aprano
On Sat, 02 Aug 2008 20:02:42 +0300, ahmadoubay_20240 wrote: > The assignment aims at enforcing the encryption and communication > techniques. It helps the student in acquiring the necessary knowledge in > developing client/server application and in securing data transfer using > encryption techniq

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-02 Thread Steven D'Aprano
On Sat, 02 Aug 2008 06:02:02 -0700, ssecorp wrote: > I am not clear about the results here. > > > from timeit import Timer > import Decorators > > def fib(n): > a, b = 1, 0 > while n: > a, b, n = b, a+b, n-1 > return b [...] > s = 100 > > t1 = Timer('fib(s)', 'from __main

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-02 Thread Steven D'Aprano
On Sat, 02 Aug 2008 16:14:11 -0500, Rob Williscroft wrote: > Stefaan Himpe wrote in news:[EMAIL PROTECTED] in > comp.lang.python: > >> Nothing weird about this ... >> The difference will become larger as your input value becomes larger. >> >> You can easily understand why if you try to calculate

Re: Teething troubles with Python on a Mac

2008-08-02 Thread greg
Thomas Philips wrote: Question 1: How can I locate the Python installation? There a few files under Applications > MacPython 2.5, but this is clearly not the entire installation. Have a look in /Library/Frameworks/Python.framework/Versions/2.5 > But I do not seem to be able to see the seq

Re: why goes the time change after import statement ?

2008-08-02 Thread binaryjesus
On Aug 3, 1:46 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Aug 2, 10:35 pm, binaryjesus <[EMAIL PROTECTED]> wrote: > > > > > hi i am working on a S3 project and facing a really weird problem! > > take a look at the following import statements and the time output > > > >>> import time > > >>> ti

Re: SMTP via GMAIL

2008-08-02 Thread binaryjesus
i have a lot of experience in gmail. i use it to store 100GB's of server backup on it. the form: field will be equal to the gmail acc u login with. you are not clear with ur cc: so i cant offer any help on it. but u can include multiple addresses in the To: and use Bcc: since python doesnt inclu

Re: raw_input on several lines

2008-08-02 Thread Raja Baz
On Sat, 02 Aug 2008 21:58:09 +0200, TP wrote: > Hi everybody, > > When using raw_input(), the input of the user ends when he types Return > on his keyboard. > How can I change this behavior, so that another action is needed to stop > the input? For example, CTRL-G. It would allow the user to inpu

Re: Multiline text in XML file

2008-08-02 Thread Stefan Behnel
King wrote: > Is there any other way to define multiline text in a XML file: > > > Yes, without the CDATA, for example. XML doesn't treat line ending characters any different from other characters. I have no idea what you are trying to achieve since you didn't tell us (and this newsgroup seems