Re: Question about available python lib for a task

2011-05-15 Thread Tim Roberts
can do it without Excel, using the COM interfaces for "structured storage", like IPropertySetStorage and IPropertyStorage. >Is pywin32 one of the possible lib available? You will need PyWin32 in order to use COM to launch Excel, or use the structured storage interfaces. -- Tim Rob

Re: and becomes or and or becomes and

2011-05-22 Thread Tim Roberts
IS funny. Interesting how a careful choice of arugments will fool us. One of my favorite math jokes is like that. A teacher asked a student to reduce the following fraction: 16 64 He says "all I have to do is cancel out the sixes, so the answer is 1/4". -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by list-appending behavior

2011-05-26 Thread Tim Roberts
MRAB wrote: > >I'd just like to point out that it's a convention, not a rigid rule. Reminds me of the catch-phrase from the first Pirates of the Caribbean movie: "It's more of a guideline than a rule." -- Tim Roberts, t...@probo.com Providenza & Boekelhei

Re: The worth of comments

2011-05-27 Thread Tim Roberts
rs, and I am trying to get excited about it, but it has succumbed to the same special-characters-as-syntax disease that killed Perl. Much Ruby code is just unreadable. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to catch a line with Popen

2011-05-28 Thread Tim Roberts
application you are launching is buffering its output, so that it doesn't SEND until the application ends. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime.datetime and mysql different after python2.3

2011-06-01 Thread Tim Roberts
time = get_fields() date = datetime.datetime.fromordinal( date.toordinal() ) print str(date+time) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic character substitution.

2005-09-26 Thread Tim Roberts
ements. For example: data = {} for n in range(3): data[n] = read_from( 'filename%d' % n ) It IS possible to create variables on the fly, but except in very special situations, it is almost never the right way to do things. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Straight line detection

2005-09-29 Thread Tim Roberts
, [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1]] Would you say there were 12 lines there? -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWin SendMessage

2005-10-01 Thread Tim Roberts
his use case -- interprocess communication. The WM_USER range is only if you are inventing a custom message for some new purpose. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: What encoding is used when initializing sys.argv?

2005-10-01 Thread Tim Roberts
ed >as the "mbcs" codec. > >import sys >print repr(sys.argv[1]) >print repr(unicode(sys.argv[1], "mbcs")) > >C:\bin>python glurp.py abcߕ >'abc\xdf\x95' >u'abc\xdf\u2022' There's another entry in my "keep this post

Re: Recursive Property of Octal Numbers

2005-10-03 Thread Tim Roberts
;\xb6' 8 doesn't have anything to do with it. What you have there is hexadecimal. 0377 is an example of an octal number. However, as was pointed out elsewhere, the same thing would be true even if you used 'z'. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: question about smtplib

2005-10-03 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >cool. so this line >server = smtplib.SMTP(localhost) >is when i connect ? Use the source, Luke. Source code for every standard module is included on your hard disk. If you look in the __init__ for "class SMTP", your question will be answered. -- -

Re: question about smtplib

2005-10-05 Thread Tim Roberts
Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>> Tim Roberts <[EMAIL PROTECTED]> (TR) wrote: > >>TR> [EMAIL PROTECTED] wrote: >>>> cool. so this line >>>> server = smtplib.SMTP(localhost) >>>> is when i connect ? &g

Re: Using command line args on Windows

2005-10-09 Thread Tim Roberts
;echo 123 | x.py The process tried to write to a nonexistent pipe. C:\Tmp>python x.py < x.py import sys C:\Tmp>x.py < x.py C:\Tmp> -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching zero only once using RE

2005-10-09 Thread Tim Roberts
rld is a string, and every operation is a regular expression match upon that string. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to capture key pressing

2005-10-10 Thread Tim Roberts
SC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import msvcrt >>> msvcrt.getch() '\x1b' >>> (I pressed "escape" after the second "enter".) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Here I am again, same old arguments

2005-10-15 Thread Tim Roberts
beginning programmers, this would definitely need to be tacked up to it. Nice work. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl-Python-a-Day: Sorting

2005-10-15 Thread Tim Roberts
-optimized that the Schwartzian transform is almost always faster than passing a custom comparator to the sort function. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-15 Thread Tim Roberts
silly to credit Microsoft with the ubiquity of powerful computers. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: connect to https unpossible. Please help.

