Re: def index(self):

2006-12-19 Thread Tim Roberts
tarted >with, there are a few gotchas. You're above snippet should be: > >class HelloWorld(object): > def index(self): > return "Hello World" > index.exposed = True Many people find it more readable to write that as: class HelloWorld(object): @

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Tim Roberts
a Windows system, using stat, the definition is "has an extension that is in PATHEXT". Nothing more, nothing less. In both cases, the contents of the file are irrelevant. Now, when you, as a human being, try answer the question "is this file executable", you would use more s

Re: Help with small program

2006-12-29 Thread Tim Roberts
will be suboptimal. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: File write() problem

2006-12-29 Thread Tim Roberts
erPassword: print "Server warning: No password has been set" pwd1 = getpass("New Password: ") pwd2 = getpass("Confirm Password: ") while pwd1 != pwd2: print "Passwords did not match" pwd1 = getpass("New Password: ") pwd2 = getpass("Confirm Password: ") open(FN, 'w').write(pwd2+'\n') serverPassword = open(FN, 'r').readline() -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: DOS, UNIX and tabs

2006-12-29 Thread Tim Roberts
"Ben" <[EMAIL PROTECTED]> wrote: > >Great - that worked.Thanks! >Is that a general method in linux you can always use to redirect >standard output to a file? Works in Windows, too. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.py

Re: INSERT statements not INSERTING when using mysql from python

2006-12-30 Thread Tim Roberts
icality, I try never to use them, because they might not be available in my next database. After all, you should have a pretty good idea at any given time whether your database and table already exist. I do occasionally allow myself a "DROP TABLE IF NOT EXISTS", which then allows th

Re: Easiest way to print from XP/DOS.

2006-12-30 Thread Tim Roberts
n" will not go anywhere. Typing to "prn" is a dreadful way to do printing on Windows. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Easiest way to print from XP/DOS.

2006-12-31 Thread Tim Roberts
results. Is it a USB printer? Remember that "prn" and "lpt1" refer to the first parallel port, not necessarily the first printer. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about unicode() function

2006-12-31 Thread Tim Roberts
= unicode(content,"gbk") >print content >content.close() Once you fix the lambda, as Felipe described, there's another issue here. You are telling the unicode function that the string you're passing it is an 8-bit string encoded as gbk. How do you know that? In your s

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Tim Roberts
that is setuid root that calls your script for you. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: cache line length of a machine

2007-01-04 Thread Tim Roberts
he size and speed using WMI (assuming you are using Windows). For more detailed, you will have to call into a C routine, and maybe even resort to looking up the cpuid info. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Module to read svg

2007-01-09 Thread Tim Roberts
rocessing needs, that might be sufficient. > >I don't think it quite fits what the OP is asking for. SVG defines some non-XML >structure for some of its contents. For example: > > Why is that non-XML? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython layout problem

2006-01-24 Thread Tim Roberts
s to sizers from the inside out. That works for me, but some kind of structure is needed to make sure that ownership and sizership are handled completely. You might try posting on the wxPython mailing list, http://www.wxpython.org/maillist.php. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & B

Re: os.unlink() AND win32api.DeleteFile()

2006-01-24 Thread Tim Roberts
ot; attribute ('attrib +s'), but that doesn't make it special. Now, there certainly ARE special shell folders that do not exist in the file system. Control Panel and My Network Places are two examples. DeleteFile cannot touch those. You must use shell APIs. -- - Tim Roberts, [EMAI

Re: Trouble opening files

2006-01-29 Thread Tim Roberts
ot;. Fortunately, most Win32 APIs will ignore double-backslashes, but it isn't right. And, they are guaranteed not to work if they are the first characters of the filename. >#print filename > >f = file(filename,'\r') #open file for reading Where did you get that? \r is

Re: HTML parsing bug?

2006-02-01 Thread Tim Roberts
He put a Javascript comment inside an HTML comment, inside a pair. Virtually every page with Javascript does exactly the same thing. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: simple perl program in python gives errors

2006-02-01 Thread Tim Roberts
Dan Lowe <[EMAIL PROTECTED]> wrote: > >Not sure if you typo'd that, but that should read: > >a += 20 * 14 >print a Did you try to run that? -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: by reference

