Re: Python mail truncate problem

2009-05-19 Thread Tim Roberts
est you grab the keys as a list and iterate through them: for key in mbox.keys(): msg = mbox[key] ... -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: monitoring friendly applications

2009-05-21 Thread Tim Roberts
, waiting for i/o, or lost >in some C call. >... >By any chance, does something like this exist? Would someone be >interested with this development? http://www.letmegooglethatforyou.com?q=python+daemon+tools -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- ht

Re: making a python program in windows

2009-05-21 Thread Tim Roberts
this is to bring up the System control panel applet (shortcut: WindowsKey + Pause/Break), Advanced, Environment Variables. In the System variables, click PATHEXT and Edit, and add ;.PY;.PYW to the end. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: making a python program in windows

2009-05-24 Thread Tim Roberts
rustom wrote: > >Thanks for this (and all other) tips. >Strangely now my m/c shows things exactly like so. A new .py file gets >associated with python but two days ago it was with pythonw?! No, .py files are always associated with python.exe. .pyw files are associated with pythonw.

Re: Mathematics in Python are not correct

2008-05-11 Thread Tim Roberts
ng that there is NO solution to the problem. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, are you ill?

2008-05-11 Thread Tim Roberts
rule, when you are just beginning to learn some product, it is safe to assume that anything you see as a bug in the product is almost certainly a flaw in your understanding of the product. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fill memeory with endless loop?

2008-05-13 Thread Tim Roberts
runs are virtual memory systems, so even if one application is using a couple of gigabytes of memory, other applications are still able to run. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Write bits in file

2008-05-19 Thread Tim Roberts
this. You need to use shifting and masking to produce a stream of 8-bit bytes, or to extract your values from a stream of 8-bit bytes. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Write bits in file

2008-05-21 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >On May 20, 12:14 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> Monica Leko <[EMAIL PROTECTED]> wrote: >> >> >I have a specific format and I need binary representation. Does >> >Python ha

Re: php vs python

2008-05-27 Thread Tim Roberts
guage. >> >>> Yes, they can. But it may be harder to do for them in one language and >>> easier in another. >... >No. Language does matter. A good programmer keeps many tools in his toolbox, and understands which tools provide the best service for the problem at

Re: SocketServer, its offspring, and threads

2008-05-28 Thread Tim Roberts
ng with this approach. If a thread is blocked waiting for a command, what's wrong with sending it a "please commit suicide" command? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using poplib to parse headers

2008-05-28 Thread Tim Roberts
he "email" module is a very sophisticated tool for that purpose. However, the email module doesn't have any way to fech the mail. So, you need to stitch them together. poplib.retr gives you a string. You need to hand that string to the email module, and you do that using "email.message_from_string". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using PEFile to replace Images in PE EXE

2008-05-31 Thread Tim Roberts
file (available at google code) would do the trick. It would if Linux executables were PE files. They aren't. The usual Linux executable format is called ELF. What do you think you are going to do to these executable files? I can think of darned few legitimate reasons to modify an

Re: can python do some kernel stuff?

2008-06-04 Thread Tim Roberts
de. Since Python can now be used to write managed code (via IronPython), Q.E.D. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Image Processing (batch)

2008-06-05 Thread Tim Roberts
Personally, I think PIL is a great solution for batch processing, but the beauty of the open source world is that the ARE alternatives. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: readline() & seek() ???

2008-06-05 Thread Tim Roberts
Python code. fout = open('outputfile.txt','w') for line in open('inputfile.txt'): if line[24] == 'T': fout.write( line[34:39] + ',' ) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: line continuation for lines ending in "and" or "or"

