On Feb 15, 6:48 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 15 Feb 2008 20:24:19 -0200, 7stud <[EMAIL PROTECTED]>
> escribió:
>
>
>
> > My question pertains to this example:
>
> > #!/usr/bin/env python
>
> > import socket, sys, time
>
> > host = sys.argv[1]
> > textport = sys.arg
Stefan Behnel wrote:
> [EMAIL PROTECTED] wrote:
>> I have a single unicode file that has descriptions of hundreds of
>> objects. The file fairly resembles HTML-EXAMPLE pasted below.
>>
>> I need to parse the file in such a way to extract data out of the html
>> and to come up with a tab separate
Sunday 23 December 2007 Tarihinde 03:56:05 yazmıştı:
> Hello,
>
> just to recap: last time I asked how to do an interprocess
> communitation, between one Manager process (graphical beckend) and
> some Worker processes.
Why just dont use dbus , and then have a drink :)
--
http://mail.python.org/mai
I want to play .XM music using Python, now I found ufmod
http://ufmod.sourceforge.net
It only provide a ufmod.lib to be compiled in C/C++/BASIC, and Python
as a scripting language could not handle these static libraries. What
could I do to with these .lib files?
Cheers
--
http://mail.python.org
I've now crawled the meta infor,but with multi name all means the same
thing,
such as MS,microsoft,microsoft corporation all means the same thing,
how can I mapping words like this to the same thing?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>
> ...Missing that, I think dict() and set() and
> tuple() and list() look better than using {} for the empty dict and
> {/} for the empty set and () for empty tuple (or {} for the empty dict
> and set() for the empty set).
The problem I have with them is in no way the l
On Fri, 15 Feb 2008 17:30:03 -0800, Jeff Schwab wrote:
>> But good advice becomes a superstition when it becomes treated as a
>> law: "never test floats for equality". That's simply not true. For
>> example, floats are exact for whole numbers, up to the limits of
>> overflow.
>
> That's not true.
Boris Borcic wrote:
> [EMAIL PROTECTED] wrote:
>> ...Missing that, I think dict() and set() and
>> tuple() and list() look better than using {} for the empty dict and
>> {/} for the empty set and () for empty tuple (or {} for the empty dict
>> and set() for the empty set).
>
> The problem I have w
On Sat, 16 Feb 2008 01:35:32 -0800, Mr Shore wrote:
> I've now crawled the meta infor,but with multi name all means the same
> thing,
> such as MS,microsoft,microsoft corporation all means the same thing, how
> can I mapping words like this to the same thing?
The same way you would map anything:
Mr Shore wrote:
> I've now crawled the meta infor,but with multi name all means the same
> thing,
> such as MS,microsoft,microsoft corporation all means the same thing,
> how can I mapping words like this to the same thing?
http://docs.python.org/lib/typesmapping.html
regards
Steve
--
Steve Ho
Python_Doctor schrieb:
> I inherited a piece of python code which imports "MyUtils" i.e. it has
> a line:
>
> import MyUtils
>
> When I execute the code I get:
>
> ImportError: No module named MyUtils
>
> I assume the code is looking for another module called MyUtils.py. Is
> this a standard Py
est schrieb:
> I want to play .XM music using Python, now I found ufmod
> http://ufmod.sourceforge.net
>
> It only provide a ufmod.lib to be compiled in C/C++/BASIC, and Python
> as a scripting language could not handle these static libraries. What
> could I do to with these .lib files?
I'm not
On Sat, 16 Feb 2008 05:21:22 -0500, Steve Holden wrote:
> Before you have any code is exactly the *wrong* time to be considering
> performance.
Well, not really.
Don't we already tell people "don't use repeated string concatenation,
because it is slow", even *before* we know whether it is a bot
On Feb 16, 8:25 am, Jonathan Lukens <[EMAIL PROTECTED]> wrote:
> > What would you like to see instead?
>
> I had mostly just expected that there was some method that would
> return each entire match as an item on a list. I have this pattern:
>
> >>> import re
> >>> corporate_names =
> >>> re.comp
On Feb 12, 2:45 am, erikcw <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to devise a scheme to encrypt/obfuscate a short string that
> basically contains the user's username and record number from the
> database. I'm using this encrypted string to identify emails from a
> user. (the string will
Essence:
* Trac is deficient, cause of "proud to be an egoism driven amateur"
developers
* Python and it's communities is excellent for learning. Not
programming, but to "learn from deficiency", community organization,
transparency, efficiency etc.!
* Do it in perl, if you need something more '
Lie wrote:
> There is a simple encryption, called ROT13 (Rotate 13). This is
> very unsecure for any cryptographical purpose,
For enhanced security use TROT13 (triple ROT13).
> but enough to make uninformed user to think it's just a random
> piece of letters.
Security by obscurity doesn't wor
John,
> (1) raw string for improved legibility
> ru'(?u)\b([á-ñ]{2,}\s+)([<<"][Á-Ñá-ñ]+)(\s*-?[Á-Ñá-ñ]+)*([>>"])'
This actually escaped my notice after I had posted -- the letters with
diacritics are incorrectly decoded Cyrillic letters -- I suppose I
code use the Unicode escape sequences (the se
Here is the example above converted to a more straightforward udp
client that isolates the part I am asking about:
import socket, sys
host = 'localhost' #sys.argv[1]
port = 3300
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM
En Sat, 16 Feb 2008 05:56:39 -0200, 7stud <[EMAIL PROTECTED]>
escribi�:
>> > while 1:
>> > buf = s.recv(2048)
>> > if not len(buf):
>> > break
>> > print "Received: %s" % buf
>>
>> > As far as I can tell, the if statement:
>>
>> > if not len(buf):
>> > break
>>
>> > does n
Ilias Lazaridis wrote:
[...]
> Of course I'll not stay with trac, I'll leave the sinking ship, I've
> prepare long time ago to do so, step by step. An will migrate step by
> step away from trac and python - toward an own implementation based
> on...
>
> perl and it's libraries.
>
I'm sure you wil
On 16.02.2008 13:16, Ilias Lazaridis wrote:
Oh, it's him again. Please do not respond.
http://dev.eclipse.org/newslists/news.eclipse.foundation/msg00167.html
http://www.encyclopediadramatica.com/index.php/Ilias
Cheers
robert
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Boris Borcic wrote:
>> [EMAIL PROTECTED] wrote:
>>> ...Missing that, I think dict() and set() and
>>> tuple() and list() look better than using {} for the empty dict and
>>> {/} for the empty set and () for empty tuple (or {} for the empty dict
>>> and set() for the empty set)
Hello,
I'm brand new to wxpython, trying to implement some code to add rows
in the GUI dynamically. What I want to do is when you click on the
Add Row button, a new row gets added after the first row, before the
button. This code adds a row in the right place, but it overlaps the
button because
On Sat, 16 Feb 2008 15:37:16 +, T_T wrote:
> Hi,
>
> I'm just starting to learn some Python basics and are not familiar with
> file handling.
> Looking for a python scrip that zips files. So aaa.xx bbb.yy ccc.xx
> should be zipped to aaa.zip bbb.zip ccc.zip
>
> I haven't been able to type m
Boris Borcic wrote:
> Steve Holden wrote:
[...]
>> Before you have any code is exactly the *wrong* time to be considering
>> performance.
>
> Yeah right, [] and {} are premature optimizations, one should always use
> list()
> or dict() unless one detains figures to justify the more exotic forms
Hi this is the code which I wrote till now. It is giving permission
denied error for sub folders of source directory. Does anyone have any
idea what is going wrong
import os
import shutil
def copytreetosinglefolder(src, dst):
names = os.listdir(src)
if (os.path.isdir(dst)==False):
os.mkdir(dst)
I know there is an easy way to do this, but I can't figure it out, how
do I get the color of a pixel? I used the ImageGrab method and I want
to get the color of a specific pixel in that image. If you know how
to make it only grab that pixel, that would also be helpful.
Basically I'm trying to mak
Hi,
I'm just starting to learn some Python basics and are not familiar with
file handling.
Looking for a python scrip that zips files.
So aaa.xx bbb.yy ccc.xx should be zipped to aaa.zip bbb.zip ccc.zip
I haven't been able to type more than 'import gzip'..
Just a script I need for practica
What are the reasonable current day choices and best bets for the future
when doing SOAP programming in Python? SOAP batteries do not appear to
be in the standard Python distribution.
Most of the SOAP related information I have been able to find on the web
is from 2001-2002. I am not sure if som
Adam W. wrote:
> I know there is an easy way to do this, but I can't figure it out, how
> do I get the color of a pixel? I used the ImageGrab method and I want
> to get the color of a specific pixel in that image. If you know how
> to make it only grab that pixel, that would also be helpful.
> Ba
Ilias Lazaridis wrote:
> Essence:
Spam spam spam spam...
I just looked at your resume. What is Abstract Project Management?
--
http://mail.python.org/mailman/listinfo/python-list
Robert Klemme wrote:
> On 16.02.2008 13:16, Ilias Lazaridis wrote:
>
>
>
> Oh, it's him again. Please do not respond.
>
> http://dev.eclipse.org/newslists/news.eclipse.foundation/msg00167.html
> http://www.encyclopediadramatica.com/index.php/Ilias
Thank you. I didn't recognize his name at fi
On Feb 16, 10:04 am, Vamp4L <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm brand new to wxpython, trying to implement some code to add rows
> in the GUI dynamically. What I want to do is when you click on the
> Add Row button, a new row gets added after the first row, before the
> button. This code
On Feb 15, 2:28 pm, "W. Watson" <[EMAIL PROTECTED]> wrote:
> I want to allow a user who is looking at a graphic to be able to right-click
> on the graphic to produce a menu of choices.
>
> Does the PIL have something, a class or whatever? What in Tkinter would be
> useful for this purpose? GTK?
>
>
>> I'm just starting to learn some Python basics and are not familiar with
>> file handling.
>> Looking for a python scrip that zips files. So aaa.xx bbb.yy ccc.xx
>> should be zipped to aaa.zip bbb.zip ccc.zip
>>
>> I haven't been able to type more than 'import gzip'..
Well, you ask for zip fil
In article <[EMAIL PROTECTED]>,
Jeff Schwab <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] wrote:
>> On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote:
>>> In article <[EMAIL PROTECTED]>,
>>> Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>>>
On Tue, 12 Feb 2008 10:05:59 -0800, castironpi wrote
On Feb 16, 6:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> Please use a mailer/news-agent that preserves whitespace on the
> beginning of the line, and make sure you don't use tabs but spaces to
> indent.
>
> Apart from that - why don't you use shutil.copytree? Regarding the error
> - ar
Would all these problems with floating points be a rational reason to
add rational numbers support in Python or Py3k? (pun not intended)
I agree, there are some numbers that is rationals can't represent
(like pi, phi, e) but these rounding problems also exist in floating
points, and rational numbe
IOW, is there a "linker" for python? I've written a program comprised of about
five .py files. I'd like to find a way to combine them into a single
executable. Obviously, I could hand-edit them into a single .py file, but
I'm looking for a way to keep them as seperate files for development but
d
Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> Jeff Schwab <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote:
In article <[EMAIL PROTECTED]>,
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Tue, 12 Feb 2008 10:05:59
On Feb 16, 12:15 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Ilias Lazaridis wrote:
> > Essence:
>
> Spam spam spam spam...
>
> I just looked at your resume. What is Abstract Project Management?
A branch of Analysis Paralysis Vaporware.
--
http://mail.python.org/mailman/listinfo/python-list
Lalit Krishna schrieb:
> Hi this is the code which I wrote till now. It is giving permission
> denied error for sub folders of source directory. Does anyone have any
> idea what is going wrong
>
> import os
> import shutil
> def copytreetosinglefolder(src, dst):
> names = os.listdir(src)
> if (o
Lie wrote:
> Would all these problems with floating points be a rational reason to
> add rational numbers support in Python or Py3k? (pun not intended)
>
> I agree, there are some numbers that is rationals can't represent
> (like pi, phi, e) but these rounding problems also exist in floating
> poi
On Feb 16, 1:35 pm, Lie <[EMAIL PROTECTED]> wrote:
> Would all these problems with floating points be a rational reason to
> add rational numbers support in Python or Py3k? (pun not intended)
It's already in the trunk! Python will have a rational type (called
Fraction) in Python 2.6 and Python 3.
>
> seems to do the trick for me.
>
> -tkc
Thanks! Works indeed. Strange thing is though, the files created are the
exact size as the original file. So it seems like it is zipping without
compression.
--
http://mail.python.org/mailman/listinfo/python-list
I'm at the last stage of my project and the only thing left to do is
trigger a mouse click. I did some searching around for example code
and stumped upon SendInput
http://msdn2.microsoft.com/en-us/library/ms646310.aspx
. However I was not able to find example code for python USING
SendInput, and
On Feb 17, 1:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> > Would all these problems with floating points be a rational reason to
> > add rational numbers support in Python or Py3k? (pun not intended)
>
> > I agree, there are some numbers that is rationals can't represent
> > (like
Edward A. Falk schrieb:
> IOW, is there a "linker" for python? I've written a program comprised of
> about
> five .py files. I'd like to find a way to combine them into a single
> executable. Obviously, I could hand-edit them into a single .py file, but
> I'm looking for a way to keep them as s
> Thanks! Works indeed. Strange thing is though, the files created are the
> exact size as the original file. So it seems like it is zipping without
> compression.
The instantiation of the ZipFile object can take an optional
parameter to control the compression. The zipfile module only
suppor
[EMAIL PROTECTED] wrote:
>> IHNTA, IJWTSA
>> Thanks, but... That defines IHNTA, but not IJWTSA or IJWTW. "I just
>> want to say...?" "I just want to watch?"- Hide quoted text -
>
> I just want to what?
Exactly!
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 16, 1:35 pm, Lie <[EMAIL PROTECTED]> wrote:
> Would all these problems with floating points be a rational reason to
> add rational numbers support in Python or Py3k? (pun not intended)
Forgot to give the link:
http://docs.python.org/dev/library/fractions.html
Mark
--
http://mail.python.o
On Feb 17, 2:26 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> On Feb 16, 1:35 pm, Lie <[EMAIL PROTECTED]> wrote:
>
> > Would all these problems with floating points be a rational reason to
> > add rational numbers support in Python or Py3k? (pun not intended)
>
> It's already in the trunk! Pytho
> IHNTA, IJWTSA
>
> Thanks, but... That defines IHNTA, but not IJWTSA or IJWTW. "I just
> want to say...?" "I just want to watch?"- Hide quoted text -
I just want to what?
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 16, 12:35�pm, Lie <[EMAIL PROTECTED]> wrote:
> Would all these problems with floating points be a rational reason to
> add rational numbers support in Python or Py3k? (pun not intended)
>
> I agree, there are some numbers that is rationals can't represent
> (like pi, phi, e) but these roundi
Gary Herron:
> Try image.getpixel((x,y)) to retrieve the pixel at (x,y).
If the OP needs to access many pixels, then he can use the load()
method on the image object, and then read/write pixels (tuples of 3
ints) using getitem []
import Image
im = Image
img = im.load()
img[x,y] = ...
... = im
On Feb 15, 11:50 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> Dan Bishop wrote:
> > On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote:
> >> Alright so me and my friend are having argument.
>
> >> Ok the problem we had been asked a while back, to do a programming
> >> exercise (in college)
> >>
On Feb 16, 1:39 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Aahz wrote:
> > In article <[EMAIL PROTECTED]>,
> > Jeff Schwab <[EMAIL PROTECTED]> wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
> Steven D'Ap
> f = zipfile.ZipFile(zipfilename, 'w',
> compression=zipfile.ZIP_DEFLATED)
>
> -tkc
Adding the compression rule works great, thanks again!
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 17, 6:52 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > Thanks! Works indeed. Strange thing is though, the files created are the
> > exact size as the original file. So it seems like it is zipping without
> > compression.
>
> The instantiation of the ZipFile object can take an optional
> param
I ran the following in the python shell:
>>> import timeit
>>> storeit=timeit.Timer('s=len(li);s==1000', 'li=range(1000)')
>>> checkit=timeit.Timer('len(li)==1000', 'li=range(1000)')
>>> listofresults=[(min(storeit.repeat(5)),min(checkit.repeat(5))) for i in
>>> xrange(20)]
listofresults contain
Carl Banks wrote:
> On Feb 16, 1:39 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
>> Aahz wrote:
>>> In article <[EMAIL PROTECTED]>,
>>> Jeff Schwab <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
> On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote:
>> In article <[EMAIL PROTECTED]
Thanks Mike,
Simple enough! I was wandering about the close method too, I had to
hack that together from what I knew about python already. I'll be
sure to join that mailing list.
--
http://mail.python.org/mailman/listinfo/python-list
> OP stated requirements were to move all the files into a single
> folder. Copytree will preserve the directory structure from the source
> side of the copy operation.
well, it would be "copying [not moving] files through Python",
but if the desire is to flatten the tree into a single directory,
["Followup-To:" header set to comp.lang.perl.misc.]
Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Robert Klemme wrote:
>> On 16.02.2008 13:16, Ilias Lazaridis wrote:
>>
>>
>>
>> Oh, it's him again. Please do not respond.
>>
>> http://dev.eclipse.org/newslists/news.eclipse.foundation/msg00167.htm
On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
> Although rationals have its limitations too, it is a much
> better choice compared to floats/Decimals for most cases.
Maybe that's true for your use cases, but it's not true for most cases
in general.
Rationals are pretty useless for almost any
On Feb 16, 6:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> Here is the example above converted to a more straightforward udp
> client that isolates the part I am asking about:
>
> import socket, sys
>
> host = 'localhost'
On Feb 16, 6:32 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> >> That example is plain wrong; looks like some TCP code but with
> >> SOCK_STREAM
> >> blindy replaced with SOCK_DGRAM. connect, sendall and recv are not used
> >> for UDP; sendto and recvfrom are used instead. There are so
On Feb 16, 3:48 pm, Dan Bishop <[EMAIL PROTECTED]> wrote:
> On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote:
>
>
>
> > Alright so me and my friend are having argument.
>
> > Ok the problem we had been asked a while back, to do a programming
> > exercise (in college)
> > That would tell you how
Diez B. Roggisch wrote:
> Edward A. Falk schrieb:
> > IOW, is there a "linker" for python? I've written a
> > program comprised of about five .py files. I'd like to
> > find a way to combine them into a single executable.
> > Obviously, I could hand-edit them into a single
> > .py file, but I'm
Hi all,
Recently there was a thread about function composition in Python (and
this was probably not the first). The fast way to create a
(anonymous) composite function
f1 o f2 o ... o fn
in Python is via
lambda x: f1(f2(...fn(x)...)),
but according to some this is neither the most c
Carl Banks <[EMAIL PROTECTED]> writes:
> Rationals are pretty useless for almost any extended calculations,
> since the denominator tends to grow in size till it's practically
> unusbale, which means you have to periodically do non-exact reductions
> to keep things running, and if you do that you m
On Feb 17, 4:25 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
>
> > Although rationals have its limitations too, it is a much
> > better choice compared to floats/Decimals for most cases.
>
> Maybe that's true for your use cases, but it's not true fo
On Sat, 16 Feb 2008 11:14:10 -0500, Steve Holden wrote:
> It's about four years since I wrote a program that ran for more than 24
> hours.
Let me guess... and then you discovered ''.join(['x', 'y']) instead of
'x'+'y'?
*wink*
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> On Feb 15, 11:50 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
>> Dan Bishop wrote:
>>> On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote:
[...]
What are everyone else's thoughts on this?
>>> days_in_month = lambda m: m - 2 and 30 + bool(1 << m & 5546) or 28
>> Eleg
If I have a class static variable it doesn't show up in the __dict__ of
an instance of that class.
class C:
n = 4
x = C()
print C.__dict__
{'__module__': '__main__', '__doc__': None, 'n': 4}
print x.__dict__
{}
This behavior makes sense to me as n is not encapsulated in x's
namespace but w
Carl Banks wrote:
> On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
>> Although rationals have its limitations too, it is a much
>> better choice compared to floats/Decimals for most cases.
>
> Maybe that's true for your use cases, but it's not true for most cases
> in general.
>
> Rationals a
> days_in_month = lambda m: m - 2 and 31 - ((m + 9) % 12 % 5 % 2) or 28
>
> the guts of which is slightly more elegant than the ancient writing
> from which it was derived:
Lacks citation.
--
http://mail.python.org/mailman/listinfo/python-list
Zack schrieb:
> If I have a class static variable it doesn't show up in the __dict__ of
> an instance of that class.
>
> class C:
>n = 4
>
> x = C()
> print C.__dict__
> {'__module__': '__main__', '__doc__': None, 'n': 4}
> print x.__dict__
> {}
>
> This behavior makes sense to me as n is n
This would be Off Topic, but it is for PyCon, so there will be lots of Python
side effects.
I am looking for help with a Video4Linux2 driver, which is C code.
I am trying to get a piece of hardware working with trascode.
hardware: http://www.epiphan.com/products/product.php?pid=66
http://www.tra
On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Recently there was a thread about function composition in Python (and
> this was probably not the first). The fast way to create a
> (anonymous) composite function
>
> f1 o f2 o ... o fn
>
> in Python is via
>
>
Brian Smith schrieb:
> Diez B. Roggisch wrote:
>> Edward A. Falk schrieb:
>>> IOW, is there a "linker" for python? I've written a
>>> program comprised of about five .py files. I'd like to
>>> find a way to combine them into a single executable.
>>> Obviously, I could hand-edit them into a single
Diez B. Roggisch wrote:
> Zack schrieb:
>> If I have a class static variable it doesn't show up in the __dict__
>> of an instance of that class.
>>
>> class C:
>>n = 4
>>
>> x = C()
>> print C.__dict__
>> {'__module__': '__main__', '__doc__': None, 'n': 4}
>> print x.__dict__
>> {}
>>
>> This
Diez B. Roggisch wrote:
> Brian Smith wrote:
> > I would be interested in a program that can combine
> > multiple modules into a single module, which removes
> > all the inter-package imports and fixes other
> > inter-module references, like Haskell
> > All-in-One does for Haskell:
> > http://www
On Feb 17, 9:57 am, [EMAIL PROTECTED] wrote:
> > days_in_month = lambda m: m - 2 and 31 - ((m + 9) % 12 % 5 % 2) or 28
>
> > the guts of which is slightly more elegant than the ancient writing
> > from which it was derived:
>
> Lacks citation.
Maxima mea culpa.
Pages 294-295 (in particular formul
> def compose( funcs ):
> def reccompose( *args ):
> return compose( funcs[:-1] )( funcs[-1]( *args ) ) if funcs else
> funcs[0]( *args )
> return reccompose- Hide quoted text -
Which was, if funcs> 1, which is len( funcs )> 1.
>>> [1]>0
Traceback (most recent call last):
File "", li
En Sat, 16 Feb 2008 17:08:59 -0200, Adam W. <[EMAIL PROTECTED]>
escribi�:
> I'm at the last stage of my project and the only thing left to do is
> trigger a mouse click. I did some searching around for example code
> and stumped upon SendInput
> http://msdn2.microsoft.com/en-us/library/ms6463
On Feb 16, 5:51 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
> >> Although rationals have its limitations too, it is a much
> >> better choice compared to floats/Decimals for most cases.
>
> > Maybe that's true for your use ca
On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote:
> what method can you use on x to find all available
> attributes for that class?
>>> class Foo(object):
bar = "hello, world!"
def __init__(self, baz):
self.baz = baz
>>> x = Foo(42)
>>> x.__dict__.keys() # Does
"Brian Smith" <[EMAIL PROTECTED]> writes:
> So does Haskell. Haskell All-In-One handles that by renaming every
> top-level artifact.
That can't be done reliably in python because namespaces are dynamic.
> If it is possible to run an egg as a CGI (without modifying the web
> server configuration f
[EMAIL PROTECTED] wrote:
> On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> Recently there was a thread about function composition in Python (and
>> this was probably not the first). The fast way to create a
>> (anonymous) composite function
>>
>> f1 o f2 o ...
Zack wrote:
> Diez B. Roggisch wrote:
>> Zack schrieb:
>>> If I have a class static variable it doesn't show up in the __dict__
>>> of an instance of that class.
>>>
>>> class C:
>>>n = 4
>>>
>>> x = C()
>>> print C.__dict__
>>> {'__module__': '__main__', '__doc__': None, 'n': 4}
>>> print x._
Dustan wrote:
> On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote:
>> what method can you use on x to find all available
>> attributes for that class?
>
class Foo(object):
> bar = "hello, world!"
> def __init__(self, baz):
> self.baz = baz
>
x = Foo(42)
>
>>>
On Feb 16, 5:57 pm, Boris Borcic <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> >> Hi all,
>
> >> Recently there was a thread about function composition in Python (and
> >> this was probably not the first). The fast way t
On Fri, 15 Feb 2008 17:31:51 -0800, Mark Dickinson wrote:
> On Feb 15, 7:59 pm, Steven D'Aprano <[EMAIL PROTECTED]
> cybersource.com.au> wrote:
>> On Fri, 15 Feb 2008 14:35:34 -0500, Steve Holden wrote:
>> >> I don't understand: why would +INF not be equal to itself? Having
>> >> INF == INF be T
En Sat, 16 Feb 2008 19:43:37 -0200, John Machin <[EMAIL PROTECTED]>
escribi�:
> On Feb 16, 3:48 pm, Dan Bishop <[EMAIL PROTECTED]> wrote:
>>
>> days_in_month = lambda m: m - 2 and 30 + bool(1 << m & 5546) or 28
>
> Alternatively:
>
> days_in_month = lambda m: m - 2 and 31 - ((m + 9) % 12 % 5 % 2)
On Feb 14, 8:10 pm, Zentrader <[EMAIL PROTECTED]> wrote:
> > That's a misconception. The decimal-module has a different base (10
> > instead of 2), and higher precision. But that doesn't change the fact
> > that it will expose the same rounding-errors as floats do - just for
> > different numbers.
On Feb 16, 7:08 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 15 Feb 2008 17:31:51 -0800, Mark Dickinson wrote:
> > Not sure that alephs have anything to do with it. And unless I'm
> > missing something, minus aleph(0) is nonsense. (How do you define the
> > negation
On Feb 16, 5:59 pm, Zack <[EMAIL PROTECTED]> wrote:
> Zack wrote:
> > Diez B. Roggisch wrote:
> >> Zack schrieb:
> >>> If I have a class static variable it doesn't show up in the __dict__
> >>> of an instance of that class.
>
> >>> class C:
> >>>n = 4
>
> >>> x = C()
> >>> print C.__dict__
> >>
Dustan wrote:
> On Feb 16, 5:59 pm, Zack <[EMAIL PROTECTED]> wrote:
>> Zack wrote:
>>> Diez B. Roggisch wrote:
Zack schrieb:
> If I have a class static variable it doesn't show up in the __dict__
> of an instance of that class.
> class C:
>n = 4
> x = C()
> print C.
1 - 100 of 135 matches
Mail list logo