2006-02-10 Thread Tim Roberts
post your exact Python code, with the results you get, and the results you expect. That's usually enough! -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Inserting record with Microsoft Access

2006-02-10 Thread Tim Roberts
the fields of your new record, including the autonumber. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write a C-style for loop?

2006-02-15 Thread Tim Roberts
gt; >But how would you write a C# for loop in Python? Do you rework a while >loop, or use the range() function? > >Here's an example: > >for (int i = 0; i < 50; i += 5) > >How would that go in Python, in the simplest and most efficient way? for i in range(0,5

Re: Multiplication optimization

2006-02-20 Thread Tim Roberts
plication operations as in: Integer multiplication is a 1-cycle operation in Intel processors. Even multiple-precision multiplication is very efficient -- probably more so than multiple comparisons and jumps. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: html parser , unexpected '<' char in declaration

2006-02-21 Thread Tim Roberts
e rest If this is happening with more than one message, you could check for it rather easily with a regular expression, or even just ''.find, and then either insert a closing '>' or delete everything up to the before parsing it. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: spaces at ends of filenames or directory names on Win32

2006-02-24 Thread Tim Roberts
. 02/24/2006 11:49 PM .. 02/22/2006 10:49 PM 539 x.c 1 File(s)539 bytes 2 Dir(s) 50,937,999,360 bytes free C:\tmp\x> -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode question

2006-02-25 Thread Tim Roberts
x27;ascii', 'backslashreplace') >.decode('ascii')) > >Surely there's a better way than converting back and forth 3 times? I didn't check whether this was faster, although I rather suspect it is not: cvt = lambda x: ord(x)<0x80

Re: spaces at ends of filenames or directory names on Win32

