Re: Python-3.2 (SVN) bug [was syntax question]

2009-10-12 Thread Mark Dickinson
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

Re: Python-3.2 (SVN) bug [was syntax question]

2009-10-12 Thread Mark Dickinson
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

Re: for loop: range() result has too many items

2009-10-14 Thread Mark Dickinson
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

Re: unicode-to-ascii: replace with space, not "?"

2009-10-14 Thread Mark Tolonen
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

Re: for loop: range() result has too many items

2009-10-15 Thread Mark Dickinson
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.

optparse, allowing both --foo and foo=99?

2009-10-16 Thread Mark Harrison
ug']); print opts Many TIA! Mark -- Mark Harrison Pixar Animation Studios -- http://mail.python.org/mailman/listinfo/python-list

Re: struct curiosity

2009-10-16 Thread Mark Dickinson
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

Re: how to write a unicode string to a file ?

2009-10-16 Thread Mark Tolonen
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

Re: Tracking down DLL load errors in Windows ?

2009-10-16 Thread Mark Tolonen
executable. Another Visual Studio tool, "dumpbin /imports " works, too. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe and croatian letters

2009-10-17 Thread Mark Tolonen
'Raster Fonts' to 'Lucida Console', since the former supported the cp437 character set only. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write a unicode string to a file ?

2009-10-17 Thread Mark Tolonen
"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

Re: umlauts

2009-10-17 Thread Mark Tolonen
ict['content-type'] 'text/xml; charset=ISO-8859-1' So the page seems correct. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-17 Thread Mark Dickinson
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

Re: restriction on sum: intentional bug?

2009-10-17 Thread Mark Dickinson
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: restriction on sum: intentional bug?

2009-10-17 Thread Mark Dickinson
re this bright idea isn't repeated. :) -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: print()

2009-10-17 Thread Mark Tolonen
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

Re: Tracking down DLL load errors in Windows ?

2009-10-18 Thread Mark Tolonen
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

Re: a simple unicode question

2009-10-19 Thread Mark Tolonen
"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

Re: a simple unicode question

2009-10-19 Thread Mark Tolonen
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

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Mark Dickinson
?view=rev&revision=71032 -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: a simple unicode question

2009-10-20 Thread Mark Tolonen
;\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

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Tolonen
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

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Dickinson
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

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Dickinson
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

Re: repr(complex) in Py3.1

2009-10-24 Thread Mark Dickinson
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

Re: Python 3.1.1 bytes decode with replace bug

2009-10-25 Thread Mark Tolonen
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

Re: Strange behavior related to value / reference

2009-10-28 Thread Mark Dickinson
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

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Mark Hammond
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

Re: Command parsing... best module to use?

2009-11-02 Thread Mark Tolonen
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

Re: import bug

2009-11-04 Thread Mark Leander
./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

Re: unable to compile Python 2.6.4 on AIX using gcc

2009-11-04 Thread Mark Dickinson
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

Re: Microsoft research on code quality

2009-11-11 Thread Mark Leander
> 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

Re: Python C API and references

2009-11-12 Thread Mark Dickinson
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

Re: the unicode saga continues...

2009-11-13 Thread Mark Tolonen
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

Re: Run a external program.

2009-11-14 Thread Mark Tolonen
xactly. Also provide the shell command you are running that works. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing history?

2009-11-15 Thread Mark Dickinson
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

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread Mark Dickinson
> > 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

Re: Calling Python functions from Excel

2009-11-17 Thread Mark Tolonen
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

Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-17 Thread Mark Hammond
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

Re: Calling Python functions from Excel

2009-11-17 Thread Mark Tolonen
"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.

Book: Programming Python 3 (Second Edition) now available

2009-11-20 Thread Mark Summerfield
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

Re: Regexp and multiple groups (with repeats)

2009-11-20 Thread Mark Tolonen
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

Re: Sorting: too different times. Why?

2009-11-22 Thread Mark Dickinson
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

Re: reading windows event logs

2009-11-25 Thread Mark Hammond
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

Re: unencountered error in FFT python

2010-01-31 Thread Mark Dickinson
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

Re: unencountered error in FFT python

2010-01-31 Thread Mark Dickinson
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

Re: How to guard against bugs like this one?

2010-02-02 Thread Mark Dickinson
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

Re: Common area of circles

2010-02-04 Thread Mark Dickinson
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

Re: Last M digits of expression A^N

2010-02-05 Thread Mark Dickinson
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

Re: Last M digits of expression A^N

2010-02-06 Thread Mark Dickinson
% 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

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread Mark Dickinson
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

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread Mark Dickinson
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-