2005-10-20 Thread Tim Roberts
tps://brokerjet.ecetra.com/at/welcome/loginaction.phtml, and you'll need to encode 'login' and 'pwd' fields in the POST data. However, that isn't the end of your trouble. That page will almost certainly send you a cookie, which you will need to send back with every

Re: sqlstring -- a library to build a SELECT statement

2005-10-20 Thread Tim Roberts
o Microsoft. Everyone else, including Microsoft SQL Server, uses "double quotes" to protect special characters in identifiers. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing a dll from Python

2005-10-20 Thread Tim Roberts
m python. I tried the ctypes module. Are you talking about VB6 or VB.NET? If you had to add a reference, then it is either a COM interface or a managed code class. DLLs don't get in through references -- they use the Declare statement. COM interfaces are pretty easy to call in Python. Callin

Re: Cursor Location

2005-10-20 Thread Tim Roberts
you are using wxPython, your EVT_LEFT_UP handler gets a mouse event as a parameter: def OnClick( self, evt ): print evt.GetPositionTuple() Once you have the tuple, it's up to you to save it somewhere. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://ma

Re: Syntax across languages

2005-10-24 Thread Tim Roberts
g section of code has been commented out. # # call_function( cool ) # # # This would be neater if I had a real-life example. # # As it is, it looks silly. # # print "New result", cool print "All done" -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tricky Areas in Python

2005-10-24 Thread Tim Roberts
on and whether they were successful? I don't know. I'm not sure I need a job with a company that insists on playing "Programming Jeopardy" during the interview. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi All - Newby

2005-10-26 Thread Tim Roberts
uilt-in user interface stuff, so whatever you are using to place a window is something you downloaded, or something that was installed with your Python. That's what we need to find out. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange problems with urllib2

2005-10-26 Thread Tim Roberts
.4.1 on linux i'm running 2.4.1 That kind of thing is often caused by DNS problems. Are you running named on your Linux machine? Have you double-checked that the named configuration and /etc/resolv.conf is correct? How long does it take for you to do this: wget http://site.heavenlytrea

Re: Microsoft Hatred FAQ

2005-10-29 Thread Tim Roberts
a trivial correction, but I thought it was quite appropriate to throw yet another completely useless fact into this completely useless thread, which was started by a completely useless troll. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi All - Newby

2005-10-29 Thread Tim Roberts
uot;Python and Tkinter Programming" by John Grayson, ISBN 1884777813. If you will be getting serious with Tkinter, I strongly recommend it. Personally, I started with Tkinter, but I couldn't wrap my brain around the details. I switched to wxPython, and never looked back. -- - Tim Roberts

Re: Scanning a file

2005-10-29 Thread Tim Roberts
;rb").read().count("\x00\x00\x01\x00") > >Funny you should say that, because I can't stand unnecessary one-liners. > >In any case, you are assuming that Python will automagically close the >file when you are done. Nonsense. This behavior is deterministic. At

Re: Windows - Need to process quotes in string...

2005-11-02 Thread Tim Roberts
mp;1&"') or launchWithoutConsole("devcon.exe", r'enable "@USB\VID_0403&PID_6010&MI_00\7&15E4F68&1&"') However, devcon.exe supports regular expressions, and is forgiving about syntax. If you have only one such device, you could use: launchWithoutConsole("devcon.exe", r'enable "@USB\VID_0403&PID_6010*"') -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Identity Test

2005-11-02 Thread Tim Roberts
congratulations on a very subtle and somewhat multicultural joke... -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: something wrong in wx

2005-11-13 Thread Tim Roberts
txt", line: 2 How are you launching the GUI version? Are you double-clicking on an icon somewhere? Are you sure the application is starting in the correct directory -- the one that contains zapis.txt? Perhaps you should try hard-code the full path, or at least doing an os.chdir(). --

Re: os.chown()

2005-11-13 Thread Tim Roberts
;chown username:groupname filename') Are you doing this as root? The chown function is usually restricted to root. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-16 Thread Tim Roberts
ions, there is a script in win32comext/axscript/client/pyscript.py that will register Python as an ActiveScript language. The you can say print "<h1>Hello, there.</h1>" -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-17 Thread Tim Roberts
[EMAIL PROTECTED] (Alex Martelli) wrote: >Tim Roberts <[EMAIL PROTECTED]> wrote: > ... >> Internet Explorer will allow any registered ActiveScript language to be >> used in a web page. Python qualifies. In the latest Win32 extensions, >> there is a script

