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, ""
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
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
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
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:
Is there any other way to define multiline text in a XML file:
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
[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
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
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
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
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
[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
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
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
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
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
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
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
>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
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
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
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
[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):
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
[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):
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
[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.
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):
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__(
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
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
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.
>
>
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
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
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
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
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
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
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
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 ''.
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
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>
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
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
oops, embarrassing, I created the while loop not to use recursion then
I still did...
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
[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
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
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
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
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
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
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
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
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
see
http://en.wikipedia.org/wiki/Base-85
for something more practical
--
http://mail.python.org/mailman/listinfo/python-list
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
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 ;-)
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
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
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
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
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
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
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
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
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
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
78 matches
Mail list logo