Re: Windows XP unicode and escape sequences

2007-12-16 Thread Ross Ridge
continue on with the Greek letters printing correctly? Unfortunately, you can't easily change the encoding of file object after it's been created. It's probably simpler convert Unicode strings to cp869 before printing them instead of having Python do it automatically for you.

Re: IronPython faster than CPython?

2007-12-19 Thread Ross Ridge
ation time takes much longer. A command line utility of mine that takes 1.5 seconds to run with CPython, ends up taking 20 seconds with IronPython. That 3 seconds for IronPython's own startup and initilization, 12 seconds for importing modules, and 5 seconds for the rest.

Re: Allowing Arbitrary Indentation in Python

2007-12-19 Thread Ross Ridge
columnLayout(adj=True, cat=('both', 2)) for i in layouts: cmds.button(l=i) cmds.setParent('..') cmds.setParent('..') cmds.setParent('..') cmds. setParent('

Re: Understanding memory leak reports

2007-12-21 Thread Ross Ridge
's just a warning that those objects needed to be garbage collected because they were refering to each other in some sort of cycle. While the memory used was being wasted before the garbage collector ran, it probably doesn't have any negative effect on your program.

Re: Python DLL in Windows Folder

2007-12-23 Thread Ross Ridge
o the system directory when you upgrade to Visual Studio 2008. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Python DLL in Windows Folder

2007-12-24 Thread Ross Ridge
for drivers and system files. Installing application DLLs in the system directory is something that should only be done for backwards compatiblity. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://ww

Re: Python DLL in Windows Folder

2007-12-25 Thread Ross Ridge
ing so, instead of relying on there >being a specific version of the python dll in the windows folder. This >is just general best practice on Windows. Ross Ridge <[EMAIL PROTECTED]> wrote: >No, it's not best practice for an application install any of its files >in the Windo

Re: Python DLL in Windows Folder

2007-12-26 Thread Ross Ridge
#x27;t belong in the system directory. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-25 Thread Ross Ridge
mno-cygwin" is a Cygwin application. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-25 Thread Ross Ridge
hat you can legitimately use in anything you distribute you need to buy a Microsoft C++ compiler. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-25 Thread Ross Ridge
but it is the standard "official" Windows system C library. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MS VC++ Toolkit 2003, where?

2006-04-25 Thread Ross Ridge
binutils 2.16.91 or newer if you want to link with any of the ".lib" files included with Python 2.4. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-26 Thread Ross Ridge
Ross Ridge wrote: > MSVCRT.DLL has been a standard system compent of Windows since at least > Windows 98. Many other system components depend on it. Essentially, > MSVCRT.DLL is an "undocumented" part of the Windows API. It's not > exactly "endorsed", Micros

Re: MinGW and Python

2006-04-26 Thread Ross Ridge
Ross Ridge wrote: > Not exactly. They're both GCC, but the MinGW compiler that you can > download from MinGW WWW site is a native Win32 appliction, while the > "MinGW" compiler included with Cygwin and invoked by "-mno-cygwin" is a > Cygwin application.

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
Ross Ridge wrote: > Nonetheless, Cygwin applications are not generally considered native > Win32 applications because of the dependency on CYGWIN1.DLL and the > related environment. While what you're saying a strictly true, the > term "native Win32" is used to make a di

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
Cygwin port of GCC. The two ports are very similar, but the Cygwin port is a Cygwin application. That means, for example, it uses Cygwin pathnames instead of the standard Win32 pathnames that MinGW uses. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
sturlamolden wrote: > That is correct. And it is the reson why the MinGW team is working on > removing the dependency on this CRT. No one is working on removing MinGW's depency on MSVCRT.DLL. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
n-us;326922 This article describes how MSVCR70.DLL, MSVCR71.DLL and MSVCR80.DLL should be installed. Since these DLLs, as the article points out, aren't system files they should differently than MSVCRT.DLL. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-28 Thread Ross Ridge
Ross Ridge write: > No one is working on removing MinGW's depency on MSVCRT.DLL. Ames Andreas wrote: > There is certainly work underway to ease the use of msvcrXX in > mingw built binaries. Danny makes it pretty clear in the message you refered that he's not working on that.

Re: MinGW and Python

2006-04-28 Thread Ross Ridge
Ross Ridge wrote: > You'd have to point people who don't already have it to Microsoft's > download site. sturlamolden wrote: > Is there a download site? I have not been able to localise one. Links where you can download them were posted in the thread you started on the

Re: MinGW and Python

2006-04-29 Thread Ross Ridge
don't change between versions of the runtime. See the MSDN library page you refered to earlier: http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx >... and you don't have the import library. I already mentioned where you can get it. Ross

Re: documentation for win32com?

2006-05-23 Thread Ross Ridge
way" of doing those things. Different versions of Excel may do things the same way or differently depending on what exactly you're trying to do. > If so, where can I find a list of those objects and methods? In the documentation for the version of Excel you're using.

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
Ross Ridge writes: > Whatever you want to call it, the Python DLL is not part of the operating > system, it's not a driver and doesn't belong in the system directory. <[EMAIL PROTECTED]> wrote: >Is that just your personal opinion, or a guideline from the operating >

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
he name of the DLL changes. If the name of the DLL changes, the shared location its installed to can also change. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
Ross Ridge writes: > No, that doesn't follow from the requirements given. The only exception > for something that isn't a service or device driver is for backwards > compatibility. Also, pretty much any DLL supports side-by-side > installation. <[EMAIL PROTECTED]> w

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
Ross Ridge writes: > As I said before, I know how futile it is to argue that Python should > change it's behaviour. I'm not going to waste my time telling you what > to do. If you really want to know how side-by-side installation works, > you can try reading the Win

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
Ross Ridge wrote: > Your choice to use a tool chain that doesn't support side-by-side > assemblies does not make it impossible. Christian Heimes <[EMAIL PROTECTED]> wrote: > I'm looking forward to your contribution to solve the problem. I find that highly unlikely. Re

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
<[EMAIL PROTECTED]> wrote: > I did, and determined that it's not possible. We would have to use > assembly manifests, and can't, as the tool chain doesn't support them. Ross Ridge writes: > Your choice to use a tool chain that doesn't support side-by-side >

Re: Python too slow?

2008-01-10 Thread Ross Ridge
lead people into thinking Python performs similarily to Java. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too slow?

2008-01-11 Thread Ross Ridge
e two are superficial, Python doesn't compile and execute code "just like" Java. Try all you want to try to reparse what you wrote in to a different meaning, it doesn't change the fact your intent was to mislead. Ro

Re: Python too slow?

2008-01-11 Thread Ross Ridge
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > And the reference implementation of Python (CPython) is not > interpreted, it's compiled to byte-code, which is then executed by a VM > (just like Java). Ross Ridge a écrit : > Python's byte-code interpreter is no

Re: Is this a bug, or is it me?

2008-01-18 Thread Ross Ridge
and staticmethod objects get turned into functions. Something like the following should work: class C: def f1(): pass F = {'1': f1} f1 = staticmethod(f1) # if you need C.f1() to work as well If you don't need C.f1() to work you

Re: subprocess and & (ampersand)

2008-01-23 Thread Ross Ridge
?word=tim&cached=0"; >] >subprocess.Popen (cmd) > > You need to use double quotes both in the .BAT file and in the string you pass to subprocess.Popen(). Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -(

Re: subprocess and & (ampersand)

2008-01-23 Thread Ross Ridge
Tim Golden <[EMAIL PROTECTED]> wrote: > but this doesn't: > > > "c:\Program Files\Mozilla Firefox\firefox.exe" "%*" > > > > import subprocess > > cmd = [ > r"c:\temp\firefox.bat", > "http://local.goodtoread.o

Re: Using a dict as if it were a module namespace

2008-01-27 Thread Ross Ridge
angles >the global namespace of the calling code, not the code being tested. It wouldn't work because the timeit module's "globals" are different from the __main__ module's globals. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Ross Ridge
ing directory, so it's strange the isabs() behaves differently. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Ross Ridge
hon and it doesn't think stdin/stdout is attached to a console. If you're using the Cygwin version of Python than it's probably bug. If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support re

Re: Python Memory Manager

2008-02-20 Thread Ross Ridge
cache, rather than the RAM. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
eason keeping me from switching to Python 3 for a long time. If the slash (/) operator had always been defined as floating point division then I would've gotten used to it. Now however, there's no compelling reason for me to try to adjust to this new behaviour.

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
TECTED]> wrote: > The natural result of doing arithmetic with natural numbers is more > natural numbers. D'Arcy said nothing about natural numbers, and bringing them up adds nothing to this discussion. Ross Ridge -- l/ // Ro

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
Ross Ridge <[EMAIL PROTECTED]> writes: > D'Arcy said nothing about natural numbers, and bringing them up adds > nothing to this discussion. Paul Rubin <http://[EMAIL PROTECTED]> wrote: > The numbers D'Arcy is proposing to operate on that way are natural > numb