Re: Python under Citrix Metaframe

2005-11-20 Thread Tim Roberts
e anything to do with that. >Do you use python under Citrix Metaframe? >What problems did you encounter? I've used Python extensively with Microsoft's Terminal Services. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: check if com api is still available

2005-11-20 Thread Tim Roberts
applications seem to be the only ones in the world that use the ROT. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem printing in Win98

2005-11-20 Thread Tim Roberts
les. You have probably installed GhostScript on your 2K/XP box. If you install it on your Win98 box, your ShellExecute should work. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer module

2005-11-20 Thread Tim Roberts
file. You'll have to parse and decode it yourself. However, as the module documentation also tells you, that has already been done for you in SimpleHTTPServer.py. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Aproximative string matching

2005-11-20 Thread Tim Roberts
such a library? There is an algorithm called Soundex that replaces each word by a 4-character string, such that all words that are pronounced similarly encode to the same string. The algorithm is easy to implement; you can probably find one by Googling. -- - Tim Roberts, [EMAIL PROTECTED] Provid

Re: Problem printing in Win98

2005-11-22 Thread Tim Roberts
ot; in the second parameter. It's just registry magic. It's not a command line thing. Most file types have an "open" verb and a "print" verb; some also have "edit". -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: Tab key giving different output

2005-11-28 Thread Tim Roberts
ber of spaces you use is not important. You can use one space for your indentation, which is the same number of keystrokes as a tab. Good looking code is not of prime importance when you're typing at the Python prompt. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, In

Re: Python CGI

2005-12-01 Thread Tim Roberts
GI process ends. Every new request is another run. So, you can either use one script per operation, or you can use one script and detect which step it is using, for example a hidden field. If you need common file processing in both scripts, I'm sure you already know you can put that code

Re: CGI module does not parse data

2005-12-03 Thread Tim Roberts
"amfr" <[EMAIL PROTECTED]> wrote: > >import cgi >form = cgi.FieldStorage() >print form["test"] >print "test" > >I would only be able to see "test", not "hello world" >I am sure its not my browser Did you mea

Re: CGI and long running job

2005-12-03 Thread Tim Roberts
/null','w') os.dup2(fw.fileno(),1) os.dup2(fw.fileno(),2) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread Tim Roberts
heir own favorite brand, and no rational argument will ever convince someone else to abandon their brand. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread Tim Roberts
natural language does not need documentation... Both "The Design of Everyday Things" and "The Psychology of Everyday Things" are fascinating books that should be mandatory reading for all engineering students. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com 'catastrophic failure'

2005-12-05 Thread Tim Roberts
ough information. -2147418113 is 0x8000, which is E_UNEXPECTED. That's a generic error which may mean that you called something in the wrong order, or provided a parameter that was not expected. What OCX were you calling, and what did the code look like? -- - Tim Roberts, [EM

Re: sql escaping module

2005-12-08 Thread Tim Roberts
, as in: c.execute( "INSERT INTO table1 VALUES ('%s','%s','%s');" % (var1, var2, var3) ) # THIS IS WRONG -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to put form and display its result(data from database) on the same window?

2005-12-10 Thread Tim Roberts
def PresentTable(): PrintTheForm() if i_have_received_data: PrintTheResultTable() -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: newby question: Splitting a string - separator

2005-12-10 Thread Tim Roberts
', 'Tim', 'Peters', 'Thomas', 'Liesner'] > >I think it is theoretically faster (and more pythonic) than using regexes. But it is slower than this, which produces EXACTLY the same (incorrect) result: data = "Guido van Rossum Tim Pet

Re: How to detect the presence of a html file

2005-12-10 Thread Tim Roberts
ward slashes as path separator only works on NTFS volumes I believe. Wrong. They work on all Microsoft operating systems back to at least MS-DOS 5, and on every version of Windows. The command interpreters don't accept them, but all of the APIs do. -- - Tim Roberts, [EMAIL PROTECTED] Pr

Re: PHP = Perl Improved