2006-02-26 Thread Tim Roberts
' XXX ' does indeed exist. > >Can anyone rescue me from this madness :( Use double-quotes on Windows, not single-quotes. Single-quotes are taken as just another filename character. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: can't assign to a function call

2006-02-26 Thread Tim Roberts
emantics, use for example >> >> f().extend([4]) >> > >Cool, thanks. That's what I did, it's just not an error I'd seen >before. Everywhere else Python evaluates the function call and then >does it's stuff with the result. One thing that can be help

Re: how do I factor a number down to one digit?

2006-03-01 Thread Tim Roberts
number to a single digit. Like 123 would >be 1+2+3 returning a 5. Hmm, in most of the rational mathematical universes I've visited, 1+2+3 returns 6, not 5. On the other hand, numerology doesn't really have much of a place in a rational mathematical universe. -- - Tim Roberts, [EMAI

Re: newbie question

2006-03-02 Thread Tim Roberts
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PY;.PYW;.tcl If you give a lone file name without an extension, it will try all of those extensions, in that order, to find an executable. Just add .PY to the end. There is a bug in NT's CMD.EXE that screws up redirection of stdin,

Re: If you use PayPal you might consider an alternative

2005-05-04 Thread Tim Roberts
s: > >www.greenzap.com/benefits That web zite iz juzt too cutezy. I could never truzt it, even if I hadn't learned about it through a newzgroup zpam. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with csv module

2005-05-14 Thread Tim Roberts
he canonical csv application. It can read a UCS-16 csv file, but it mishandles it. It doesn't split at the commas. It treats each line as a single cell. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: reg mail sending without smtp module

2005-05-14 Thread Tim Roberts
o out in a very small number of ways. On a Unix system, you can use SMTP, or you can call /usr/sbin/sendmail directly. On Windows, you can use SMTP, or you can use MAPI. There is no "magic" sink into which you can pour e-mail. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Bo

Re: how to config a comserver in a customize dll?

2005-05-22 Thread Tim Roberts
'SplitString' ] >_reg_progid_ = "TestPythonCom.Application" ># NEVER copy the following ID ># Use "print pythoncom.CreateGuid()" to make a new one. >_reg_clsid_ = "{93D78ABA-1F6C-4B1C-97C7-C3700511415A}" > >def SplitString(self, val): >

Re: Trouble with regexes

2005-05-26 Thread Tim Roberts
e.compile(r'(\r)[^\n]', re.IGNORECASE) > >it still matches a string such as r'\r\n' Hint: the string r'\r\n' contains four characters. It contains neither carriage return nor newline. Bigger hint: the string '\r\n' contains two characters. -- - Tim Rob

Re: Pressing A Webpage Button

2005-06-01 Thread Tim Roberts
you send the encoded parameters as the body of the HTTP request. You probably need to do some reading on HTTP, and the GET and POST methods of transmitting parameters. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: BUG pythonw vs subprocess

2005-06-01 Thread Tim Roberts
or message is quite accurate: non-console Win32 apps don't have stdin and stdout. The handles are invalid. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: BUG pythonw vs subprocess

2005-06-04 Thread Tim Roberts
x27;s not connected to anything... >> >So then it's not possible to get pythonw apps eg tkinter guis to use >subprocess properly? Seems a bit daft to me. There's no absolute requirement that a tkinter app use pythonw. If you call them with python.exe, they'll get a stdin and stdout. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with pythonpath

2005-06-04 Thread Tim Roberts
u either need to use different names for the two packages (pkg1, pkg2), or use a symbolic link to link spkg2 into the src directory. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: anygui,anydb, any opinions?

2005-06-08 Thread Tim Roberts
tarting to consider the version mess: try to >install xCHM, Boa Constructor, aMule, VLC and some other app together... >instant madness. They why would you do it? gvim and wxPython do the job for me. No mess. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Destructive Windows Script

2005-06-08 Thread Tim Roberts
;, '^', '&', '*', ';'] >> > >Note that the backslashes are redundant between pairs >of [ ], ( ) or { }. Just write: > > data = ['0', 'a', '1', 'b', '2', 'c', &g

Re: help with sending mail in Program

2005-06-08 Thread Tim Roberts
27;mail.mycompany.com') >s.ehlo('10.0.3.160') # IP address of my computer, I don't remember why I > needed this > >msg = '''From: %s >Subject: %s >To: %s > >%s >''' % (frm, subject, to, body) >

Re: anygui,anydb, any opinions?

2005-06-10 Thread Tim Roberts
Renato Ramonda <[EMAIL PROTECTED]> wrote: >Tim Roberts ha scritto: > >> wx uses "sizers" to do the same thing. Same purpose, different philosophy. >> I find sizers more natural, but people should certainly stick to whatever >> makes them comfortable. >

Re: how to operate the excel by python?

2005-06-12 Thread Tim Roberts
>"number formats" are not sensible, loss of information can result. This is a real problem. US postal codes are a particular nasty issue. The value "01234", for example, will be imported into Excel as "1234". -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: "also" to balance "else" ?

2005-06-16 Thread Tim Roberts
Nicolas Fleury <[EMAIL PROTECTED]> wrote: > >But the feature is already there: > >for x in : > BLOCK1 > if : > ALSO-BLOCK > break >else: > BLOCK2 I've been using Python for 8 years. I never knew that feature was in t

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-31 Thread Tim Roberts
y make the parser more complicated, because it could no longer be context-insensitive. For example, if I had identifiers called "mine" and "not mine", how would it parse this: if not mine: -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help! win32 com_error 'Exception occurred'

2007-06-02 Thread Tim Roberts
R. Seriously, what on earth did you expect this to do? Its whole purpose is send sounds to the sound driver. If there is no sound driver, what was it supposed to do with the audio data? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: updating db with csv

2007-06-10 Thread Tim Roberts
UPDATE xxx" that might do what you want. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: read 9 bytes

2007-06-10 Thread Tim Roberts
stance. >If I do: serialport.read(4) >I would get 8 bytes, No. You would get 4 bytes. Do you see documentation to the contrary? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: updating db with csv

2007-06-12 Thread Tim Roberts
Captain Paralytic <[EMAIL PROTECTED]> wrote: >On 11 Jun, 07:37, Tim Roberts <[EMAIL PROTECTED]> wrote: >| Not in standard SQL. MySQL supports a REPLACE extension that does >| an UPDATE if the key already exists, and an INSERT if it does not. >| There is also an extens

Re: Bytes/File Size Format Function

2007-06-13 Thread Tim Roberts
7;, 'tb','pb', 'eb', 'zb', 'yb'] >[int(log)] >) I have a couple of picky comments. The abbreviation for "bytes" should be "B"; small "b" is bits by convention. All of the prefixes above "k"