2008-06-05 Thread Tim Roberts
r "not." Yes, it's a minor point, but >> shouldn't the same rule apply? >> >> Seems like it would be easy to add. >... >Implicit line continuation only happens if you have an unmatched '('. > >>>> x = (2 + >... 2 >... ) >>>> x >4 ... or an unmatched [ or an unmatched {. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: import cherrypy2

2008-06-08 Thread Tim Roberts
Py 3.x installed, and the admin wanted them both to be available at the same time. However, by default CherryPy always installs itself as "cherrypy" with no number. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: time.clock() or Windows bug?

2008-06-08 Thread Tim Roberts
reset at boot time. (The cycle counter is, after all, a writable register.) As a result, the cycle counters were rarely off by more than about 20 cycles. Beginning with XP, they stopped doing that. As a result, the cycle counters on multiprocessor machines can vary by millions or even t

Re: time.clock() or Windows bug?

2008-06-10 Thread Tim Roberts
are actually getting a negative delta, and some kind of signed/unsigned manipulation produces the 90,000 number. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python doesn't understand %userprofile%

2008-06-11 Thread Tim Roberts
ERCENT% syntax for looking up an environment variable is just a feature of the XP command shell. It has no meaning to any other part of Windows. os.environ is the right answer. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Thanks for help re: %userprofile%

2008-06-11 Thread Tim Roberts
t; or c = r"copy '%USERPROFILE%\dir1\file1' c:\dir2\file2" ># In the os.system context, python delivers unescaped slashes. >os.system(c) ># success There is no reason to go to an external program for this at all. Just do this: import shutil shutil.copyfile( sourcefilename, destfilename ) >I'm a retired old fart trying to learn python so I welcome criticism >and advice. Tell us what you are really trying to do, and we can offer some simple scripts that you can use as an example. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python GC does not work as it should be

2008-06-18 Thread Tim Roberts
garbage collector crashes, the collector is in an indeterminate state, so it is quite reasonable to prevent it from being called again. Here is an excellent rule: Never check for an exception that you are not prepared to handle. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: One more socket programming question

2008-06-18 Thread Tim Roberts
ad of staying open. Right. "handle" is not called for one REQUEST at a time, it's called for one CONNECTION at a time. If you need a connection to be persistent, then your handle() function needs to sit in a loop making recv calls until you detect that the conversation is co

Re: How to convert a ">" into a >

2008-06-21 Thread Tim Roberts
>'<': operator.lt, >>}[variable] > >Thanks a lot John >Dominique Yes, but you need to remember that what you are getting is not literally an operator. That is, if you store that return value in a variable called "op", you can't say this:

Re: Mako vs. Cheetah?

2008-06-27 Thread Tim Roberts
ation and computation" rule too much, and that's just fine. Others really like the TAL scheme in Zope. For my taste, TAL just requires too much non-essential syntax; it interferes with the reading of the page. So, the folks who like TAL can go ahead and be productive with TAL, and

Re: Working with the Windows Registry

2008-06-27 Thread Tim Roberts
27; or use forward slashes: ... 'C:/Documents and Settings/Enrico...' or use the "r" modifier: ... r'C:\Documents and Settings\Enrico...' However, as a general practice, it's probably better to get the special directories from the environment: targetD

Re: surprising behaviour of os.environ.clear

2008-06-27 Thread Tim Roberts
nt with a UserDict >subclass. Why? I mean, I can see that it happens, but I don't understand why being a UserDict causes this. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do web templates separate content and logic?

2008-06-29 Thread Tim Roberts
ature. Or could it just be that >this is a *good* way to mix HTML and Python, and there are other ways >which may be bad? (For example, connecting to a database, like >Sebastian's example. That definitely seems out of place in an HTML file.) If it seems out of place to you, then you shoul

Re: [Employment] New TurboGears Job in Eugene, OR

2008-06-29 Thread Tim Roberts
est city. Prices are not quite up to the San Jose at its peak, but there are no bargains left in any of the urban sections of the state. It's certainly far more expensive here than in the midwest or most of the south. On the other hand, it's a university town, and one of the most env

Re: frame grabber hardware

2008-06-29 Thread Tim Roberts
do this job. Logitech makes a bunch. Most of the cheap imported still cameras can also do it. The Disney still cams at Target (made by Digital Blue) would work. Are you looking for something more industrial? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.py

Re: pixel colour on screen

2008-06-29 Thread Tim Roberts
a given co-ordinate, but is it >possible to do it from the whole screen output regardless what >application the selected pixel is in? Which operating system? If you are on Windows, and you have pywin32 loaded. you can use the Windows APIs GetDC and GetPixel. -- Tim Roberts, [E

Re: Required items in a form

2008-07-03 Thread Tim Roberts
header, then write a Javascript function that validates the input. If the function returns false, the submit won't happen. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to bypass Windows 'cooking' the I/O? (One more time, please)

2008-07-03 Thread Tim Roberts
27; >>> >Same python program runs as expected in Linux. Maybe because that's >where it was written?! :) Perhaps your Linux C runtime library accepts the fopen mode 'rwb', but if it does, it's a non-standard extension. >What I seek is the way to slap Microsoft up side the head and make it >work correctly. OK, well, at least in this situation. It works correctly if you use it correctly. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com.client (Howto edit Contacts in Outlook)

2008-07-05 Thread Tim Roberts
ress, and Outlook Express cannot be controlled by COM (although MAPI works). -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python with Ecmascript

2008-07-05 Thread Tim Roberts
with? I mean, what kind of a program is this? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: a simple 'for' question

2008-07-10 Thread Tim Roberts
es: IOError: [Errno 2] No such file or directory: >> "Folder/['1']/myfile.txt" Just like that. >As far as the Python question of string substitution, "%s" % var is an >appropriate way. Right. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: while var, but var ==16 != true

2008-07-13 Thread Tim Roberts
and it's one of the things I love about Python. >so obv while var means while not empty or why not zero but it isnt >something youd guess unless youd beeen shown it. It's clearly stated in the documentation. I don't know how you concluded that True and False were the only b

Re: How can i use a variable without define it ?

2008-07-17 Thread Tim Roberts
er, you have some overall problem you are trying to solve, and you have focused in on one POSSIBLE solution. Instead, tell us about the PROBLEM, and we'll offer good solutions. >If you can't give a solution, just ignore it! NO ONE will be able to give you a solution, because you h

Re: % sign in python?

2008-07-17 Thread Tim Roberts
n this contexted, it was mapping operator. What?? Python does not have a "mapping operator". It has a "map" function, but no equivalent operator. % is either the string formatting operator (when the left-hand operand is a string) or the modulo operator (when the left-hand op

Re: % sign in python?

2008-07-20 Thread Tim Roberts
Terry Reedy <[EMAIL PROTECTED]> wrote: > >Tim Roberts wrote: >> Steven Howe <[EMAIL PROTECTED]> wrote: >> >>> Terry Reedy wrote: >>>> korean_dave wrote: >>>>> What does this operator do? Specifically in this context >>

Re: Python Written in C?

2008-07-20 Thread Tim Roberts
dard. >I'm not dissing Python, here. Just noting that, if it is written in C, >that throws a curve at me in trying to balance the value of learning >Python vs. some other major language. I would say you have a very strange criteria for deciding whether a language is worth learn

Re: interpreter vs. compiled

2008-07-22 Thread Tim Roberts
or), to move Python to the >further step of outputting the machine code? I don't know why you think GNU has anything to do with this. There's nothing that prevents the Python run-time from JIT compiling the code. IronPython does this. CPython does not. It's an implementati

Re: Python Written in C?

2008-07-22 Thread Tim Roberts
. gcc generates a text file and pipes it to gas. The __asm__ directive just adds strings to the assembler file. Visual C++ generates machine language. The compiler has to include an assembler for inline assembly. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://

Re: interpreter vs. compiled

2008-07-24 Thread Tim Roberts
o; the user's code is compiled into machine language. Both of them are "Python". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Broken examples

2008-07-24 Thread Tim Roberts
client excel = win32com.client.Dispatch( 'Excel.Application' ) xlCSV = 6 ... for nm in list_of_file_names: csv = os.path.splitext( nm )[0] + '.csv' wb = excel.Workbooks.Open( nm ) wb.SaveAs( csv, xlCSV ) wb.Close() If you want to watch the progress, add &

Re: pci card adjusting

2008-07-24 Thread Tim Roberts
card. This is already done to a degree in C. But >i don't want to dive in to the C code right now. > >I prefer Python so may i implement such a feature by Python? Not easily, at least not without a helper DLL in C. And since the app won't be that large, you might as well

Re: pixel colour on screen

2008-07-26 Thread Tim Roberts
chris <[EMAIL PROTECTED]> wrote: >On Jun 30, 4:37 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> >> >Could anyone help me, I'm a python noob and need some help. im trying >> >to find some code that will, given ascreenco-

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Tim Roberts
t;executable for Windows 64 bit platforms. Is this true? It's true for ALL operating systems, not just Windows. The ia64 (Itanium) and the amd64 are completely separate processors with VERY different instruction sets. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http:/

Re: How to close all python-opened file identifiers?

2008-07-26 Thread Tim Roberts
file identifiers before launching the >editor. If you want to post some code, perhaps we can find something. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping parts of a path

2008-07-26 Thread Tim Roberts
.sub, but that seems like overkill. chk = '/src/oship/atbldr' cwd = os.getcwd() if cwd.endswith( chk ): cwd = cwd[:-len(chk)] -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter vs. compiled

2008-07-28 Thread Tim Roberts
ter would be running on an interpreter, but that >doesn't get the user's statement 'a= b+ 1' into registers-- it gets >'push, push, add, pop' into registers. You have a fundamental misunderstanding of the compilation process. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter vs. compiled

2008-07-30 Thread Tim Roberts
CPython implementation -does- -not-. And again, I never said that it did. CPython is an interpreter. the user's code is never translated into machine language. >My point is, CPython takes more than seven steps. My question is, >does IronPython? So, if compiler B isn't as good

Re: Newbie Python questions

2008-07-31 Thread Tim Roberts
for wxWidgets/ >wxPython, the last question is what do I gain from going QT over wx? >I've seen great applications written with both (on my computer I have >the wxPython Digsby and the pyQT apps "Mnemosyne" and "Anki". All seem >to be solid. Yep. Perso

Re: interpreter vs. compiled

2008-08-02 Thread Tim Roberts
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Thu, 31 Jul 2008 06:17:59 GMT, Tim Roberts <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > >> And again, I never said that it did. CPython is an interpreter. the >> user's code is

Re: interpreter vs. compiled

2008-08-02 Thread Tim Roberts
the same; it's just that there's more processing going on before jumping to "main". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Swap memory in Python ? - three questions

2008-08-02 Thread Tim Roberts
08, 17:16:53) [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxint 9223372036854775807 >>> -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Python questions

2008-08-02 Thread Tim Roberts
ter coz >it has a better documentation. Holy moly, did you send this from your cell phone? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: current week / weeks in year - best practice

2008-08-02 Thread Tim Roberts
ll week, so that a partial Jan 1 week is actually part of the previous year. And you get the whole "does the week start on Sunday or Monday" debate as well. You need to make sure that the datetime functions match your business rules. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boek

Re: base-96

2008-08-02 Thread Tim Roberts
er 2 >characters more; the space (code 32), and one not-printable char >(which doesn't create any problem) by last. This leaves some tricky issues. How will you denote the end of a base 96 sequence? If every printable character can be part of the ciphertext, what can you use as an end ma

Re: base-96

2008-08-02 Thread Tim Roberts
, 5 bytes becomes 6. So, you would reduce the conversion penalty from 1.33 down to 1.17. It's not hard to write modules to translate from binary to Base96 and back again, and doing so would be a great exercise to explore the issues in this kind of encoding. -- Tim Roberts, [EMAI

Re: SMTP via GMAIL

2008-08-04 Thread Tim Roberts
w Interesting. If true, that is incorrect behavior. >And does anyone have a general routine that lets one also have Bcc: >addresses usign SMTP? To make a Bcc, all you do is include the address in the RECEIVERS list, but don't mention it in the body at all. -- Tim Roberts, [E

Re: More Datastore Examples Please

2008-08-06 Thread Tim Roberts
u trying to DO with the datastore? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: mktime overflow in March 2008?

2008-08-09 Thread Tim Roberts
>> time.mktime(t) >Traceback (most recent call last): > File "", line 1, in >OverflowError: mktime argument out of range What time zone are you in? March 30, 2008, was a Sunday. If that happened to be the date your country transitioned to summer time, th

Re: Broken examples

2008-08-11 Thread Tim Roberts
lose() hangs (in interactive) awaiting it's answer. The Workbook.Close method accepts parameters; you should be able to get it to skip the dialog. I believe that wb.Close( False ) should do this. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Change user on UNIX

2008-03-29 Thread Tim Roberts
asonable? Typically, an FTP server dedicates one thread/process per logged in session. That process changes to the logged in user's identity as soon as it gets the username and password, and stays there forever. There is no need to switch back to root in between. The principle o

Re: Problem with sqlite

2008-03-29 Thread Tim Roberts
ate a clean slate database file And such gluing is a very bad idea, because it is apparently hiding the real cause of your problems. Get rid of the try/except/pass sequences until you understand what is failing. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rubik's cube translation

2008-03-31 Thread Tim Roberts
, 0, 0], > [0, 0, 0]]) > >? If you don't want changes to D to affect E, then you need to disconnect them when you create them. If you create D and E so that they contain references to the same lists, then this kind of thing will happen. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: CTypes, 64 bit windows, 32 bit dll

2008-03-31 Thread Tim Roberts
2bit or 64bit, no mixed ... > >Crap, no way to make a 32 bit load, even using the wowexec? No. In Win64, a process is either entirely 32-bit, or entirely 64-bit. To do the kind of crossing you seek, you would need to create a separate process for the 32-bit DLL and use interprocess communication. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why prefer != over <> for Python 3.0?

2008-04-02 Thread Tim Roberts
a generic Sudoku solver in a 65-byte executable. Yes, that's 65 BYTES -- not KB, not MB. I consider myself an x86 assembler expert, but I remain in awe of that code. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Data structure recommendation?

2008-04-09 Thread Tim Roberts
index that is 1.6-0.4 and one index that is 0.8+0.4, and the two won't be the same. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: email module windows and suse

2008-04-13 Thread Tim Roberts
't go any faster than your slowest link. >Are threads available and as effective in SUSE as they are in Windows? Threads are available in Linux. There is considerable debate over the relative performace improvement. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: why function got dictionary

2008-04-18 Thread Tim Roberts
to include support functions that should not be exposed as web pages. To do that, you just add an "exposed" attribute to the function: class MyWebPage: ... def index( self, ... ): pass index.exposed = 1 def notExposed( self, ... ): pass def request

Re: File IO Issues, help :(

2008-04-29 Thread Tim Roberts
) > >I tried this can got the same result...?? That's not what he meant. He meant: jsfile = open("../timeline.js", "r") jscontent = jsfile.readlines() jsfile.close() jsfile = open("../timeline.js", "w") ...etc... You have to decide whether this makes m

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-01 Thread Tim Roberts
, since Python is nearly ubiquitous, I suspect it is not so important. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: USB HID documentation?

2008-05-05 Thread Tim Roberts
a custom driver. For low-bandwidth data sources, USB HID is an excellent way to provide general-purpose access to a USB device. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: strftime() argument 1 must be str, not unicode

2008-05-08 Thread Tim Roberts
? I think that's a perfectly reasonable thing to expect. At the risk of over-generalization, there is no good reason why, by this point in time, all of the standard library routines that accept strings shouldn't also accept Unicode strings. It's the duck typing principle. Unicode strings look, walk, and talk like regular strings. An error like this is not intuitive. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-09 Thread Tim Roberts
id. The shebang line (#!) must specify a full path. When you saw the lone word ("perl"), it was probably a /usr/bin/env line, just we have been discussing. >I at a windows system now so I can't try it yet. *IF* you are interested in playing with Linux, most of the dis

Re: export sites/pages to PDF

2008-08-17 Thread Tim Roberts
7;s on the screen, then I don't think you have any option other than a screen capture utility, like "xwd". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don�t find HTMLgen

2008-08-17 Thread Tim Roberts
/Templating> > >Thank a lote. Allow me to second this idea. I used to be a huge HTMLgen fan, and I built several CGI web sites using it, but I am now convinced that a templating solution is better in virtually every case. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Discrete Simulation

2008-08-19 Thread Tim Roberts
device's FIFO, and a webcam video stream. It was easy to add a bit of randomness to simulate poor conditions, and I got my answer in short order. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphics Contexts and DCs explanations?

2008-08-21 Thread Tim Roberts
ext. Windows requires special handling to create a DC within a WM_PAINT handler (which is what calls OnPaint). That's why wx.PaintDC is separate. Outside of OnPaint, you'd usually use wx.ClientDC. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluating code lines above breakpoints ?

2008-08-21 Thread Tim Roberts
ases information content. Most Python functions do not have a large set of locals(). -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: struct.Struct random access

2008-08-28 Thread Tim Roberts
ving anything. >Even in sequential access speed benefits, by avoiding the construction >of n-1 objects. This is a fairly major change, because it requires a "struct.Struct" object to maintain state, something that the "struct" module currently does not do. In my personal opinion, this is a rather large and confusing change, for very little benefit. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: struct.Struct random access

2008-08-29 Thread Tim Roberts
ou were proposing them as new additions. Because of that, the rest of my post doesn't make much sense. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0b2 cannot map '\u12b'

2008-08-31 Thread Tim Roberts
ue, or am I doing something wrong? Both. U+012B is the Latin lower-case i with macron (i with a bar instead of a dot). That character does not exist in the 8-bit character set CP437, which you are trying to use. If you choose an 8-bit character set that includes i-with-macron, then it will work. UTF-8 would be a good choice. It's in ISO-8859-10. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing "&A" in a string..

2008-08-31 Thread Tim Roberts
x in the general case, because your page might already contain "&". If it is possible that some of them might be wrong while some are right, you can do something like: s = s.replace( '&', '&' ).replace( '&', '&' ) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: atomic section in code

2008-09-06 Thread Tim Roberts
before we can suggest something that is actually achievable. >Could one get there using ctypes to disable interrupts? No. That can't be done in user mode in any operating system where Python runs. Even in kernel mode, it's not reliable, because disabling interrupts only af

Re: Determining Processor Vender

2008-09-06 Thread Tim Roberts
te numerical libraries for my application. If you have a numerical library that uses processor-specific instructions, then the library must be in C with assembler. If so, just add another function that does a "cpuid" instruction and return the results. -- Tim Roberts, [EMAIL PROT

Re: Multicore-programming?

2008-09-06 Thread Tim Roberts
se programs are single-threaded, you'll still be able to keep all of the cores busy. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: found a bug with smtpd, where can i report this?

2008-09-08 Thread Tim Roberts
"Marcus.CM" <[EMAIL PROTECTED]> wrote: > >Where should i report the bug? >smtpd bug. Why don't you tell us about it? There may be another explanation. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: universal unicode font for reportlab

2008-09-10 Thread Tim Roberts
should be named in the resulting PDF file. Is it possible you have an older release? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: universal unicode font for reportlab

2008-09-12 Thread Tim Roberts
mailing last year was focused on TrueType fonts. Those are subsetted. EmbeddedType1Face, used for Type 1 fonts, does appear to embed the entire font. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: help on python SWIG C++ extension

2008-09-16 Thread Tim Roberts
and "free" to allocate and free your objects. "stl" will use "new" and "delete", and it's not always healthy to mix them. If I were you, I'd replace this: > Vertex *v; > v = (Vertex *)malloc(sizeof(Vertex)); with this, which is less typing:

Re: curses.setsyx()?

2008-09-18 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I tried curses.setsyx(2,3) in my script and it doesn't move the curses >cursor. Any alternatives/solutions? Did you call doupdate after? setsyx just manipulates the data structures. It takes a call to doupdate to force those changes to take effect vis

Re: curses.setsyx()?

2008-09-22 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote: >> On Sep 19, 1:24 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> >> > [EMAIL PROTECTED] wrote: >> >> > >I tried curses.setsyx(2,3) in my script and it doesn't mov

Re: curses.setsyx()?

2008-09-24 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >On Sep 23, 4:16 pm, [EMAIL PROTECTED] wrote: >> On Sep 22, 11:24 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: >> > [EMAIL PROTECTED] wrote: >> > >On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote: >> > >> On Sep

Re: Comparing float and decimal

2008-09-25 Thread Tim Roberts
>In [98]: '%.50f' % 0.1 >Out[98]: '0.1555111512312578270211815834045410' >? Actually, it's not. Your C run-time library is generating random digits after it runs out of useful information (which is the first 16 or 17 digits). 0.1 in an IEEE 784 d

Re: How to parse a string completely into a list

2008-09-25 Thread Tim Roberts
g is identical. Subsetting is identical. The only difference is that I can change an element of the list. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing float and decimal

2008-09-26 Thread Tim Roberts
Mark Dickinson <[EMAIL PROTECTED]> wrote: >On Sep 25, 8:55 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >0.1 actually is >> >> >In [98]: '%.50f' % 0.1 >> >Out[

<    3   4   5   6   7   8   9   10   >