Re: time.time() strangeness

2008-02-26 Thread Ross Ridge
a 32-bit single-precision floating-point value. This means that number returned by time.time() only has 24 bits of precision, which for current time values, only gives you an accuracy of a hundred seconds or so. Ross Ridge -- l/ // Ross Ridge

Re: time.time() strangeness

2008-02-27 Thread Ross Ridge
ng FPU precision could have an effect on low end configurations. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-27 Thread Ross Ridge
ave a problem with the behviour of the slash (/) operator changing. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
our that no one wants. No one is going to win this argument by using words like "natural" or "obvious". You're just going to have to accept that there that there is no concensus on this issue and there never was. In the end only one person's opinion of what was natura

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
Ross Ridge wrote: > You're just going to have to accept that there that there is no > concensus on this issue and there never was. Steven D'Aprano <[EMAIL PROTECTED]> wrote: >But that's not true. The consensus, across the majority of people (both >programmers a

Re: BitVector

2008-03-10 Thread Ross Ridge
a.fromlist([0] * (8 - remainder)) s = a.tostring() s = binascii.unhexlify(s.translate(_tr_rev_2)) s = binascii.unhexlify(s.translate(_tr_rev_4)) return binascii.unhexlify(s.translate(_tr_rev_16)) I've

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Ross Ridge
than OpenGL here. The overhead of calling some sort of putpixel() function over and over will domininate everything else. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~