Re: Where can I suggest an enchantment for Python Zip lib?

2007-06-14 Thread Tim Roberts
n would be to reduce the priority of your archiving process. Your operating system is far better equipped to share the CPU than you are. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert to C/C++?

2007-06-14 Thread Tim Roberts
ringFromGUID to make it printable. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: python i2c ioctl

2007-06-14 Thread Tim Roberts
i2c_fd = i2c_open() if i2c_fd < 0: print "i2c open error" return 1 But, of course, that's not enough either; i2c_fd is a local variable in THIS function as well. You should change ALL of the functions so that they accept an fd as the first parameter, and then pass i2c_fd into the functions here. Alternatively, you could create a wrapper class to hold the fd and make the function methods on that class. >while "azz": >i2c_start () I'm curious. What do you think "while" statement is doing? The answer is that it is an infinite loop; the string "azz" will always be true, so the while statement will always loop. I can't guess what you really wanted here. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI apps in Windows with native widgets?

2007-06-18 Thread Tim Roberts
e with the Win32 API and MFC, pywin32 includes a relatively thin wrapper around MFC. It's quite possible to write GUI apps using it, and there are several good examples. I'm not sure that I'd prefer it to wxPython, however. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Tim Roberts
Bjorn Borud <[EMAIL PROTECTED]> wrote: > >bah, UNIX is not user hostile; it is just selective about its >friends. Right. My favorite Unix quote is from the same source (Dennis Ritchie): Unix is the answer. You just have to phrase the question very carefully. -- Tim

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Tim Roberts
h have our own favorite brand, and nothing you say will convince me to change mine. Editor, that is. I do occasionally change my underwear. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-28 Thread Tim Roberts
pt last in 1998. The current installer is as painless as most open source installers are. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: glob.glob standardization

2007-06-28 Thread Tim Roberts
ike os.listdir do? Martin gave you the real answer, but you should realize that your analysis of the behavior is faulty. In EACH case, glob.glob has returned all of the names that exactly match your pattern. It's not about absolute or relative. For example, if you do glob.glob( '.

Re: How can i change an Object type ?

2007-07-03 Thread Tim Roberts
ribute "Smart" is not >available >Error MEssage: >AttributeError: 'instance at 0x30216960>' object has no attribute 'Smart' Smart is part of IITUserPlaylist, not IITPlaylist. You need to call curPlaylist.QueryInterface to get the IITUserPlaylist, but that

Re: what is wrong with that r"\"

2007-07-05 Thread Tim Roberts
a\'"- > >So as long as your regex does not use all the valid characters, readability is >maintained. But what about my program that wants to use r_a_b_ as an identifier? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: what is wrong with that r"\"

2007-07-07 Thread Tim Roberts
>original meaning... sed can do that because its commands are one character long. Whatever follows an "s" must a delimiter because it can't be anything else. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread Tim Roberts
"Jim Langston" <[EMAIL PROTECTED]> wrote: > >Gah! Python goes right to left? Dang, I haven't seen that since APL. No, *exponentiation* in Python goes right to left, as it does in all the languages I've used that support an exponentiation operator. -- Tim Rober

Re: How to communicate via USB "port"

2007-04-18 Thread Tim Roberts
he device to send before you can talk to it. On the other hand, as someone else pointed out, many types of USB devices fall into standard device classes, and the operating system supplies drivers for those classes. If your GPS device is in the communication class, you might be able to pretend

Re: CGI Script using Python

2007-04-21 Thread Tim Roberts
download files to the client browser, but the user will have to be involved to tell the browser where to store the incoming file. Doing anything else would be a security hole. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: python cgi problem with textarea

2007-04-23 Thread Tim Roberts
as long as the textarea input has no spaces. > >it doest work because the "space" character isnt interpreted >correctly, you need to change the space characters too   What??? Did you even read the problem description? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple sqlite3 question