I've built Python, but can't figure out how to package it for windows

2010-02-09 Thread Mark Jones
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

Re: I've built Python, but can't figure out how to package it for windows

2010-02-09 Thread Mark Jones
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ó: > > >

Re: Ternary plus

2010-02-10 Thread Mark Dickinson
"""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

Re: Ternary plus

2010-02-10 Thread Mark Dickinson
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

Re: strange issue with C extension using Py_BuildValue

2010-02-10 Thread Mark Hammond
, PyLong_FromVoidPtr(sender), &msgPtr->data, ret); and PyLong_AsVoidPtr() for the other direction. HTH, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: I've built Python, but can't figure out how to package it for windows

2010-02-10 Thread Mark Jones
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

Re: Bizarre arithmetic results

2010-02-11 Thread Mark Dickinson
> 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

Re: Bizarre arithmetic results

2010-02-11 Thread Mark Dickinson
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

Re: ANN: obfuscate

2010-02-11 Thread Mark Lawrence
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

Re: ANN: obfuscate

2010-02-12 Thread Mark Lawrence
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

Re: Modifying Class Object

2010-02-12 Thread Mark Lawrence
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

Re: MemoryError, can I use more?

2010-02-12 Thread Mark Lawrence
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

Re: Function attributes

2010-02-13 Thread Mark Lawrence
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

Re: Function attributes [OT]

2010-02-13 Thread Mark Lawrence
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

Re: Modifying Class Object

2010-02-13 Thread Mark Lawrence
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

Re: problem with floats and calculations

2010-02-14 Thread Mark Lawrence
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

Re: Python Optimization

2010-02-14 Thread Mark Lawrence
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

Re: Python Optimization

2010-02-14 Thread Mark Dickinson
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

Re: Python Optimization

2010-02-14 Thread Mark Dickinson
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

Re: Python Optimization

2010-02-14 Thread Mark Dickinson
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

Re: Referring to class methods in class attributes

2010-02-17 Thread Mark Lawrence
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

Re: Which mock library do you prefer?

2010-02-17 Thread Mark Lawrence
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

Re: What happened to pyjamas?

2010-02-18 Thread Mark Lawrence
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

Re: Few questions on SOAP

2010-02-18 Thread Mark Lawrence
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

Re: The Disappearing Program?

2010-02-19 Thread Mark Lawrence
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

Re: The Disappearing Program?

2010-02-19 Thread Mark Lawrence
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.

Looking for crossfold validation code

2010-02-19 Thread Mark Livingstone
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

Re: Trouble running pywin32-214.win-amd64-py3.1 on 64-bit Windows 7

2010-02-19 Thread Mark Hammond
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

Re: Precision issue in python

2010-02-20 Thread Mark Dickinson
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

Re: Precision issue in python

2010-02-20 Thread Mark Dickinson
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

Re: Precision issue in python

2010-02-20 Thread Mark Dickinson
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

Re: formatting a number as percentage

2010-02-21 Thread Mark Dickinson
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

Re: Saving the Interactive Window with PythonWin

2010-02-21 Thread Mark Hammond
.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

Re: Efficiently building ordered dict

2010-02-22 Thread Mark Lawrence
e confusing ordering with sorting. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre arithmetic results

2010-02-23 Thread Mark Dickinson
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

Re: Docstrings considered too complicated

2010-02-26 Thread Mark Lawrence
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. --

Re: Six Minutes and fourty two seconds

2010-02-26 Thread 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

Re: Docstrings considered too complicated

2010-03-01 Thread Mark Lawrence
e astronomical when compared to initial development costs. Regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Python training in Florida, April 27-29

2010-03-02 Thread Mark Lutz
in sunny and warm Florida soon. --Mark Lutz at learning-python.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for the mysterious zlib.py* files in Python 2.6.4 (32-bit) for Windows

2010-03-04 Thread Mark Lawrence
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

Re: best practices: is collections.defaultdict my friend or not?

2010-03-07 Thread Mark Lawrence
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

Re: compiler with python

2010-03-07 Thread Mark Lawrence
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

Re: Calculating very large exponents in python

2010-03-08 Thread Mark Dickinson
; 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

Re: Can't define __call__ within __init__?

2010-03-10 Thread Mark Lawrence
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):

Re: Calculating very large exponents in python

2010-03-10 Thread Mark Dickinson
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

Re: Calculating very large exponents in python

2010-03-10 Thread Mark Dickinson
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

Re: python to exe

2010-03-13 Thread Mark Lawrence
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

Re: python to exe

2010-03-14 Thread Mark Lawrence
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

<    44   45   46   47   48   49   50   51   52   53   >