> Here is my attempt to convert the C code, not written with speed in mind
> and I was too lazy too time it. :-)
>
> from itertools import izip
>
> def pi():
> result = list()
> d = 0
> e = 0
> f = [2000] * 2801
> for c in xrange(2800, 0, -14):
> for b, g in izip(xrang
Diez B. Roggisch wrote:
>
>>
>> I think that it *is* possible to do it, but a whole lot of work had to
>> be done to achieve this. It is all about how many rules (like how to
>> convert this block of unreadable code of language X into a readable
>> python block) you are willing to find/program (an
Hi all,
this is a newbie question on :
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
PC with WinXP
In
http://www.python.org/doc/2.3.5/lib/module-math.html
I read:
"sqrt( x) Return the square root of x."
Now the test for module math with function pow():
-
Greetings!
The next New York City Python Users Group meeting is this Tuesday, Jan. 9th,
6:30pm at at the Millennium Partners office at 666 Fifth Avenue (53rd St.
and 5th Ave.) on the 8th Floor. We welcome all those in the NYC area who are
interested in Python to attend. However, we need a list of
Steven Bethard schrieb:
> If someone has an idea how to include argparse features into optparse,
> I'm certainly all for it. But I tried and failed to do this myself, so I
> don't know how to go about it.
It's not necessary that the implementation is retained, only that the
interface is preserved.
fscked schrieb:
> Hi guys/gals.
>
> I am trying to write and xml file from data parsed from a csv.
>
> I can get everything to work except that I cannot get minidom to do -->
> ö which needless to say is driving me nuts.
>
> Any suggestions?
Works fine for me:
py> d = minidom.Document()
py> r
you forgot to import math module
>>> import math
>>> math.sqrt(9)
3.0
if you want math functions to your current namespace use:
>>> from math import *
--
Tõnis
On Jan 4, 10:13 am, "siggi" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> this is a newbie question on :
> Python 2.5 (r25:51908, Sep 19 200
Paul Watson schrieb:
> Martin v. Löwis wrote:
>> Paul Watson schrieb:
>>> ./configure
>>> make
>>> make test
>>>
>>> The result appears to hang after the test_tkl... line. I had to kill
>>> the 'make test' process which terminated it. Any suggestions?
The only suggestion then is that you (or som
wcc schrieb:
> Hello,
>
> How do I create a class using a variable as the class name?
>
> For example, in the code below, I'd like replace the line
>
> class TestClass(object):
> with something like
> class eval(className) (object):
>
> Is it possible? Thanks for your help.
>
> className = "T
Thank you very much, Tõnis!:
*** 1 ***
>you forgot to import math module
>>> import math
Nope, I did not! But I used sqrt(9), and not math.sqrt(9). The latter works
excellent, thank you! From now on, I will use "import math" and
"math.fuction()" for EVERY mathematical function, even for pow() etc
wcc kirjoitti:
> Hello,
>
> How do I create a class using a variable as the class name?
>
> For example, in the code below, I'd like replace the line
>
> class TestClass(object):
> with something like
> class eval(className) (object):
>
> Is it possible? Thanks for your help.
>
> className =
wcc schrieb:
> Hello group,
>
> Is there a separate mailing list for comtypes? Or this is the
> appropriate place to post questions related to this package(from Thomas
> Heller)?
It seems the python-win32 mailing list is the place where the most COM knowledge
is, so that would be most appropriat
siggi wrote:
> What is a "namespace" and what is the difference between ">>>import math"
> and ">>>from math import *" ?
http://preview.tinyurl.com/t4pxq
for more on this, *please* read the relevant sections in the tutorial.
Python's all about namespaces, and trial and error is not a very good
> >if you want math functions to your current namespace use:
> >>> from math import *What is a "namespace" and what is the difference
> >>> between ">>>import math"
> and ">>>from math import *" ?
for namespaces read this
http://www.network-theory.co.uk/docs/pytut/tut_68.html
import math creates
Podi a écrit :
>>>Or more compactly:
>>>
>>>words = [Word(w) for w in 'this is probably what you want'.split()]
>>>print words
>>
>>I didn't want to introduce yet some more "confusing" stuff !-)
>
>
> Indeed, the for loop is perfectly fine and totally readable. Let's save
> the "confusing stuff"
Thank you Tõnis, both for the link and your patient explanation :-)
Siggi
"tonisk" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> >if you want math functions to your current namespace use:
> >>> from math import *What is a "namespace" and what is the difference
> >>> betwe
Hi:
I want to Draw rectangle on Dc when gived a position. Can you teach me? Let
me view your code?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
mm a écrit :
>
> Yes, it was the (), equivalent to thiks like new() create new object
> from class xy.
Yeps. In Python there's no 'new' operator. Instead, classes are
themselves 'callable' objects, acting as instance factory. It's very
handy since it let's you replace a class with a factory fu
[EMAIL PROTECTED] a écrit :
> Raymond Hettinger:
>> The simplest way is to take advantage of sort-stability and do
>> successive sorts. For example, to sort by a primary key ascending and
>> a secondary key decending:
>>L.sort(key=lambda r: r.secondary, reverse=True)
>>L.sort(key=lambda r:
Ben Finney a écrit :
(snip)
> The "Singleton" pattern does what you say here. Implementing a proper
> Singleton in Python is complicated and hard to understand.
Really ? Using __new__ and a class attribute, it doesn't seem so
complicated - nor difficult to understand...
--
http://mail.python.org
pyperl - Perl for Python
"This is a Python extension module that makes it possible to embed Perl
interpreter(s) in any Python program. It can be used to invoke
arbitrary Perl code, load any Perl modules and make calls directly
into Perl functions. The Perl code invoked ca
On Wed, 03 Jan 2007 23:27:57 -0800, wcc wrote:
> Hello,
>
> How do I create a class using a variable as the class name?
Try a "class factory".
def create_class(classname):
class Klass(object):
def __init__(self):
print "Creating object of %s..." % self.__class__.__name__
"siggi" wrote:
> Nope, I did not! But I used sqrt(9), and not math.sqrt(9). The latter works
> excellent, thank you! From now on, I will use "import math" and
> "math.fuction()" for EVERY mathematical function, even for pow() etc. just
> to be on the safe side!
pow and math.pow are two slightly d
mm <[EMAIL PROTECTED]> wrote:
> (Yes, I konw whats an object is...)
> BTW. I did a translation of a pi callculation programm in C to Python.
> (Do it by your own... ;-)
> Calc PI for 800 digs(?). (german: Stellen)
> int a=1,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5;
> for(;
Wade Leftwich wrote:
> Jeffrey Froman wrote:
> > Dave Dean wrote:
> >
> > > I'm looking for a way to iterate through a list, two (or more) items at a
> > > time.
> >
> > Here's a solution, from the iterools documentation. It may not be the /most/
> > beautiful, but it is short, and scales well fo
Wade Leftwich wrote:
> from itertools import groupby
>
> def chunk(it, n=0):
> if n == 0:
> return iter([it])
> def groupfun((x,y)):
> return int(x/n)
> grouped = groupby(enumerate(it), groupfun)
> counted = (y for (x,y) in grouped)
> return ((z for (y,z) in x)
What i need from my C application to do ?
1) To execute a python script from file.
2) The python script will call functions in my C application.
According to the answer from Ravi Teja (topic "C app and Python"), I
need to extend embedded python in my C application.
I saw several functions: PyRun_
"Vertilka" <[EMAIL PROTECTED]> wrote:
> I saw several functions: PyRun_AnyFileExFlags, PyRun_SimpleFileExFlags,
> PyRun_FileExFlags.
>
> Questions:
> 1) Which one should i use in order to achieve what i need ?
PyRun_SimpleFile or PyRun_SimpleString should be good enough. Using
SimpleString is mo
Thanks for the explanation. I am astonished what an interpreted language is
able to do!
"Fredrik Lundh" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> "siggi" wrote:
>
>> Nope, I did not! But I used sqrt(9), and not math.sqrt(9). The latter
>> works
>> excellent, thank you!
Peter Otten wrote:
> Wade Leftwich wrote:
>
> > from itertools import groupby
> >
> > def chunk(it, n=0):
> > if n == 0:
> > return iter([it])
> > def groupfun((x,y)):
> > return int(x/n)
> > grouped = groupby(enumerate(it), groupfun)
> > counted = (y for (x,y) in gr
> Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> (SW) wrote:
>SW> I don't see a problem with SUID on scripts. If you restrict write access
>SW> to the owner, modification is hardly possible.
>SW> However, if you allow world-wide write access to your binaries and
>SW> scripts, both can easily b
siggi wrote:
> Hi all,
>
> this is a newbie question on :
> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
> win32
> PC with WinXP
>
> In
> http://www.python.org/doc/2.3.5/lib/module-math.html
> I read:
>
> "sqrt( x) Return the square root of x."
>
> Now the test f
Hello folks,
I am having troubles with implementing a timed queue. I am using the
'Queue' module to manage several queues. But I want a timed access, i.e.
only 2 fetches per second max. I am horribly stuck on even how I
actually could write it. Has somebody done that before? And when yes,
how is t
I am using ftplib in some code that does exactly what you would expect.
It ftp's files. Its running inside a service running on windows xp
and windows 2003 servers, approximately 20 installations each
installation sends between 100 and 1000 files per day. Occasionally the
process will hang comple
I have a rather large Python/Twisted Matrix application that will be run
on Windows, Linux and perhaps Macs. I was wondering if there are any
tools that can be used to create an installer that will bring in Python,
Twisted Matrix, my application libraries and anything else I need?
I have tried
On 1/4/07, Chaz Ginger <[EMAIL PROTECTED]> wrote:
> I have a rather large Python/Twisted Matrix application that will be run
> on Windows, Linux and perhaps Macs. I was wondering if there are any
> tools that can be used to create an installer that will bring in Python,
> Twisted Matrix, my applica
Mainly, it was fload-div. Changed to int-div (python //) runs faster.
Yes, this "gmpy" sounds good for calc things like that.
But not available on my machine.
ImportError: No module named gmpy
Anyway, thanks for posting. This gmpy module can be very intersting.
But right now, the focus was, if i
On 1/4/07, Chaz Ginger <[EMAIL PROTECTED]> wrote:
> I have a rather large Python/Twisted Matrix application that will be run
> on Windows, Linux and perhaps Macs. I was wondering if there are any
> tools that can be used to create an installer that will bring in Python,
> Twisted Matrix, my applica
Thomas Ploch wrote:
> I am having troubles with implementing a timed queue. I am using the
> 'Queue' module to manage several queues. But I want a timed access, i.e.
> only 2 fetches per second max. I am horribly stuck on even how I
> actually could write it. Has somebody done that before? And when
> Yes, this "gmpy" sounds good for calc things like that.
> But not available on my machine.
> ImportError: No module named gmpy
What type of machine?
The home page for gmpy is http://sourceforge.net/projects/gmpy/
I have Windows versions available at http://home.comcast.net/~casevh/
casevh
-
Thanks for that, too!
Would be interesting to learn how these different algorithms influence the
precision of the result!?
"Boris Borcic" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> siggi wrote:
>> Hi all,
>>
>> this is a newbie question on :
>> Python 2.5 (r25:51908,
[EMAIL PROTECTED] wrote:
>>Yes, this "gmpy" sounds good for calc things like that.
>>But not available on my machine.
>>ImportError: No module named gmpy
>
>
> What type of machine?
Windoof with Cygwin.
>
> The home page for gmpy is http://sourceforge.net/projects/gmpy/
>
> I have Windows ve
Thomas Heller skrev:
> [EMAIL PROTECTED] schrieb:
> > [EMAIL PROTECTED] skrev:
> >
> >> Hi,
> >>
> >> I wish to write a Python wrapper for my C# COM object but am unsure
> >> where to start. I have a dll and a tlb file, and I can use this object
> >> in C via the following code -
> >>
> >> // Con
On 2007-01-03, dwelden <[EMAIL PROTECTED]> wrote:
> I have successfully used the sort lambda construct described in
> http://mail.python.org/pipermail/python-list/2006-April/377443.html.
> However, how do I take it one step further such that some
> values can be sorted ascending and others descendi
Martin v. Löwis wrote:
> fscked schrieb:
> > Hi guys/gals.
> >
> > I am trying to write and xml file from data parsed from a csv.
> >
> > I can get everything to work except that I cannot get minidom to do -->
> > ö which needless to say is driving me nuts.
> >
> > Any suggestions?
>
> Works fine
Hello,
I have some external C libraries I would like to use with python.
I have been searching on the internet and found many such
modules/bindings for libraries (e.g. Py-Lame) but have not yet
come across any information of how to actually go about creating such
bindings, so I was wondering if a
Thomas Ploch wrote:
> I am having troubles with implementing a timed queue. I am using
> the 'Queue' module to manage several queues. But I want a timed
> access, i.e. only 2 fetches per second max. I am horribly stuck on
> even how I actually could write it. Has somebody done that before?
> And w
Hello;
I'm studying some code examples from the python cookbook site. I came across
this:
def colsplit(l, cols):
rows = len(l) / cols
if len(l) % cols:
rows += 1
m = []
for i in range(rows):
m.append(l[i::rows])
return m
What I'd like to know is what is the double
fscked schrieb:
> Well, let me clarify. If I just print it to the screen/console it works
> fine, but when I do:
>
> out.write( doc.toprettyxml())
>
> it just removes the character that would be the "ö".
>
> I can post the code if anyone wants to see it, but it is fairly
> straightforward.
I fi
Ognjen Bezanov schrieb:
> I have some external C libraries I would like to use with python.
>
> I have been searching on the internet and found many such
> modules/bindings for libraries (e.g. Py-Lame) but have not yet
> come across any information of how to actually go about creating such
> bindi
Sequence slicing [starting-at-index : but-less-than-index [ : step]].
Start defaults to 0, end to len(sequence), step to 1.
So l[i::rows] means: slicing start from i, ending with len(l) and step
with rows. So function colsplit(l, cols) returns a list of sequence
with conversion of:
Assume cols =
Neil Cerutti wrote:
> Another trick is to factor the key application out of the sort.
> This may be a good idea if when you want to minimize the number
> of times your key function is called.
>
> The idea is to mangle the list temporarily so you can use an
> unkeyed sort, and then unmangle the so
Thomas Ploch schrieb:
> I am having troubles with implementing a timed queue. I am using the
> 'Queue' module to manage several queues. But I want a timed access, i.e.
> only 2 fetches per second max. I am horribly stuck on even how I
> actually could write it. Has somebody done that before? And wh
siggi wrote:
> Now the test for module math with function pow():
> ---
> >>> pow(9,9)
> 387420489
>
> Fine, but sqrt() fails:
> ---
> >>> sqrt(9)
> I get this error message
>
> 'Traceback (most recent call last):
> File "", line 1,
Martin v. Löwis wrote:
<...snip...>
> I find that hard to believe. There is no code in Python that does
> removal of characters, and I can't see any other reason why it gets
> removed.
>
> OTOH, what I do get when writing to a file is a UnicodeError, when
> it tries to convert the Unicode string
Thanks for all replies. I'll just to have to figure our which suggested
method I should use. To answer Jussi's question, this is why I asked
the question. I have the book by Mark: Python Programming on Win32.
In Charpter 12: Advanced Python and COM there is a sample code named:
DynamicPolicy.py.
Thank you Thomas.
On Jan 3, 11:10 pm, Thomas Heller <[EMAIL PROTECTED]> wrote:
> wcc schrieb:
>
> > Hello group,
>
> > Is there a separate mailing list for comtypes? Or this is the
> > appropriate place to post questions related to this package(from Thomas
> > Heller)?It seems the python-win32 mai
On 2007-01-04, Peter Otten <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> Another trick is to factor the key application out of the
>> sort. This may be a good idea if when you want to minimize the
>> number of times your key function is called.
>>
>> The idea is to mangle the list temporaril
Martin v. Löwis wrote:
> Steven Bethard schrieb:
>> If someone has an idea how to include argparse features into optparse,
>> I'm certainly all for it. But I tried and failed to do this myself, so I
>> don't know how to go about it.
>
> It's not necessary that the implementation is retained, only
Eric Price wrote:
> Hello;
> I'm studying some code examples from the python cookbook site. I came
> across this:
>
> def colsplit(l, cols):
>rows = len(l) / cols
>if len(l) % cols:
>rows += 1
>m = []
>for i in range(rows):
>m.append(l[i::rows])
>return m
>
>
Paul Watson wrote:
> Eric Price wrote:
>> Hello;
>> I'm studying some code examples from the python cookbook site. I came
>> across this:
>>
>> def colsplit(l, cols):
>>rows = len(l) / cols
>>if len(l) % cols:
>>rows += 1
>>m = []
>>for i in range(rows):
>>m.append(
On 1/4/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Ognjen Bezanov schrieb:
> > I have some external C libraries I would like to use with python.
> >
> > I have been searching on the internet and found many such
> > modules/bindings for libraries (e.g. Py-Lame) but have not yet
> > come acros
How do you check to see if a variable is a set? I would like to use
if type(var) is types.SetType:
blah
but that is not available in types module. I am using 2.4
--
http://mail.python.org/mailman/listinfo/python-list
>From: Paul Watson <[EMAIL PROTECTED]>
>Probably most helpful to you is:
>
>http://developer.mozilla.org/es4/proposals/slice_syntax.html
Oh, the step. Okay, thanks ;)
Eric
_
Communicate instantly! Use your Hotmail address to sign in
I've seen people do that using an exception, e.g.
try:
foo
except :
#variable foo not defined
On Jan 4, 2007, at 10:48 AM, _ wrote:
> How do you check to see if a variable is a set? I would like to use
>
> if type(var) is types.SetType:
>blah
>
> but that is not available in types mo
_ wrote:
> How do you check to see if a variable is a set? I would like to use
>
> if type(var) is types.SetType:
>blah
>
> but that is not available in types module. I am using 2.4
In [1627]: type(set()) is set
Out[1627]: True
--
Robert Kern
"I have come to believe that the whole world
_ wrote:
> How do you check to see if a variable is a set? I would like to use
>
> if type(var) is types.SetType:
>blah
>
> but that is not available in types module. I am using 2.4
# set or subclass of set
if isinstance(var, set):
...
# exact match
if type(v
Ognjen Bezanov wrote:
> I have some external C libraries I would like to use with python.
>
> I have been searching on the internet and found many such
> modules/bindings for libraries (e.g. Py-Lame) but have not yet
> come across any information of how to actually go about creating such
> bindin
Fredrik Lundh wrote:
> > if type(var) is types.SetType:
> >blah
> >
> > but that is not available in types module. I am using 2.4
>
> # set or subclass of set
> if isinstance(var, set):
> ...
or
if isinstance(var, (set, frozenset)):
...
-Mike
--
http://mail.python.o
Hello,
I was trying to install my script (.py) to (.exe) and when I run setup
script with cmd I get the
error:
python mysetup.py py2exe
error: COREDLL.dll: No such file or directory
Thanks!!!
--
http://mail.python.org/mailman/listinfo/python-list
Ben Sizer wrote:
> robert wrote:
>> Ben Sizer wrote:
>>> My opinion is that this is not as big a problem as some may feel that
>>> it is. Unlike Unix systems, the PATH variable is rarely used.
>> It is a big problem.
>>
>> It is not less than the majority of Python users (at least those who do
>>
> Why not use OO.org to convert DOC to PDF? It does so natively, IIRC.
I can't insert variables if the template is a DOC file. This is why we
are using RTF.
Felipe Almeida Lessa wrote:
> On 3 Jan 2007 10:52:02 -0800, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > I have tried to
> > convert
Dear experts,
I got some unexpected behavior in getattr and copy.deepcopy (see
transcript below). I'm not sure if this is actually a bug in
copy.deepcopy or if I'm doing something too magical with getattr.
Comments would be appreciated.
Thanks,
-Emin
# Transcript follows ###
Raymond schrieb:
> Hi:
>
> I want to Draw rectangle on Dc when gived a position. Can you teach me? Let
> me view your code?
Well, you haven't given us much background but I'd suggest if your boss
asks you to draw a rectangle on your corporate domain controller and the
position allows this, you bet
I ran into a problem I didn't understand at first. I got part of it figured
out. Let me first demonstrate the original problem:
> cat Super.py
class Super(object):
def __init__(self):
self._class = 'Super'
def hello(self):
print "%s says 'Hello'" % self._class
> cat Sub.py
Steven Bethard <[EMAIL PROTECTED]> writes:
> Martin v. Löwis wrote:
> > Steven Bethard schrieb:
> >> If someone has an idea how to include argparse features into optparse,
> >> I'm certainly all for it. But I tried and failed to do this myself, so I
> >> don't know how to go about it.
> > It's not
Erik Johnson wrote:
> My questions are:
>
> Why does python complain about a function here? (it's a class definition
> statement, right?)
Because you're calling the function with the wrong number of arguments.
> Is there really a function being called here?
Yes. (Well, it's not exactly a functi
I'm newish to python and just got my first mac, so sorry if this is
stupid. I have a little app developed by someone else in wxGlade that
implements a complex stats package and language package, all in python.
It works fine on my work PC, but not on my laptop. I have a new
macbook 2ghz core duo,
Also, if it makes a difference, the lines quoted in the error message
were actually written automatically by wxGlade.
--
http://mail.python.org/mailman/listinfo/python-list
So you know you are subclassing a module.
There is an answer @
http://www.velocityreviews.com/forums/showpost.php?p=1819038&postcount=2
On Jan 4, 3:49 pm, "Erik Johnson" wrote:
> I ran into a problem I didn't understand at first. I got part of it figured
> out. Let me first demonstrate the origi
goodepic wrote:
> I'm newish to python and just got my first mac, so sorry if this is
> stupid. I have a little app developed by someone else in wxGlade that
> implements a complex stats package and language package, all in python.
> It works fine on my work PC, but not on my laptop. I have a n
How do I find out the cache line length of a machine in python?
Thanks,
--j
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard schrieb:
> If someone has an idea how to include argparse features into optparse,
> I'm certainly all for it. But I tried and failed to do this myself, so
> I don't know how to go about it.
Martin v. Löwis wrote:
> It's not necessary that the implementation is retained, only tha
Announcing argparse 0.4
---
argparse home:
http://argparse.python-hosting.com/
argparse single module download:
http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw
argparse bundled downloads at PyPI:
http://www.python.org/pypi/argparse/
New in this
(I did google for this, I promise)
How do I get python NOT to insert newlines into string representations
of lists when I do something like this:
strCollector += "%s" % (['a', 'list', 'with', 'lots', 'of', 'elements']
* 100)
?
I would like to set a default never to do this, if possible. (Never
On Thu, 2007-01-04 at 17:01 -0800, _ wrote:
> (I did google for this, I promise)
>
> How do I get python NOT to insert newlines into string representations
> of lists when I do something like this:
>
> strCollector += "%s" % (['a', 'list', 'with', 'lots', 'of', 'elements']
> * 100)
What makes yo
_ wrote:
> (I did google for this, I promise)
>
> How do I get python NOT to insert newlines into string representations
> of lists when I do something like this:
>
> strCollector += "%s" % (['a', 'list', 'with', 'lots', 'of', 'elements']
> * 100)
It shouldn't and doesn't insert newlines.
##
fscked schrieb:
> # Create the base element
> boxes = doc.createElement("boxes")
> myfile = open('ClientsXMLUpdate.txt')
> csvreader = csv.reader(myfile)
> for row in csvreader:
> mainbox = doc.createElement("box")
> doc.appendChild(boxes)
> r2 = csv.reader(myfile)
> b = r2.next()
On Jan 4, 10:00 am, "siggi" <[EMAIL PROTECTED]> wrote:
> Thanks for that, too!
>
> Would be interesting to learn how these different algorithms [for pow]
> influence the
> precision of the result!?
For an integer (i.e., int or long) x and a nonnegative integer y, x**y
is exact:
>>> 101 ** 12
At Thursday 4/1/2007 10:12, siggi wrote:
Thanks for the explanation. I am astonished what an interpreted language is
able to do!
Python is as interpreted as Java. Its numerical capabilities are more
or less independent of this fact, I'd say.
--
Gabriel Genellina
Softlab SRL
At Thursday 4/1/2007 07:07, Raymond wrote:
I want to Draw rectangle on Dc when gived a position. Can you teach
me? Let me view your code?
This is more a Windows question. See
http://msdn.microsoft.com/library/en-us/gdi/rectangl_4b03.asp
py>from win32gui import GetDC
py>hdc=GetDC(0)
py>from
Does a py script written to open and read binary files on Windows affect
files on a Linux or Mac machine in a negative way? My concern is
portability and safety. I want scripts written within Windows to work
equally well on Linux and Mac computers.
Is this the safest, most portable way to open
I am writing a class that is intended to be subclassed. What is the
proper way to indicate that a sub class must override a method?
Thanks,
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
At Thursday 4/1/2007 17:26, Emin wrote:
I got some unexpected behavior in getattr and copy.deepcopy (see
transcript below). I'm not sure if this is actually a bug in
copy.deepcopy or if I'm doing something too magical with getattr.
Comments would be appreciated.
Both examples are different. #1
On 2007-01-05, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> At Thursday 4/1/2007 10:12, siggi wrote:
>
>>Thanks for the explanation. I am astonished what an interpreted
>>language is able to do!
>
> Python is as interpreted as Java.
But it's far more interactive -- at least when compared with my
At Thursday 4/1/2007 17:49, Erik Johnson wrote:
Python 2.3.4 (#1, Feb 7 2005, 15:50:45)
Traceback (most recent call last):
File "", line 1, in ?
File "Sub.py", line 4, in ?
class Sub(Super):
TypeError: function takes at most 2 arguments (3 given)
Why does python complain about a functi
jeremito schrieb:
> I am writing a class that is intended to be subclassed. What is the
> proper way to indicate that a sub class must override a method?
>
> Thanks,
> Jeremy
>
What do you mean by 'indicate'? Writing it to the docstring of the
class/method? Writing a comment?
class Foo:
Patch / Bug Summary
___
Patches : 418 open ( +5) / 3522 closed ( +1) / 3940 total ( +6)
Bugs: 959 open (+13) / 6405 closed ( +5) / 7364 total (+18)
RFE : 250 open ( +2) / 245 closed ( -1) / 495 total ( +1)
New / Reopened Patches
__
update to
jeremito wrote:
> I am writing a class that is intended to be subclassed. What is the
> proper way to indicate that a sub class must override a method?
raise NotImplementedError
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible b
At Thursday 4/1/2007 23:46, tubby wrote:
I understand that doing the following on Windows to a binary file (a
jpeg or exe files for example) can cause file corruption, is that correct?
fp = open(file_name, 'r')
fp.close()
How can a simple open in read mode corrupt data???
You can't corrupt *
1 - 100 of 119 matches
Mail list logo