2005-12-10 Thread Tim Roberts
so. Virtually all of the vast PHP code samples on the web are crap. Maybe the simplicity of the language encourages inexperienced programmers who write spaghetti code without a thought to the structure; I don't know the exact cause, but I have seen it more often than not. -- - Tim

Re: smtp question

2005-01-06 Thread Tim Roberts
. Everything else, including the From: and To: lines, will be taken as part of the message body. I assume you meant to use \r\n, but \n will work just as well and is less error prone. >print "Message length is " + repr(len(msg)) Easier is: print "Message length is", len(msg) More efficient is: print "Message length is %d" % len(msg) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-09 Thread Tim Roberts
elf): exec(magic()) print hi hi = "baby" print hi def other(self): exec(magic()) print hi a = A() a.meth() a.other() That's way too fragile to be useful. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Octal notation: severe deprecation

2005-01-13 Thread Tim Roberts
le that the creation and destruction of an object might have useful side effects. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: why are people still using classic classes?

2005-01-13 Thread Tim Roberts
ill no compelling reason to break the old habits and type those 6 extra characters. Once a person has a case where the new classes make a difference, I suspect they catch the new habit and never look back. I haven't crossed that threshhold yet. -- - Tim Roberts, [EMAIL PROTECTED] Providenza &

Re: from __future__ import decorators

2005-01-15 Thread Tim Roberts
Jacek Generowicz <[EMAIL PROTECTED]> wrote: > >I have some code, which makes copious use of the @decorator syntax I'm very curious to know what kind of application you are writing in which "copious use of the @decorator syntax" actually solved a problem productively

Re: Threading Or Other Suggestions?!?

2005-01-15 Thread Tim Roberts
s, I was thinking about threads... does anyone have other/better >suggestion(s)? Does anyone see any difficulty/memory problems in using >threads? Yes. Threads are used to run multiple parts of your own program. To run another program, you need to launch a new process. You can still monitor i

Re: Is there a library to parse Mozilla "mork" documents?

2005-01-20 Thread Tim Roberts
han the same file would be in, say, INI format. I wrote a Python script to parse it, but it isn't terribly robust. I was able to produce a dictionary, but I didn't do anything with the results. You're welcome to take a look: http://www.probo.com/timr/parsemsf.py -- - Ti

Re: global variable, ok for string, bad for int

2005-01-21 Thread Tim Roberts
27;:1, 'deux':2} > >def print_value(): > print vardict['un'] ># ok, that works > > > >#!/bin/python >varint = 1 > >def print_value(): > print varint ># ok, that failed > >python 2.3.4

Re: getting file size

2005-01-22 Thread Tim Roberts
son I >should do both? When reading to the end of a file, won't tell() be just >as accurate as os.path.getsize()? On Windows, those two are not equivalent. Besides the newline conversion done by reading text files, the solution in 2. will stop as soon as it sees a ctrl-Z. If you used

Re: is there better 32 clock() timing?

2005-01-25 Thread Tim Roberts
on Windows? The ONLY way to get small-integer microsecond responses in Windows is to write a kernel driver, and even then there are no guarantees. Windows is NOT a real-time system. If you have an environment where an unexpected delay of a millisecond or more is going to cause damage, then you n

Re: Why can't use cursor.nextset() in adodbapi package?

2005-01-25 Thread Tim Roberts
gt; > >>> crsr.nextset() If you are only issuing one SELECT, like most applications, then nextset() serves no purpose. If you did something like this: sql = "select * from wjtmp; select count(*) from wjtmp;" That's when you need nextset(). Personally, I've never used it. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter: Can You Underline More Than 1 Char In A Menu Title

2005-01-31 Thread Tim Roberts
I intend to actually have two separate keys invoke this menu >to have it behave differently in different circumstances. You can, of course, CHANGE the underlined character to match the circumstances. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help implementing an idea

2005-06-18 Thread Tim Roberts
tually >do it? How do you want to do the upload? FTP? That's easy. Check ftplib.py. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code?

2005-07-02 Thread Tim Roberts
you to enter ANOTHER number, without telling you whether it was high or low. Better to eliminate duplicated code: import random print "Higher or Lower" print number = random.choice(range(100)) while 1: guess = input("Guess a number: ") if guess == number: bre

Re: (Win32 API) callback to Python, threading hiccups

