u turn compiler
optimizations off? (E.g., by editing configure.in to remove all
occurrences of '-O3' and then rerunning autoconf and autoheader.)
Thanks,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
d be fixed soonish.
Thanks for reporting this, and for whittling the failure down
to the --with-tsc configure option!
Mark
--
http://mail.python.org/mailman/listinfo/python-list
tart, stop and step values are representable
as C longs (which is what CPython uses internally for
this purpose). On a machine with >64 Gb of memory,
this call should succeed. On an LP64 machine with
<64 Gb of memory, it should produce MemoryError, not
OverflowError.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
wever, now I want to use a blank space (or maybe a dash) instead of a
question mark.
How do I do this?
See codecs.register_error(). Here's a simplistic example:
# coding: utf-8
import codecs
def handler(e):
return (u'-',e.start + 1)
codecs.register_error('mine',h
On Oct 15, 8:39 pm, David C. Ullrich wrote:
> >For what it's worth, there *is* a Python oddity lurking
> >under the surface here, at least for 64-bit. Here's
> >Python 2.6 on a 64-bit machine:
>
> Is that a 64-bit Python as well?
Yes.
Mark
--
http://mail.
ug']); print opts
Many TIA!
Mark
--
Mark Harrison
Pixar Animation Studios
--
http://mail.python.org/mailman/listinfo/python-list
uct module doesn't bother
including the trailing padding.
> >>> struct.calcsize(' 10
> >>> struct.calcsize('>BB')
> 10
The non-native formats don't include padding at all.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
as required for Excel. It would not "do the right
thing" when presented with UTF-8.
Excel seems to expect a UTF-8-encoded BOM (byte order mark) to correctly
decide a file is written in UTF-8. This worked for me:
f=codecs.open('test.csv','wb','utf-8
executable. Another Visual Studio tool, "dumpbin /imports " works,
too.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
'Raster Fonts' to 'Lucida
Console', since the former supported the cp437 character set only.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
"Mark Tolonen" wrote in message
news:[email protected]...
"Kee Nethery" wrote in message
news:[email protected]...
On Oct 16, 2009, at 5:49 PM, Stephen Hansen wrote:
On Fri, Oct 16, 2009 at 5:07 PM, Stef Mientki
wrote:
snip
ict['content-type']
'text/xml; charset=ISO-8859-1'
So the page seems correct.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
time_list_sum.py
concat1 0.0106019973755
concat2 48.0212899844
concat3 0.0138022899628
concat4 0.0179653167725
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
in range(10)), acc)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> acc
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
There should probably be a test for this somewhere, to make
sure that no-one else is tempted to make this change.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
re
this bright idea isn't repeated. :)
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
m":
PythonWin 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for
further copyright information.
import sys
sys.stdout.write('hello')
hello
print(sys.stdout.write('hello'))
helloNone
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
ill no idea why/how it ran on the first three systems
(and most others, from the look of it) without doing anything, and not on
this one... but at least now it works :-)
Yes, welcome to Microsoft's solution to DLL Hell...Side-by-Side DLL Hell.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
"George Trojan" wrote in message
news:[email protected]...
A trivial one, this is the first time I have to deal with Unicode. I am
trying to parse a string s='''48° 13' 16.80" N'''. I know the charset is
"iso-8859-1". To get the degrees I did
>>> encoding='iso-8859-1'
>>> q=s
x27; 16.80" N'''
q = s.decode('utf-8')
# next line equivalent to previous two
q = u'''48° 13' 16.80" N'''
# couple ways to find the degrees
print int(q[:q.find(u'°')])
import re
print re.search(ur'(\d+)°',q).group(1)
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
?view=rev&revision=71032
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
;\N{DEGREE SIGN}') defined? I found
http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt
Is that the place to look?
George
Scott David Daniels wrote:
Mark Tolonen wrote:
Is there a better way of getting the degrees?
It seems your string is UTF-8. \xc2\xb0 is UTF-8 for DEGREE SIGN. If
undary) and the padding isn't inserted.
struct.calcsize('ld')
16
struct.calcsize('dl')
12
In your case above, the size of the char arrays before the first double is
not a multiple of 8, so padding is inserted. Since your example read the
chunks separately, struct didn't know to insert the padding.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
hdrData = "84s"*3
> constNData = "6s"*400
I'm confused: why is this not "400s"*6 rather than "6s"*400?
Doesn't constName[400][6] mean 6 lots of constName[400]?
Similarly for "84s"*3. This might be making a difference to
the padding.
[...]
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 21, 9:18 am, Mark Dickinson wrote:
> On Oct 20, 10:51 pm, Tommy Grav wrote:
>
> > def read_header(cls):
> > hdrData = "84s"*3
> > constNData = "6s"*400
>
> I'm confused: why is this not "400s"*6
gt; z = -(2j)
>>> z.real
-0.0
>>> w = complex(repr(z))
>>> w.real
0.0
This was part of a set of changes made to ensure that complex(repr(z))
round-tripping worked correctly, even when z involves negative zeros,
nans, or infinities. (However, note that eval(repr(z)) doesn't
round-trip correctly; that's not a problem that's easy to solve.)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
does your
preferred encoding. You probably want to keep cp437, but change the error
handling to ignore. Or if this is a one-time problem, I suspect you could
do the encoding manually, to a byte array, then print that.
You can also replace the Unicode replacement character U+FFFD with a valid
cp437 character before displaying it:
b'\x80abc'.decode('utf8','replace').replace('\ufffd','?')
'?abc'
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
ts and
accumulate the sums, and then your code won't need rewriting
when you want to use it to take the power of 3-by-3 matrices.
And then check out the builtin 'sum' function, and consider
replacing some or all of the for loops with list
comprehensions (depending on personal taste)...
Not-so-final'ly yours,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
e
install multiple Python versions side-by-side and a "last installed
wins" strategy isn't a great option.
Even after setting up a correct PATH Tkinter does not work:
I suspect this will be a Python 3.x issue - you probably want to stick
with 2.x.
HTH,
Mark
--
http://mail.py
C, and was wondering what the best module would be to
parse these.
Check out the pyparsing module. Here is a presentation given by the author
for parsing an interactive game.
http://us.pycon.org/zope/talks/2006/fri/track1/04/index.html
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
./spammain.py <==
import ham.spam
$ python spammain.py
I've found it easier to not fight the module/package system but work
with it. But yes, I also think the problem you're seeing is a wart or
bug even.
Best regards
Mark Leander
--
http://mail.python.org/mailman/listinfo/python-list
gt; ../Python-2.6.4/Include/pyport.h:685:2: error: #error "LONG_BIT
> definition appears wrong for platform (bad gcc/glibc config
> ?)."
> make: The error code from the last command is 1.
> ===
>
> I would appreciate any help. Thanks.
Take a look at:
http://bugs.python.org/issue1628484
Mark
--
http://mail.python.org/mailman/listinfo/python-list
> http://research.microsoft.com/en-us/news/features/nagappan-100609.aspx
Thanks for the link! Hope he next takes on verifying that less code
implies less bugs when
other factors are constant, thus proving that Python is better than C
and Java :-).
Mark
--
http://mail.python.org/mailman/listi
ion doesn't create new references to Py_None
(well, except when it's about to return Py_None to the caller), so at
this point it doesn't own any reference to Py_None: it's not
responsible for decrementing the reference count.
> Same logic applies to PyDict_SetItemString()
Yes.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
for example):
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
on
win32
Type "help", "copyright", "credits" or "license" for more information.
import locale
locale.getdefaultlocale()
('en_US', 'cp1252')
import sys
sys.stdout.encoding
'cp437'
print u'\xed'.encode('cp437')
í
print u'\xed'.encode('cp1252')
φ
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
xactly. Also provide the shell command you are running
that works.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
dering how it happened.
Sounds like an excuse to post this Dijkstra link:
http://www.cs.utexas.edu/~EWD/ewd08xx/EWD831.PDF
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
>
> Note that you do not need block delimiters.
GAP uses almost exactly this syntax, but with 'fi' instead of 'endif':
http://www.gap-system.org/Manuals/doc/htm/ref/CHAP004.htm#SECT016
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ing Python functions from Excel and receive result
back in Excel. Can me somebody advise simplest solution please? I am
more VBA programmer than Python.
Try http://code.google.com/p/pyinex/
The book Python: Programming on Win32 has a whole chapter on COM, and a
section on COM servers.
-Mark
key in
SOFTWARE\Wow6432Node\ODBC\ODBC.INI. So I'm in a quandry... I'd like to
use one or the other, and not have to account for both.
It looks like _winreg needs to be enhanced to make the RegCreateKeyEx
API function available. It can be called via the win32api module of
"Chris Withers" wrote in message
news:[email protected]...
Mark Tolonen wrote:
Please I need Calling Python functions from Excel and receive result
back in Excel. Can me somebody advise simplest solution please? I am
more VBA programmer than Python.
Hi,
I'm delighted to announce that a new edition of my Python 3 book is
now available in the U.S.
"Programming in Python 3 (Second Edition):
A Complete Introduction to the Python Language"
ISBN 0321680561
http://www.qtrac.eu/py3book.html
The book has been fully revised and updated and now covers
t; re.split( r'(?:\w:)?[/\\]', r'c:/tmp/spam\\eggs/' )
['', 'tmp', 'spam', '', 'eggs', '']
My interest is more general in this case: how to capture many groups with
a repeat?
re.findall is what you're looking for. Here's all words not followed by a
colon:
import re
re.findall(u'(\w+)(?!:)',r'c:\tmp\spam/eggs')
['tmp', 'spam', 'eggs']
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
t; 0.906000137329
> 6.57799983025
> True
Do you get the same magnitude difference if you make Vector a new-
style
class? (I.e., use "class Vector(object)" instead of "class Vector
()".)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
d C for 10 years so I'm hoping there's a python
equivalent out there somewhere. Any advice would be appreciated.
Look for the win32evtlog and win32evtlogutil modules which come with
pywin32 (http://sf.net/projects/pywin32)
Cheers,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
are other ways, too: a seasoned Python user would probably
write this either as a list comprehension:
array2 = [int(x) for x in array]
... or using the built-in map function:
array2 = map(int, array)
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 31, 10:02 am, Mark Dickinson wrote:
> Python is refusing to multiply the string x[a] by the complex number W
> [n % N].
Whoops, that should have been "x[b]", not "x[a]". Why is it that a
post-submission proofread turns up errors so much more often than
r some of the ways it can be used. Here are the docs:
http://docs.python.org/library/numbers.html
and also PEP 3141, on which it's based:
http://www.python.org/dev/peps/pep-3141/
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
will be continuous, but f'(t) will not).
Simpson's rule is probably good enough.
Good luck!
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
n ret
The built-in pow function does exactly this, if you give it three
arguments:
>>> pow(12345, 67891, 17)
10
>>> 12345 ** 67891 % 17
10L
(Though this won't work for negative N.)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
% 4, 10**5)
for any n >= 5. Not sure if this is the kind of thing you're looking
for.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
I develop on
> Ubuntu64, but (I am told) it's too small a value when run on a Win32
> server. I assume it's being interpreted as zero and raising an
> exception.
This is a bit surprising. What's the precise form of the error you
get? Do you still get the same error
ss delta dF can't get smaller than 1e-16 or
so in absolute value (which seems reasonable, given that dF is
presumably the result of subtracting two numbers of 'normal'
magnitude), there would be little point having temp go much smaller
than, say, 1e-20.
IOW, I agree with Steven: 2.2e-
Python 2.6.4 is built, and I found a bdist_wininst project and
wininst-8 project.
How do I manage to build the msi for this thing?
--
http://mail.python.org/mailman/listinfo/python-list
That was so simple, thanks.
I scanned all the folders for inst, install, setup, but since msi was
the expected output extension, I didn't see that!
On Feb 9, 6:14 pm, "Gabriel Genellina" wrote:
> En Tue, 09 Feb 2010 19:55:30 -0300, Mark Jones
> escribió:
>
> >
"""Return the sum of the two operands.
>>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
Decimal('19.00')
>>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
Decimal('1.02E+4')
"""
return a.__add__(b, context=self)
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 10, 8:31 am, Mark Dickinson wrote:
> And here's how it's used in the decimal.Context module:
Aargh! decimal.Context *class*, not module.
And it occurs to me that it would have been cleaner to have
Decimal.__add__ call Context.add rather than the other way around.
Then De
, PyLong_FromVoidPtr(sender), &msgPtr->data, ret);
and PyLong_AsVoidPtr() for the other direction.
HTH,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Turns out there is an tools/msi directory and in there is python code
to help build the MSI from the tree you built. Only problem is you
can't use it without having python and PythonWin installed. So I
grabbed 2.6.4 python and pythonwin and installed them.
It uses COM objects and the CabSDK from M
> a = -0.1; b = 0.1
> >>> a ** b
> (0.7554510437117542+0.2454609236416552j)
Here you're computing (-0.1) ** 0.1.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
onjugate(), ==, and !=.
If it is given heterogenous arguments, and doesn't have special
knowledge about them, it should fall back to the builtin complex
type as described below.
"""
@abstractmethod
def __pow__(self, exponent):
&qu
y by using Colossus. Sorry some years since I read the book
about this so can't remember the title or author.
Regards.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
Mark Lawrence writes:
The predecessor of the Enigma was cracked by Polish scientists years
before WW2 started
I believe that all of Enigma was eventually cracked cos of two major
flaws.
I think it never would have been cracked if it hadn't been cracked
(whether b
n in seriously bad flames days ago.
To you, Alf, get stuffed.
To the rest of the Python community, thank you for doing a fantastic
job, I do appreciate it, and am currently in my own little way
attempting to put something back in.
Regards.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
told me nothing I can
use...
Thanks,
Angelica.
Please check the archives for the thread Please help with MemoryError,
it was only posted a day or two back. It's a problem specific to Windows.
Kindest regards.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle
escribió:
I posted an example of a decorator that does just this in this thread a
couple of days ago:
http://mail.python.org/pipermail/python-list/2010-February/1235742.html
Ouch! I didn't see your post, nor seve
Steve Holden wrote:
Mark Lawrence wrote:
Gabriel Genellina wrote:
En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle
escribió:
I posted an example of a decorator that does just this in this thread a
couple of days ago:
http://mail.python.org/pipermail/python-list/2010-February/1235742
sting. But who would
care to count.
Cheers & hth.,
- Alf
You really are the most insulting arrogant bastard I've ever read on
c.l.py in the eight years that I've been using Python. Did you get your
training at the Dr Goebbels School of Propaganda?
Most disgustedly.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
t for something like floating point accuracy, you'll
get plenty of hits.
http://docs.python.org/tutorial/floatingpoint.html
Regards.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
Q_1.put(l/d)
return Q_2
if __name__ == "__main__":
while(True):
n=int(raw_input())
if(n==0):break
L=factor(n)
L.sort()
#print L
i=0
s=""
while(i
A good starting point is
http://wiki.python.o
l be where the biggest bottleneck is. But see (1). The other
obvious bottleneck is the gcd method; if profiling shows that that's
the case, there might be ways to speed that up, too. (E.g., use a
binary gcd algorithm, or use Lehmer's method.)
Good luck!
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 14, 6:03 pm, [email protected] (Aahz) wrote:
> In article
> <363498c7-3575-4f1e-ad53-d9cd10c8d...@q16g2000yqq.googlegroups.com>,
> Mark Dickinson wrote:
>
> >(2) Obvious things: use range rather than xrange in your loops.
>
> Um, what? You meant the r
as
though m controls the number of Pollard-Rho iterations that are
clumped together at one time (before doing a gcd operation), and using
a random number for this doesn't make a lot of sense to me.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
nently when
searching for the Python descriptor protocol.
Thank you.
I'll second, third and fourth this request. More please Bruno, or from
anybody similarly qualified.
Thanks very much.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
purposes because you've missed the significance of his
(you later realise)
within his post.
Runtime test isolation doesn't enter into from what I can see.
Can you please clarify the situation one way or the other.
TIA.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Fetchinson wrote:
Does anyone know what happened to pyjs.org ?
Cheers,
Daniel
According to google cache it was fine 13/02/2010 and it's down according
to this.
http://downforeveryoneorjustme.com/pyjs.org
HTH.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
Muhammad Alkarouri wrote:
Your question is borderline if not out of topic in this group. I will
make a few comments though.
This might be a Python group, but threads often drift way off topic,
which added to the language itself make this a great group to read. If
you don't like the way a threa
file associations in the same way that you can run a
command (.bat) file. If the OP types the command "ASSOC .py" without
the quotes at the command prompt, the response .py=Python.File tells you
that this association has been setup.
HTH.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Andre Engels wrote:
On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence wrote:
Andre Engels wrote:
On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson
wrote:
I've successfully compiled several small python programs on Win XP into
executables using py2exe. A program goes from a name like snowball.
Hello,
I am doing research as part of a Uni research Scholarship into using
data compression for classification. What I am looking for is python
code to handle the crossfold validation side of things for me - that
will take my testing / training corpus and create the testing /
training files after
on31\python.exe \python31\scripts\pywin32_postinstall.py
-install' (changing the paths as necessary).
It should succeed as it is running from a console, and you might find
that fixes things.
HTH,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
to 10**8.
The decimal module would get you the results you need (are you allowed
imports?). Or you could roll your own log implementation based on
integer arithmetic.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ms of
Stirling's series it's a *very* small chance, but it's there. If you
want something 100% watertight, you'd need to compute strict upper
and lower bounds for the true result, and increase precision until
those bounds match sufficiently far that you can be sure of the first
k digits being correct.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
the
integer part when its argument is >= 1e12, since Python produces a
result in scientific notation. I think you're going to get strange
results when k >= 13.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
on 3.x):
>>> format(.7, '%')
'70.00%'
>>> format(.7, '.2%')
'70.00%'
Or see TomF's response for how to use this with the str.format method.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
.edit.currentView.GetWindowText('line1\nline2\nline3')
should work - the first few lines will always be formatted using blue
text, and the above works a little strangely when attempting it directly
from the interactive prompt, but might still be useful. See the source
file I menti
e confusing ordering with sorting.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
ror: invalid syntax
Though the fact that one of the cases raises an exception (rather than
silently giving some different behaviour) ameliorates things a bit.
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
vious solution to this problem is to write the assembler code in
your own way, and then use Python to change the code to the appropriate
target. Any of the solutions listed here would presumably suffice.
http://nedbatchelder.com/text/python-parsers.html
Regards.
Mark Lawrence.
--
came across
a line of code that actually did something. The rest of it was
boilerplate. I'm never ever going to sin again, because if I do, I will
be reincarnated as a J type, or worse still, I C(++) type.
Regards.
Mark Lawrence.
No that's a swaaann
e astronomical when compared to
initial development costs.
Regards.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
in
sunny and warm Florida soon.
--Mark Lutz at learning-python.com
--
http://mail.python.org/mailman/listinfo/python-list
be concerned about?
Can someone explain this mystery to me?
Thank you,
Malcolm
c:\Users\Mark>python
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information
s very counterproductive. Thank you very much for
your insight.
I was a little frightened of doing "import this" ("Hey, kid, run rm -
rf / and see what happens!"), but did, and the words are wise. :)
Pete
After reading the words of wisdom try "import this" a second time and
watch what happens, it's quite interesting if you're not expecting the
output.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Alf and Steven Howe, please don't top post, it makes it all but
impossible to follow a thread. Darn!:)
Mark Lawrence.
Alf P. Steinbach wrote:
Since Mohamed is talking about compilation I think it's more likely he's
talking about an intermediate program represention based on qu
; 77]
No library can solve this problem. If g and x are both 256-bit
numbers then the result of g**x will have on the order of 10**79 bits,
which matches estimates of the number of particles in the universe. I
can only imagine that you actually want g**x % m for some m, in which
case three-arg
Neal Becker wrote:
Want to switch __call__ behavior. Why doesn't this work? What is the
correct way to write this?
class X (object):
def __init__(self, i):
if i == 0:
def __call__ (self):
return 0
else:
def __call_ (self):
osite:
>
> 602525071745682437589111511878284384468144476539868422797968232621651594065
> 00174226172705680274911
>
> Factoring this remaining composite using ECM may not be practical.
>
> casevh
The complete factorization is: 101 x 521 x 3121 x 9901 x 36479 x
300623 x 53397071018461 x 1900381976777332243781 x
6060517860310398033985611921721 x
9941808367425935774306988776021629111399536914790551022447994642391
It helps if you notice that the digits of the original 156-digit
number come from concatenating a 78-digit string to itself, giving an
immediate factor of 10**78 + 1. (Oops. Perhaps this was supposed to
be a secret back door to the OP's crypto scheme. I've given it away
now. :))
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
east my answers agree
with yours. (Factoring 10**78+1 took around 7 seconds using GP/Pari
on a 2.5 GHz MacBook; factoring the remaining quotient n / (10**78+1)
was much quicker.)
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Gib Bogle wrote:
Steven D'Aprano wrote:
As the old proverb goes: give a man a fish, and you feed him for a
day. Teach him how to fish, and he has food forever.
I like this version:
Light a man a fire, and you keep him warm for hours. Set a man on fire,
and you keep him warm for the rest of
Gib Bogle wrote:
Mark Lawrence wrote:
I'm certain that members of the Guinea Pig Club might have something
to say on that one, see :-
http://en.wikipedia.org/wiki/Guinea_Pig_Club
You mean, something like: "That's not funny"?
No, simply a statement.
--
http://mai
4801 - 4900 of 5842 matches
Mail list logo