2007-04-25 Thread Tim Roberts
but if you had used "testdata" as the filename, it would have failed. You should use one of these alternatives: conn = sqlite3.connect('.\\optiondata') conn = sqlite3.connect(r'.\optiondata') conn = sqlite3.connect('./optiondata') conn = sqlite3.connect(

Re: Dedicated CPU core for Python?

2007-04-27 Thread Tim Roberts
the resources. Except for specific needs in some drivers, the use of CPU and thread affinity is virtually never a good idea. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: I have a chance to do somting diffrent way not Python ?!

2007-04-29 Thread Tim Roberts
e several very good Unix-derived shells available for Windows. UnxUtils includes a bash and a zsh. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: While we're talking about annoyances

2007-05-01 Thread Tim Roberts
f sequence.sort became much, much worse when a key function was supplied. I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate) because of that. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.join

2007-05-03 Thread Tim Roberts
g the >> previous drive letter, if there was one) are thrown away... > >Yes, but that still doesn't answer my question as to why os.path.join >works that way. I understand that that is how it is written, but why? It's behavior is exactly the same as if you did a series of

Re: pack/unpack zero terminated string

2007-05-03 Thread Tim Roberts
ich is that case won't be hard. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for HTMLGen?

2007-05-03 Thread Tim Roberts
For me, templating (Cheetah is my favorite, www.cheetahtemplate.org) makes more sense than building the page bit by bit in Python code, and the separation of function and presentation makes things easier to maintain. In my opinion, of course. ;) -- Tim Roberts, [EMAIL PROTECTED] Providenza &a

Re: Cannot execute Windows commands via Python in 64-bit

2007-05-05 Thread Tim Roberts
ievable but true. Although we were all smart enough to handle the transition from \windows\system in Win16 to \windows\system32 in Win32, Microsoft apparently believes programmers have all grown too stupid to handle the transition to Win64 on our own. Some registry references are also silen

Re: High resolution sleep (Linux)

2007-05-05 Thread Tim Roberts
, the timer interrupt would have to fire every 10us. The overhead of handling the timer interrupt and rescheduling that often is quite significant. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Iron Python

2007-05-16 Thread Tim Roberts
IronPython will give me the opportunity to really dig into WPF without having to drink the C# kool-aid. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: i/o prob revisited

2007-05-21 Thread Tim Roberts
nicode: need string or buffer, file found >Any solutions. I don't see how the error could possibly make it any clearer. "open" expects a file name. "output_file" is not a file NAME. It is a file OBJECT. If you want to reopen that file, then p

Re: Lists vs tuples (newbie)

2007-05-23 Thread Tim Roberts
Neil Cerutti <[EMAIL PROTECTED]> wrote: > >I use tuples simply because of their mellifluous appellation. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: too much memory use

2007-05-24 Thread Tim Roberts
RAM +1gb virtual store n hangs >cant think of an effective way to implement tree in memory(i can >compact it on disk by writing just the index no..along with the record >from which tree in memory can be reconstructed, but i have to >implement tree as previous to implement random a

Re: 0 == False but [] != False?

2007-05-24 Thread Tim Roberts
a false value in a Boolean context, but they are not all the same. As a general rule, I've found code like "if x == False" to be a bad idea in ANY language. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-29 Thread Tim Roberts
Frank Swarbrick <[EMAIL PROTECTED]> wrote: > >Then you'd really love COBOL! > >:-) > >Frank >COBOL programmer for 10+ years Hey, did you hear about the object-oriented version of COBOL? They call it "ADD ONE TO COBOL". -- Tim Roberts, [EMAIL PROTECTE

Re: Need Help with base64

2007-07-23 Thread Tim Roberts
} >else > { >cin[ni] = 0; >} >} >if( nlen ) > { >decodeblock( cin, cout ); > >} > memcpy(*ppcdest,cout,160); > return 0; "cout" is an array of 3 characters. Wher

Re: 128 or 96 bit integer types?

2007-07-27 Thread Tim Roberts
universe? In nanoseconds? >> >> :-) > >Well, 2**96 would only be 2512308552583 years. Yes, but that's still roughly 100 times the estimated age of the universe. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >So I never let the age of the universe intimidate me. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
bin has at least 1 marble? >> >>The answer >> >>66189415264331559482776409694993032407028709677550 >>59629130019289014193777349831417543311612293951363 >>4124491233746912456893016976209252459301489030 > >You missed that blue one in the corner... He lost that one to a talented 12-year

Re: MIMEText breaking the rules?