Re: Anomaly in time.clock()

2008-03-19 Thread Ross Ridge
value in the range of -3.5 to -4.5. However, a race condition occuring between the two evaluations of "curTime - self.timeStamp" is the only way your example program could print a negative value. Ross Ridge -- l/ // Ross Ridge -- The Great H

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
gh I think it would also be possible on MIPS CPUs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
Intel systems it's normally handled completely within the cache. >The LOCK prefix adds about 100 cycles to the instruction. That's unavoidable. It's still faster than spin lock, which would also have to use syncronizing instructions. Ross Ridge -

Re: what's the point of rpython?

2009-01-21 Thread Ross Ridge
hanism that prevents ordinary "unlocked" instructions from simulanteously modifying the same cache line on two different processors also provides the guarantee with "locked" instructions. There's no additional hardware locks involved, and no additional communication required.

Re: what's the point of rpython?

2009-01-22 Thread Ross Ridge
Ross Ridge writes: > The same cache coherency mechanism that prevents ordinary "unlocked" > instructions from simulanteously modifying the same cache line on > two different processors also provides the guarantee with "locked" > instructions. There's no addit

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-25 Thread Ross Ridge
oft Visual C++ runtime library, and isn't "free software" in the FSF sense. It's free as in beer, but then so is the Microsoft compiler. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:/

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread Ross Ridge
. There are many characters in Unicode that can't be reasonably mappped to a single fixed-width "console" glyph. There are also characters in Unicode that should be represented as single-width gylphs in Western contexts, but as double-width glyphs in Far-Eastern contexts

Variable + String Format

2009-02-09 Thread Joel Ross
Hi all, I have this piece of code: # wordList = "/tmp/Wordlist" file = open(wordList, 'r+b') def readLines(): for line in file.read(): if not line: break print line + '.com ' re

Re: Variable + String Format

2009-02-09 Thread Joel Ross
Joel Ross wrote: Hi all, I have this piece of code: # wordList = "/tmp/Wordlist" file = open(wordList, 'r+b') def readLines(): for line in file.read(): if not line: break

Re: Variable + String Format

2009-02-10 Thread Joel Ross
Steven D'Aprano wrote: On Wed, 11 Feb 2009 18:52:40 +1100, Joel Ross wrote: Thanks for the quick response guys. Help me out a alot. I'm a newbie to python and your replies help me understand a bit more about python!! Joel, unless you have Guido's time machine and are actual

Re: Variable + String Format

2009-02-10 Thread Joel Ross
Joel Ross wrote: Hi all, I have this piece of code: # wordList = "/tmp/Wordlist" file = open(wordList, 'r+b') def readLines(): for line in file.read(): if not line: break

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
e header in a Usenet message, so there's nothing wrong with the original poster's newsreader. In any case what the original poster really should do is come up with a better name for his program Ross Ridge -- l/ // Ross Ridge -- The Grea

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
/828fefd7040238bc I could just as easily argue that assuming ISO 8859-1 is the defacto standard, and that its your newsreader that's broken. The reality however is that RFC 1036 is the only standard for Usenet messages, defacto or otherwise, and so there's nothing wrong with an

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 14:52:09 -0500) > Except in practice unlike Python, many newsreaders don't assume ASCII. Thorsten Kampe wrote: >They assume ASCII - unless you declare your charset (the exception being >Outlook Express and a few Windows newsreaders). Everything else

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 17:07:35 -0500) > The link demonstrates that Google Groups doesn't assume ASCII like > Python does. Since popular newsreaders like Google Groups and Outlook > Express can display the message correctly without the MIME headers, > but your obscure one

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 18:06:35 -0500) > I understand what Unicode and MIME are for and why they exist. Neither > their merits nor your insults change the fact that the only current > standard governing the content of Usenet posts doesn't require their > use. Thorsten Kampe