2005-07-07 Thread Tim Roberts
If the purpose of the GIL is simply to make things thread-safe, then I would have guessed that the first one was correct. If someone else holds a reference to "arglist", then the DECREF is just a nice, atomic decrement. If no one else holds a reference to "arglist", then it'

Re: How to limit the uploading file size in python?

2005-07-22 Thread Tim Roberts
d specifically at the web, so it has no native concept of "uploading". You can do this by using the LimitRequestBody directive in your Apache configuration or .htaccess file. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: A replacement for lambda

2005-07-29 Thread Tim Roberts
to backtrack to the shift and convert it to a pair of >less-thans before you can successfully translate it. C++ solves this exact problem quite reasonably by having a greedy tokenizer. Thus, that would always be a left shift operator. To make it less than and a function, insert a space:

Re: rfc822 module bug?

2005-07-31 Thread Tim Roberts
uot; ] date FWS time [CFWS] > >day-of-week = ([FWS] day-name) / obs-day-of-week > >day-name= "Mon" / "Tue" / "Wed" / "Thu" / > "Fri" / "Sat" / "Sun" > >date

Re: Chopping off spaces at both ends

2005-08-08 Thread Tim Roberts
;One of my instruments is returning a string that has one or more > blanks in >it, and that is complicating string matching tests in one of my functions. >>> a = ' abc ' >>> print a.strip() 'abc' -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: len(sys.argv) in (3,4)

2005-08-12 Thread Tim Roberts
he %1 is substituted with the name of the script being run. In this example, however, the parameters are all discarded. If you set this instead: c:\tmp> ftype Python.File=c:\python24\python23.exe "%1" "%*" The "%*" says "put the rest of the parameters he

Re: win32com: use not possible as normal user

2005-08-12 Thread Tim Roberts
_use_ >win32com as a normal user, because normal users can't write there: Right. To use win32com, the site-packages\win32com\gen_py directory must be writable. You shouldn't have to change the whole c:\Programme tree; you should be able to make just that one subdirectory writable b

Re: Command Line arguments

2005-08-25 Thread Tim Roberts
KEY part of that is the %* at the end of the Python.File defintion. That tells the system to insert the rest of the command line parameters at that point. If you have ONLY the "%1", the command will run but no parameters will be forwarded. If so, you can fix this by typing: C:\Tmp>f

Re: reg email packages work

2005-09-02 Thread Tim Roberts
to this as the body of the message, all the lines will be concatenated together, which sounds a lot like what you are seeing. If you are not feeding HTML as the body, change the fist line to ('text','plain'). -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: command line path

2005-09-05 Thread Tim Roberts
\calibration\FREQUENCY_13.CSV" Right idea, but wrong implementation. What that does is pass one very long file name as the script file, with no parameters. This is right, modulo the line splitting: python ImportFiles_test.py "C:\Program Files\National Instruments\LabVIEW 7.1\project\calibration\FREQUENCY_13.CSV" -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiled?

2005-09-09 Thread Tim Roberts
it. C#, VB.NET, VBscript, Javascript and Perl have not suffered from being interpreted. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: nested tuples

2005-09-09 Thread Tim Roberts
ill result in a list of tuples: [(row1value1, row1value2, >row1value3),(row2value1, row2value2, row2value3),..., (rowNvalue1, >rowNvalue2, rowNvalue3)] > >Then, I get what I want with tuple(a). Why? What is it about the list of tuples that you don't like? Philosophically, it's m

Re: p2exe using wine/cxoffice

2005-09-15 Thread Tim Roberts
ut it will never be as thorough and compatible as a VMware session. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: p2exe using wine/cxoffice

2005-09-17 Thread Tim Roberts
nd to the idea of using open >alternatives rather than thinking that commercial software is somehow >"better". Regardless of your opinion on their operating systems, only a religious zealot would try to argue that Microsoft Office is not better than any of the open source alter

Re: influence platorm during install -end user question

2005-09-17 Thread Tim Roberts
ing to use the 64-bit compiler. Also note that there is a typo in your command line. You have an equals sign in lib.linux=i686-2.3 where you should have a dash. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can someone explain what I've done wrong...

2005-09-19 Thread Tim Roberts
ever __del__ does for class objects. It then binds the name "Person" to None. Next, it cleans up the name "Sophie". It calls __del__, which works. However, when you try to access People, that name is now bound to None, because it has already been cleaned up. Kaboom. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a string to a function pointer