2007-08-02 Thread Tim Roberts
t;them. This behavior is documented in Message.Message, from which MIMEText eventually inherits. If you want to start over, delete the item: del Msg["To"] I would have to say that the existing behavior is more intuitive for an email object. -- Tim Roberts, [EMAIL PROTECTED] Providen

Re: os.listdir path error

2007-08-04 Thread Tim Roberts
instead, it works fine. Yes, but only by accident. It will fail again if you try to do os.listdir('c:\tmp'). You need to use the right quoting. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: libpq.dll for pgdb

2007-08-04 Thread Tim Roberts
d libpq. Here's one place to get it: http://www.tksql.org/dll/ -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a time duration to print out data where every 2 seconds is a pixel

2007-09-11 Thread Tim Roberts
;) >>finishPoint = strptime(step.fTime, "%H:%S:%M") Your conversion strings cannot be correct. Sure, there are international differences in rendering dates and times, but not even in Eastern WhereTheHeckIsStan do they encode hours, then seconds, then minutes. -- Tim Roberts

Re: anybody has py modules emulating symbian 60 on PC?

2007-09-12 Thread Tim Roberts
Steve Holden <[EMAIL PROTECTED]> wrote: > >http://archive.devx.com/wireless/vendordocs/nokia.asp might help. Or it >might not. How utterly refreshing: a completely honest Usenet posting... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail

Re: Error in random module, bad installation?

2007-09-12 Thread Tim Roberts
cal/bin/python >$ echo $PYTHONPATH >/usr/local/bin/python PYTHONPATH is supposed to point to the directory containing modules, NOT the directory containing the executable. It should be /lib/python2.5. However, Carsten had the real cause for your immediate problem. -- Tim Roberts, [

Re: how can I find out the value of an environment variable?

2007-03-07 Thread Tim Roberts
ot;, "credits" or "license" for more information. >>> import os >>> os.environ['PATH'] 'C:\\WINDOWS\\system32;c:\\WINDOWS;c:\\WINDOWS\\System32\\Wbem;c:\\bin;e:\\bin' >>> -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting Python... some questions

2007-03-12 Thread Tim Roberts
payload = p.chassis_id_tlv > ether = scapy.Ether(dst="01:02:03:04:05:06") > fullpayload = ether + payload > sendp(fullpayload) Now, at the end, add: if __name__=="__main__": main() That should do it. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: fifo queue

2007-03-19 Thread Tim Roberts
"drochom" <[EMAIL PROTECTED]> wrote: > >how would u improve this code? I would add at least one comment... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fortran vs Python - Newbie Question

2007-03-27 Thread Tim Roberts
avac) is very different from the use of "compiled" in the context of running gcc. Once upon a time, Basic enthusiasts would have used the word "tokenized" to describe .pyc files. A .pyc file is, in fact, interpreted by an intermediate language interpreter. I don't u

Re: Math with unicode strings?

2007-04-04 Thread Tim Roberts
I >"cast" the string into an interger? When I see a typo once, I figure it's a typo, but when I see it three times, I figure it is a misunderstanding. The word is "integer", not "interger". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: way to extract only the message from pop3

2007-04-04 Thread Tim Roberts
ommands fetch the headers. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-16 Thread Tim Roberts
duced in FORTRAN 77. FORTRAN 66 didn't do this. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: smtp debugging methods

2007-09-14 Thread Tim Roberts
twork at work has a firewall blocking these ports. Many employers allow outgoing connections only on ports 25, 80, and 443. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: curses: x, y positioning

2007-09-16 Thread Tim Roberts
quot;): >break >if ch <= 255: >screen.addstr(30, 10, "*%s*" % chr(ch)) >screen.refresh() > >curses.wrapper(my_program) Don't you want mvaddstr? (And remember that y comes first.) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Programming thru python

2007-09-18 Thread Tim Roberts
ed, you should be able to create a filter using Xitami's configuration stuff at http://localhost/admin. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: directpython question

2007-09-24 Thread Tim Roberts
27;t want work e.g: > >When I want execute this script on laptop: > >import d3dx >frame=d3dx.Frame(u'SOME FRAME') >frame.mainloop() > >I get this error: >... >RuntimeError: No valid mode found The R30 has kind of a wimpy graphics chip. What graphics mode

<    1   2   3   4   5   6   7   8   9   10   >