Re: HELP!...Google SketchUp needs a Python API

2008-11-28 Thread Ross Ridge
for any other post in this thread. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging a Python Program that Hangs

2008-12-03 Thread Ross Ridge
int_exc() raise Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Ross Ridge
"""Convert an array containing a sequence of bits to a string.""" remainder = len(a) % 8 if remainder != 0: a.fromlist([0] * (8 - remainder)) s = a.tostring() s = binascii.unhexlify(s.translate(_tr_rev_2))

Re: Efficient Bit addressing in Python.

2008-10-11 Thread Ross Ridge
Ross Ridge wrote: >I don't think you can do anything faster with standard modules, although >it might not be efficient if you're only working with a single byte. Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: >Thanks I was not aware of binascii module this looks powerful

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Ross Ridge
en to be supported in 2.5 or 2.6? The fact that I can't change the encoding attribute of sys.stdout/stderr/stdin has caused problems for me in the past. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-20 Thread Ross Ridge
ata directory (if not). However, the normal place to store settings on Windows is in the registry. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation

2008-10-20 Thread Ross Ridge
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > I can't remember having seen any other "standard" so far. > Ross Ridge a écrit : > I've seen various indentation styles used in examples on this newsgroup. Bruno Desthuilliers <[EMAIL PROTECTED]> wro

Re: indentation

2008-10-20 Thread Ross Ridge
else uses 2 space indentation. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation

2008-10-20 Thread Ross Ridge
lly can be *the* standard if it's only being followed it when it's convenient. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.or

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > However, the normal place to store settings on Windows is in the registry. Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > Which becomes a single point of failure for the whole system. As opposed to the file system being the sin

Re: What was that, what was it?

2008-10-21 Thread Ross Ridge
o go fast, but good for a lot of every day tasks. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > As opposed to the file system being the single point failure? Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >The file system is involved regardless. But leaving out an additional >layer of failure on top of it does make things more robust, yes. No,

Re: Exception difference 2.4 ==> 2.5

2008-11-18 Thread Ross Ridge
at all. Python 2.5 changed the exception hierarchy a bit. The Exception class is no longer at the root and now inheirits from BaseException. If the exception being thrown was KeyboardInterrupt or SystemExit then it won't be caught by your code. Ros

Re: Exception difference 2.4 ==> 2.5

2008-11-19 Thread Ross Ridge
r error. The client thread then throws a ProtocolError, which is uncaught. So exceptions are working fine in your test case, the problem is that xmlrpclib.dumps() can't marshall xmlrpclib.Fault objects in 2.5. Ross Ridge -- l/ // Ross Ridge -- The Gr

print from a python script.

2009-04-06 Thread Ronn Ross
I'm trying to print a simple string to a network printer. This is what I have so far: import os printer_path = "192.168.200.139" p = os.popen(printer_path, 'w') p.write("this is a printer test") p.close() I'm trying to call the printer from its IP address. When I run the script I get: sh: 192.16

Scraping a web page

2009-04-07 Thread Ronn Ross
I'm using the following to scrape a web page: import urllib f = urllib.urlopen("http://www.google.com";) s = f.read() It is working, but it's returning the source of the page. Is there anyway I can get almost a screen capture of the page? Dankon -- http://mail.python.org/mailman/listinfo/python-

Sorting a dictionary

2009-05-12 Thread Ronn Ross
I'm attempting to sort for the results of a dictionary. I would like to short by the 'key' in ascending order. I have already made several attempts using: sorted() and .sort(). Here is my loop: for key,value in word_count.items(): print sorted(key), "=", value Thanks -- http://mail.py

While Statement

2009-05-22 Thread Joel Ross
Hi all, I have this piece of code class progess(): def __init__(self, number, char): total = number percentage = number while percentage > 0 : percentage = int(number/total*100) number-=1 char+="*" print char progess

Re: While Statement

2009-05-22 Thread Joel Ross
Joel Ross wrote: Hi all, I have this piece of code class progess(): def __init__(self, number, char): total = number percentage = number while percentage > 0 : percentage = int(number/total*100) number-=1 c

Re: While Statement