2005-02-06 Thread Tim Roberts
't overlook the simple (and possibly more secure) answer: lookup = { 'a': a, 'b': b, 'c': c, } if lookup.has_key(myFunction): return lookup[myFunction]() else: print "Couldn't find", myFunction -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python mail filter

2005-02-08 Thread Tim Roberts
a procmail recipe can feed a message through a filter, and then pass the results of that filter back in to the e-mail system for further processing? It seems to me that you should consider letting procmail do what it is good at, and use your Python solution for the things that are beyond it. -- - T

Re: dos box appears when clicking .pyc

2005-02-13 Thread Tim Roberts
S box. If you really want .pyc files to run without a DOS box, bring up a command shell and type assoc .pyc=Python.NoConFile (Actually, you should type "assoc .pyw" to make sure that is its file type.) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Considering python - have a few questions.

2005-02-13 Thread Tim Roberts
e on-the-fly. With a package like CherryPy, you get a web server built-in. You fire up the server in the background, and bring up Internet Explorer as "your" user interface. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: image fourier transform

2005-02-14 Thread Tim Roberts
', then you do 1D FFTs on all the columns of X'. So, for a 32x32 2D FFT, you'll end up doing 64 1D FFTs. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I make my program start fullscreen ?

2005-02-17 Thread Tim Roberts
BOOGIEMAN <[EMAIL PROTECTED]> wrote: > >os = windows xp >How do I make "myprogram.py" start fullscreen at windows command prompt ? >Also I made it as "myprogram.exe" with py2exe,but how to start fullscreen ? Which GUI toolkit are you using? wxPython? tk?

Re: Help needed for to build a CGI shell interface.

2005-02-17 Thread Tim Roberts
o expose a command shell via CGI? Can you think of a better way to allow hackers to wreak havoc on your system? -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in email package?

2005-02-20 Thread Tim Roberts
tioned, you probaby shouldn't assume it. >Can this behaviour of email be considered a bug? Not in my opinion, no. >Is there a good case to iterate over something useful in a message? Well, if you don't have an answer to that question, then why would you expect it to support it

Re: A few q's on python files.

2005-02-22 Thread Tim Roberts
single file along with the interpreter. When the .exe is executed, it extracts the interpreter and the scripts into a temp directory, and fires up the interpreter. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Comm. between Python and PHP

2005-02-22 Thread Tim Roberts
u don't have to demean yourself by working in PHP. Sockets and pipe files are common methods of communicating with a daemon. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: cgi: getting at raw POST data?

2005-02-26 Thread Tim Roberts
x27;m not seeing how to get at data that's not a named form parameter. If you are using POST in some non-standard way, just skip using the cgi module at all and read stdin yourself. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to pass a parameter by reference?

2005-02-26 Thread Tim Roberts
is lost. However, the variable zzz is still bound to [0,1,2]. If you need to create a new object and return it to the mainline, do that: def xxx(yyy): yyy = [ 3, 4, 5 ] return yyy zzz = [ 0, 1, 2 ] zzz = xxx(zzz) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boe

Re: os.stat('')[stat.ST_INO] on Windows

2005-03-01 Thread Tim Roberts
Patrick Useldinger <[EMAIL PROTECTED]> wrote: > >What does the above yield on Windows? 0. >Are inodes supported on Windows NTFS, FAT, FAT32? No. Inodes are strictly a Unix filesystem concept. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- htt

Re: os.stat('')[stat.ST_INO] on Windows

2005-03-02 Thread Tim Roberts
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >Tim Roberts wrote: >>>Are inodes supported on Windows NTFS, FAT, FAT32? >> >> No. Inodes are strictly a Unix filesystem concept. > >I disagree. NTFS MFT records are so similar to inodes >that thei

Re: windows bat file question

2005-03-02 Thread Tim Roberts
rom logilab.pylint import lint >lint.Run(sys.argv[1:]) > > >DosExitLabel = """ >:exit >rem """ -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: win32 COM and data types / direction

2005-03-05 Thread Tim Roberts
as short:%d as int:%d sum:%d" % (inShort, inInt, outSum) > outSum = inShort + inInt > ># Add code so that when this script is run by ># Python.exe, it self-registers >if __name__=='__main_ _': > print "Registering COM server..." > import win32

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