2009-05-22 Thread Joel Ross
Andre Engels wrote: On Fri, May 22, 2009 at 11:17 AM, Joel Ross wrote: Hi all, I have this piece of code class progess(): def __init__(self, number, char): total = number percentage = number while percentage > 0 : percentage = int(number/total*

Re: While Statement

2009-05-22 Thread Joel Ross
Andre Engels wrote: On Fri, May 22, 2009 at 12:35 PM, Joel Ross wrote: Im using 2.6 python and when running this class progess(): def __init__(self, number, total, char): percentage = float(number/total*100) percentage = int(round(percentage)) char = char

Re: While Statement

2009-05-22 Thread Joel Ross
Dave Angel wrote: Tim Wintle wrote: On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote: number/total = 998/999 = 0 number/total*100 = 0*100 = 0 float(number/total*100) = float(0) = 0.0 Change "float(number/total*100)" to "float(number)/total*100" and it should work: I'd use: (n

Problems with sys.stout.flush()

2009-05-22 Thread Joel Ross
Hi all, I'm using python 2.5 and trying to flush the sys.stout buffer with sys.stout.flush(), but doesn't seem to work. Each time a line is printed it appends the one before it I need to clear the output and write a new output without appending the previous one. I have tried the -u (unbuffe

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Carl Banks wrote: On May 22, 10:33 pm, Joel Ross wrote: Hi all, I'm using python 2.5 and trying to flush the sys.stout buffer with sys.stout.flush(), but doesn't seem to work. Each time a line is printed it appends the one before it I need to clear the output and write a new outp

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Carl Banks wrote: On May 23, 2:20 am, Joel Ross wrote: Carl Banks wrote: On May 22, 10:33 pm, Joel Ross wrote: Hi all, I'm using python 2.5 and trying to flush the sys.stout buffer with sys.stout.flush(), but doesn't seem to work. Each time a line is printed it appends the one

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Carl Banks wrote: On May 23, 3:49 am, Joel Ross wrote: def progressbar(self, number, total, char): percentage = float(number*100)/total percentage = int(round(percentage)) percentage = int(100 - percentage) self.f=sys.stdout if percentage >

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Thanks for all the help guys. I got it to work correctly with this class progress: def __init__(self): self.already = 0 def progressbar(self, number, total, char): percentage = int(100 - round(number*100.0/total)) if percentage > 0: xchar = char * (perc

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Rhodri James wrote: On Sat, 23 May 2009 18:19:11 +0100, Joel Ross wrote: Now I can move onto next one. Except that you still have the interesting issue that your environment isn't responding to '\r' correctly, which worries me rather. Or did you never test that? Yeah I gav

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Dennis Lee Bieber wrote: flush() is working perfectly fine -- it says transmit any data still held within internal buffers. It is NOT a "clear screen", "clear line" terminal command. I was mistaken about the sys.stout.flush(). I understand it a little more now thanks -- http://mail.py

Re: Problems with sys.stout.flush()

2009-05-23 Thread Joel Ross
Mel wrote: Joel Ross wrote: Rhodri James wrote: [ ... ] Except that you still have the interesting issue that your environment isn't responding to '\r' correctly, which worries me rather. Or did you never test that? Yeah I gave the "\r" a go and it kept printing

Re: Problems with sys.stout.flush()

2009-05-24 Thread Joel Ross
AK wrote: import time, sys print "ONE", sys.stdout.flush() time.sleep(0.5) print "\rTWO", sys.stdout.flush() time.sleep(0.5) Running the command above prints out ONE TWO but running for i in range(10): print "ONE", time.sleep(0.2) prints out ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE

Tkinter file dialog

2009-05-28 Thread Ronn Ross
I'm using Tkinter file selector to get a direcotry path. I'm using: self.file = tkFileDialog.askdirectory(title="Please select your directory") print file but all it prints out is: How would I print the directory path? Thanks -- http://mail.python.org/mailman/listinfo/python-list

RFID and Python

2009-05-31 Thread Ronn Ross
I'm looking to play around with RFID and Python. Can anyone offer any suggestions on the cheap? I'm possibly looking for a starter kit. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Ross Ridge
e-precision arithmetic. That way your answers are only wrong when you use long double or float. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading just in time

2008-07-11 Thread Ross Ridge
ax from calc_tax import calc_tax return calc_tax(*arg, **name) I suspect though that the cost of importing a lot of little modules won't be as bad as you might think. Ross Ridge -- l/ // Ross Ridge -- The Great HTM

Re: Change PC to Win or Windows

2008-07-31 Thread Ross Ridge
erPC processors that ran Windows NT. I even remember seeing one that had ISA slots. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >