RE: replacing ASP/VBScript with Python

2005-02-15 Thread Tim Golden
[Peter Maas] | | Peter Maas schrieb: | > I have inherited an extremely messy ASP/VBScript application which | > is a pain for me to support. Now the customer is thinking about a | > redesign. I'd like to rewrite the whole thing in Python but the app | > has to meet some conditions like | > | > -

Re: Accessing Objects Based On Their ID

2005-02-15 Thread Tim Daneliuk
accessible in the namespace... Why only the id? A list only stores a reference to the object anyway - no copy of it. So you don't gain anything by using the id. Point taken... thanks. -- ---- Tim Daneliuk [EMAIL PROTECTED] PG

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread Tim Peters
[Tim Peters] >> Well, I'm a Director of the Python Software Foundation, and my view is >> "the more platforms the merrier". [Ilias Lazaridis] > I extract: "you are intrested, that the source-code-base compiles > directly with MinGW (and other compilers)"

Re: SHA1 broken

2005-02-15 Thread Tim Churches
f SHA1 hashes - thus, as Schneier points out, uses of keyed hashes (such as HMAC) are not compromised by this. Tim C -- http://mail.python.org/mailman/listinfo/python-list

RE: huge help for interactive python

2005-02-17 Thread Tim Golden
[David S.] [... snip recommendation of Gary Bishop's readline ...] | | I could not find a list of the keyboard commands | that readline supports, so I generated: | | http://fsinnovations.net/share/keymap.pdf Brilliant! Thanks very much. I've half-used ipython for several months, but I'm so ke

[ANN]: twander 3.195 Released And Available

2005-02-17 Thread Tim Daneliuk
ficantly speed up your day-to-day workflow. - A Python/Tkinter application - about 5000 lines of code/comments - A RCT (Really Cool Tool) that will have you addicted in a day or two See the web page for more information, a screen shot, and the complete documentation.

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: Fuzzy matching of postal addresses

2005-02-17 Thread Tim Churches
McBooCzech wrote: Tim, do you think Ferbel can parse properly with non English data-sets? The official name for the project is "Febrl" (freely-extensible biomedical record linkage) but perhaps "Furball" would be better name, given its focus on fuzziness (if that is not a co

Re: Fuzzy matching of postal addresses

2005-02-19 Thread Tim Churches
ages (the log) directly to Peter Christen and myself in the first instance. Further discussion of these applictaon-specific issues is not appropriate for the general Python list - but you could report back to the Python list on your overall experience after we have solved the problems with you. Regards, Tim C -- 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

Mixing Txinter and Pygame

2005-02-21 Thread Tim Knauf
On a side note, has anyone else found the Tkinter documentation awfully obscure? I've found Python a joy to learn about, and Pygame's tutorials are a lot of fun. I can't say the same for Tkinter, and found myself having to do many Google searches before I uncovered information I co

Re: Mixing Txinter and Pygame

2005-02-22 Thread Tim Knauf
Eric Brunel wrote: Well, since these are just exceptions, a simple try... except block would be fine, and you can even figure out the reason for the exception. Here is what I'd do: - when you create your Tkinter main window, initialize an attribute that you'll use to see if the application has q

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: Whither datetime.date ?

2005-02-26 Thread Tim Peters
[Harald Hanche-Olsen] > I'm confused. I was going to try linkchecker, and it dies with a > traceback ending in > > File "/usr/local/lib/python2.4/calendar.py", line 32, in _localized_month >_months = [datetime.date(2001, i+1, 1).strftime for i in range(12)] > AttributeError: 'module' object h

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: Need help running external program

2005-02-27 Thread Tim Jarman
Rigga wrote: > Pink wrote: > >> Rigga wrote: >> >>> Hi, >>> >>> I am running the line of code below from a shell script and it works >>> fine, however I am at a total loss on how i can run it from within a >>> Python script as every option I have tried fails and it appears to be >>> down to the

Re: simple input that can understand special keys?

2005-02-28 Thread Tim G
Gabriel B. wrote: > i'm writting an application that will use Tinker in a newer future. > Now it's console only. I simply ommit some data on the display, > print() some other and go on. The problem is that i can't test the > actions tiggered by special keys, like Page Up/Down or the F1...12 > > Rig

Validating A User/Password Pair + Getting Groups On Unix

2005-02-28 Thread Tim Daneliuk
ng to - and that requires also scanning /etc/passwd and then looking up the corresponding primary group in /etc/group. Is there a better way? TIA, -- ---- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.co

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: Regular Expressions: large amount of or's

2005-03-01 Thread Tim Peters
[André Søreng] > Given a string, I want to find all ocurrences of > certain predefined words in that string. Problem is, the list of > words that should be detected can be in the order of thousands. > > With the re module, this can be solved something like this: > > import re > > r = re.compile("wo

Re: Jigsaw solver

2005-03-01 Thread Tim Churches
, obvious axes, but not along every possible axis. What I want to know is whether any open source implementations of this technology are available. No doubt it is patented to death by Xerox. Tim C -- http://mail.python.org/mailman/listinfo/python-list

Re: Jigsaw solver

2005-03-01 Thread Tim Churches
[EMAIL PROTECTED] wrote: Tim Churches wrote: [EMAIL PROTECTED] wrote: ObPuzzle: how did I "damage" the image? You created a mirror image. Damn. Too easy. There is another explanation for the rapidity with which your brain teaser was solved, but modesty preven

Running Python Scripts With 'sudo'

2005-03-02 Thread Tim Daneliuk
ouble? TIA, -- -------- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: > Brian van den Broek wrote: > >> Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) > Thanks for all your help with this it is appreciated, one further question > though, how do I pass a variable to the external program while using the > r""" > > Than

Re: Distributing applications

2005-03-02 Thread Tim Jarman
Jaime Wyant wrote: > Sneaky! I like it. Now if there was only a subversion python module... > > jw > GIYF: http://pysvn.tigris.org/ -- Website: www DOT jarmania FULLSTOP com -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: (snip) >> > This is the command I am trying to run: > > feed is a list of web addresses > > output, input = popen2("wget -q %s -O - | tr '\r' '\n' | tr \' \" | sed -n > 's/.*url="\([^"]*\)".*/\1/p'" % feed[counter]) > > But it does not work, if I escape the string using r""" and

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: HELP: Python equivalent of UNIX command "touch"

2005-03-03 Thread Tim G
Since no-one's suggested this yet, I highly recommend UnxUtils: http://unxutils.sourceforge.net/ which includes a touch.exe. Obviously, this doesn't answer your call for a Python version, but if you're happy with touch under Unix, maybe this will work for you. TJG -- http://mail.python.org/mailm

RE: starting windows program from python based on file extension ?

2005-03-03 Thread Tim Golden
[EMAIL PROTECTED] | I used python to build a HTML file and now I would like to | automatically start my browser to display this file. I guess I could | use os.system(), but then I had to specify a specific path to the | browser. | | I wonder if it is possible to tell windows to open "myFile.html"

Re: Python 2.4 removes None data type?

2005-03-04 Thread Tim Peters
[EMAIL PROTECTED] > I just read in the 'What's New in Python 2.4' document that the None > data type was converted to a constant: > http://python.org/doc/2.4/whatsnew/node15.html > > """ > # None is now a constant; code that binds a new value to the name > "None" is now a syntax error. > """ > > S

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

Re: Speeding up CGIHTTPServer

2005-03-07 Thread Tim Roberts
Server for Win98, although I think it's awfully hard to configure. thttpd and xitami are good lightweight web servers. Apache works quite well in Windows, but I don't think it is very happy on Windows 98. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework

2005-03-10 Thread Tim Jarman
re are real-world sites using it in production; again, check out the wiki. HTH, Tim -- Website: www DOT jarmania FULLSTOP com -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterate using tuple as index

2005-03-10 Thread Tim Jarman
James Stroud wrote: > Hello, > > Its not obvious to me how to do this. I would like to iterate using a > tuple as an index. Say I have two equivalently sized arrays, what I do now > seems inelegant: > > for index, list1_item in enumerate(firstlist): > do_something(list1_item, secondlist[index]

Re: newbie : prune os.walk

2005-03-11 Thread Tim Roberts
. The statement dir = [] does not actually change the list that was passed in. It creates a NEW empty list and binds it to "dir". If you want to empty the "dir" variable, try: del dir[:] -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: dictionary - howto get key value

2005-03-11 Thread Tim Roberts
get it in the python way ? If you need to do this a lot, just keep two dictionaries, where the keys in each are the values in the other. reversephone = dict( zip( phone.values(), phone.keys() ) ) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Licensing Python code under the Python license

2005-03-11 Thread Tim Peters
[Daniel Keep] > I'm currently working on a Python program, and was wondering if it's > possible to license the program, some associated tools, and a few other > libraries I've written under the Python license. > > I had a look at the new PSF Python license on the list of OSI-approved > licenses, bu

Re: command line args

2005-03-14 Thread Tim Daneliuk
sys.exit(0) if opt == "-v": print RCSID sys.exit(0) # Rest of program goes here -- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Tim Daneliuk
command=lambda cmd=cmdkey: CommandMenuSelection(cmd)) Would it not be the case that, without lambda, we will need to pollute the name space with a bunch of specialized little functions for each and every construct like this? --

Re: is there a problem on this simple code

2005-03-15 Thread Tim Roberts
n i make rx_command of type 'int' if i am to use 2)? Did you get an answer to this? I couldn't see any responses. The answer is either: rx_command = unpack('1B', rx_data_command)[0] or (rx_command,) = unpack('1B', rx_data_command) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: error sending path to Win OS

2005-03-15 Thread Tim Roberts
t exist from the point of view of the directory where the script is running this. You might do this: print os.getcwd() os.system('dir ' + InputDirectory) just to prove that you are where you think you are. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: will it cause any problems to open a read-only file & not close it?

2005-03-15 Thread Tim Roberts
you open a file to read >& never close it? A file is closed when the last reference to it is deleted. Since you never save a reference to this file, the last reference is deleted as soon as the readlines() call finishes. So, the file will be closed when you move to the next stateme

Re: win32 shell extension (virtual drive)

2005-03-15 Thread Tim Roberts
m Microsoft, and (C) no human being really wants to do. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-16 Thread Tim Roberts
this: a = (3 + 5) * 5 You really, really want (3 + 5) to be an integer, not a one-item tuple. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple XML-to-Python conversion

2005-03-17 Thread Tim Jarman
[EMAIL PROTECTED] wrote: > Amara does indeed make it effortless to transform an XML document into > a Python structure. Unfortunately this suggestion requires the 3rd > party software, Amara, _and_ a 4Suite installation according to the > website. > > The reason I can't expect users to have 3rd

Re: Is Python like VB?

2005-03-17 Thread Tim Roberts
th a lot of customization using >Visual Basic. The VB in Microsoft Office is not being discontinued. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: importing two modules with the same name

2005-03-19 Thread Tim Jarman
Francisco Borges wrote: > Hello, > > This is not stricly necessary but it would be nice if I could get it > done. Here is what I want to do: > > There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be > able to import 'my foo' and then from within my foo, import 'std > foo'. Anyone

Re: inline comparison

2005-03-19 Thread Tim Roberts
get around wtih this? I don't want to break down this >comparison in two steps. Sorry, you have to. Assignment statements are not expressions in Python. m = self.macro_parser.match(d) if m: xxx You know the outer parentheses are not necessary, right? -- - Tim Roberts

Re: Text-to-speech

2005-03-19 Thread Tim Churches
try (see http://directory.google.com/Top/Computers/Programming/Languages/Perl/Poetry/ )? Indeed, have any poems ever been written about Python - other than "The Zen of Python" by Tim Peters? A limerick, even? There once was a language called Python... (which is pretty close to having

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Tim Williams
"Dave Merrill" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Sorry for the newbness... Win2K, Python 2.3.3, MySQL 4.1.7. Downloaded and > extracted MySQL-python-1.0.0.win32-py2.3.zip. Put the whole extracted > directory into C:\Program Files\Python23\Lib\site-packages\ and rena

Re: date diff calc

2004-11-29 Thread Tim Peters
[Skip Montanaro] > ... > The datetime.date object already exposes a strftime method for > generating a formatted string output and will create date objects > from both time.time() output (fromtimestamp) and "proleptic > Gregorian ordinal"s (fromordinal). Looking at the datetime module > docs, it's

RE: Get Special Folders (ie Desktop location)

2004-11-30 Thread Tim Golden
[EMAIL PROTECTED] | I'm just starting out writing Python scripts (in PSP), and need to | find the location of Windows special folders such as 'My Documents' | and 'Desktop' so that I can save files in the right place. Is there | any method I can use in Python to get these? | | If I were doing thi

Re: Struggling with struct.unpack() and "p" format specifier

2004-11-30 Thread Tim Peters
[Geoffrey <[EMAIL PROTECTED]>] > I am trying to read data from a file binary file and then unpack the > data into python variables. Some of the data is store like this; > > xbuffer: '\x00\x00\xb9\x02\x13EXCLUDE_CREDIT_CARD' > # the above was printed using repr(xbuffer). > # Note that int(0x13) =

Re: date diff calc

2004-11-30 Thread Tim Peters
[Skip Montanaro] >>> I think inputs from strings would be much more common. [Tim Peters] >> Me too, although it's a bottomless pit. >> >> guess-6-intended-meanings-for-1/2/3-before-breakfast-ly y'rs [Peter Hansen] > I think Skip was intending that the for

Re: ver 23 invokation on Windows

2004-11-30 Thread Tim Roberts
script gets invoked, but command line arguments disappear. >Any idea what to do? Did you remember to pass the parameters when you created the file association? C:\TMP>assoc .py .py=Python.File C:\TMP>ftype Python.File Python.File=C:\Apps\Python23\python.exe "%1" %* C:\TMP> --

Re: Python 3000 and "Python Regrets"

2004-12-01 Thread Tim Peters
[EMAIL PROTECTED] > I just came across the slides for Guido van Rossum's "Python > Regrets" talk, given in 2002. It worries me that much of my Python > code would be broken if all of his ideas were implemented. Actually, none of it would break, provided you don't change the Python implementation y

Re: access to generator state

2004-12-02 Thread Tim Peters
[Neal D. Becker] > ... > Only one problem. Is there any way to access the state of a > generator externally? In other words, the generator saves all it's > local variables. Can an unrelated object then query the values of > those variables? (In this case, to get at intermediate results) It's

Re: assymetry between a == b and a.__eq__(b)

2004-12-04 Thread Tim Peters
[Mel Wilson] > :) Seems to: > > > Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> class Eq(object): > ... def __eq__(self, other): > ... return True > ... > >>> class Neq(Eq

Re: Delphi/Kylix and Python

2004-12-04 Thread Tim Roberts
My problem with both Delphi and Kylix is in getting them to connect >with PostgreSQL and SQLite. Any suggestions? From what I have read, ODBC or >JDBC may do it, but I have experience with neither. There are direct Delphi components for both databases. Google is your friend. -- - Tim Ro

RE: [pywin32] windows shares, was os.listdir("\\\\delta\\public")

2004-12-06 Thread Tim Golden
[Egor Bolonev] | how to get list of shares using pywin32? You want to be looking at the NetShareEnum function in the win32net module. TJG This e-mail has been scanned for all viruses by Star. The service is powered by Mess

RE: notification for cd insertion

2004-12-06 Thread Tim Golden
[Qiangning Hong] | I want one of my function to execute when a cdrom is | inserted. How can I achieve that? 1) Go to http://groups.google.com 2) Search for python cd insert notification 3) Pick the first result, which is a post by me responding to the same question about a year ago. TJG

Re: [BUG] IMO, but no opinions? Uncle Tim? was: int(float(sys.maxint)) buglet ?

2004-12-06 Thread Tim Peters
[Bengt Richter] > Peculiar boundary cases: > > >>> 2.0**31-1.0 > 2147483647.0 > >>> int(2147483647.0) > 2147483647L > >>> int(2147483647L ) > 2147483647 > >>> > >>> -2.0**31 > -2147483648.0 > >>> int(-2147483648.0) > -2147483648L > >>> int(-2147483648L ) > -2147483648 > > some kind of one-off err

Re: Ptyon 2.3.5 probably coming in January; get your bugs/patches reported!

2004-12-06 Thread Tim Peters
[Brett C] >> Anthony Baxter, our ever-diligent release manager, mentioned this past week >> that Python 2.3.5 will most likely come to fruition some time in January >> (this is not guaranteed date). [Roy Smith] > Interesting. Does that mean that 2.3 and 2.4 will be maintained in > parallel for a

Re: Time for : comp.lang.python.newbies ??

2004-12-06 Thread Tim Roberts
n't, really. I don't think the percentage of true newbie questions has really gone up. However, as you grow more knowledgeable, the percentage of questions that SEEM like newbie questions goes up. comp.lang.python has always been a bastion of kindness and tolerance in the comp.lang hi

Re: [BUG] IMO, but no opinions? Uncle Tim? was: int(float(sys.maxint)) buglet ?

2004-12-07 Thread Tim Peters
[Tim Peters] >> ... there's no promise anywhere, e.g., that Python will return an int >> whenever it's physically possible to do so. [Bengt Richter] > Ok, I understand the expediency of that policy, but what is now the meaning > of int, in that case? Is it now just a v

Re: Python 2.3.5 ?

2004-12-07 Thread Tim Peters
[Luis M. Gonzalez] > I'm confussed... > Python 2.4 (final) hs been released a few days ago, but now I > see that Python 2.3.5 is being worked on. > Why? What does it mean? Just that enough volunteers exist interested in producing another bugfix release for the 2.3 line. It will probably be the la

Re: memoize factorial example (was Re: decorators ?)

2004-12-07 Thread Tim Peters
[Daniel 'Dang' Griffith] >> But the factorial example on the wiki has a defect. It incorrectly >> calculates factorial(0) as 0, when it should be 1. [Terry Reedy] > This is a matter of definition, and definitions apparently differ. > fact(0) == 0 is a backward projection from the definition f(1)

Re: os.path.islink()

2004-12-08 Thread Tim G
You may well be able to do it with the win32file module functions: GetFileAttributesEx or GetFileInformationByHandle It's not my area of expertise, but usually a bit of poking around in msdn.microsoft.com yields some results, as does Googling around for other people (often VB or Delphi-based) who h

Re: results of division

2004-12-09 Thread Tim Peters
[Paul McGuire] ... > >>> print "%.2f" % 1.775 > 1.77 > > Hmmm, if we rounded, I would have expected 1.775 to round up > to 1.78. Platform-dependent. 1.775 isn't exactly representable regardless, but whether exactly-half-way numbers that are exactly representable round up or truncate varies across

RE: Users

2004-12-09 Thread Tim Golden
[python1] | Do you know of a way to list the users on a Win2K machine? I | can't seem to find a module for this. Interpretation 1: who is in the user database of a given machine? Investigate the win32net module. Something like this: import win32net import win32netcon MACHINE_NAME = 'VOGBP200'

Re: Civilization IV uses Python for scripting

2004-12-11 Thread Tim Jarman
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: > > Advancement: PYTHON > Requires: Computers, Mythology > Effect: > * Increases revenue generated by capitalization by 300% > * Makes two unhappy citizens happy > * Renders all Wonders of the World in all other countries co

Re: thread/queue bug

2004-12-11 Thread Tim Peters
[Peter Otten] > What I believe to be a minimal example: > > > import Queue > import threading > import time > > q = Queue.Queue(4) > > def proc(): >while True: >q.get(1) >Queue.Queue() >print "YADDA" > > threading.Thread(target=proc).start() > > while True: >pri

Re: Upgrading Python Article

2004-12-11 Thread Tim Roberts
sual C++ 7.1 is signficantly better at compliance than their past compilers. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: thread/queue bug

2004-12-13 Thread Tim Peters
[Antoon Pardon] > I don't see why starting a thread as a side effect of importing is > bad thread practice. Sure python doesn't cater for it, but IMO > that seems to be python failing. Obviously, it's bad practice in Python because it can lead to deadlocks in Python. It's nearly tautological. Im

RE: uptime for Win XP?

2004-12-13 Thread Tim Golden
[Peter Hansen] | | Richie Hindle wrote: | > [Greg] | > | import win32api | print "Uptime:", win32api.GetTickCount(), "Milliseconds" | > | > Note that in the unlikely event of your Windows machine being up for | > longer than 2^32 ms (about 49 days), GetTickCount() will | wrap back to |

Re: Efficient grep using Python?

2004-12-15 Thread Tim Peters
["sf" <[EMAIL PROTECTED]>] >> I have files A, and B each containing say 100,000 lines (each >> line=one string without any space) >> >> I want to do >> >> " A - (A intersection B) " >> >> Essentially, want to do efficient grep, i..e from A remove those >> lines which are also present in file B.

Re: Efficient grep using Python?

2004-12-15 Thread Tim Peters
[Fredrik Lundh] >>> bdict = dict.fromkeys(open(bfile).readlines()) >>> >>> for line in open(afile): >>>if line not in bdict: >>>print line, >>> >>> [Tim Peters] >> Note that an open file is an iterable object, yi

Re: Efficient grep using Python?

2004-12-15 Thread Tim Peters
[Jane Austine] > fromkeys(open(f).readlines()) and fromkeys(open(f)) seem to be > equivalent. Semantically, yes; pragmatically, no, in the way explained before. > When I pass an iterator instance(or a generator iterator) to the > dict.fromkeys, it is expanded at that moment, I don't know what "e

Re: Python compiler method

2004-12-16 Thread Tim Roberts
e compiler of the python.thanks a lot!!! Perhaps you could ask your question in a different way. Python is designed as an interpreted language, like Perl and Javascript. It isn't compiled to machine language. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. --

Re: os.walk bug?

2004-12-16 Thread Tim Peters
[Gabriel Cosentino de Barros] ... > for root, dirs, files in os.walk('t:\'): > # -- do stuff > print "working on", root > # -- stuff done > > print 'DEBUG: dirs =', dirs > for d in dirs: > # -- remove archive >

Re: os.walk bug?

2004-12-16 Thread Tim Peters
[Adam DePrince] > Each iteration of os.walk returns three parameters; one of those, > dirs, is a list of directories within the current directory pointed at > by root. Right. > Am I correct to assume that you beleve that by changing the > contents of dir you will affect how os.walk traverses the

Re: expression form of one-to-many dict?

2004-12-17 Thread Tim Peters
[Steven Bethard] > So I end up writing code like this a fair bit: > > map = {} > for key, value in sequence: > map.setdefault(key, []).append(value) > > This code basically constructs a one-to-many mapping -- each > value that a key occurs with is stored in the list for that key. > > This code'

Re: lies about OOP

2004-12-13 Thread Tim Daneliuk
s://www.tundraware.com/Technology/Bullet/ -- ---- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

re: A problem with list

2004-12-14 Thread Tim Henderson
ure: ~~ float 3.14 0 int 3 1 string Hi i am a string 2 ~~ The first way to solve your problem is quick dirty and efficient. The XML version is highly scalable but requires a lot more code to impleme

Re: A rational proposal

2004-12-18 Thread Tim Peters
[Jp Calderone] ... > The Decimal type seems to define min and max so that NaNs > can be treated specially, but I glean this understanding from only > a moment of reading decimal.py. Perhaps someone more well > informed can declare definitively the purpose of these methods. To conform to the sema

Re: Upgrading Python Article

2004-12-18 Thread Tim Roberts
JanC <[EMAIL PROTECTED]> wrote: >Tim Roberts schreef: > >> I don't think that's fair. Visual C++ 7.1 is signficantly better at >> compliance than their past compilers. > >AFAIK that's only for C++, not for C...? Yes. Microsoft has largely chosen t

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Tim Peters
#x27;s on his mind, and then shuts up. It's a fact that he's been extremely helpful to countless people here over the years, but if you're looking for touchy-feely welcome or appreciation, don't look to /F for it. That's my job here . the-joy-that-is-python-is-exceeded-only-by-the-joy-that-is-you-ly y'rs - tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I always call PyErr_Clear() when an exception occurs?

2004-12-20 Thread Tim Peters
[Jaime Wyant] > I've found that the code below will crash if I don't have the > PyErr_Clear() function call. Should I always call PyErr_Clear()? That's not the right approach. Nearly all Python C API calls can fail. They return a special value if they do, primarily NULL for a call that returns

Re: trouble building python2.4

2004-12-22 Thread Tim Peters
een- god-save-the-queen- send-her-victorious- happy-and-glorious- long-to-reign-over-us- god-save-the-queen- stupid-unicode-pop-ly y'rs - tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for Series 60 update

2004-12-22 Thread Tim Hoffman
and xmlib and away we go. from the console I could immediatly do xml-rpc calls to my favourite Zope/CMF instance over GPRS and it just worked. This is cool. Tim Ville Vainio wrote: Python for S60 seems to be available for the grand public as of today. Check out http://www.forum.nokia.com/main/0,,

Re: Python for Series 60 update

2004-12-23 Thread Tim Hoffman
HI Jukka Laurila wrote: On Thu, 23 Dec 2004 06:52:28 +0800, Tim Hoffman <[EMAIL PROTECTED]> wrote: I did find a problem with it on my 7610. It works, but I had to hard code my bluetooth mac address (I assume thats what it is called in bluetooth). The bt_discover() call didn't seem

Re: test

2004-12-23 Thread Tim Peters
[Per Erik Stendahl <[EMAIL PROTECTED]>] > sdfdsafasd Generally speaking, yes, but not if you're concerned about Pythons before 1.5.2 too. If you are, a reasonable workaround is: try: sdfdsafasd except NameError: pass else: True = None is None and 1 != 2 False = None is not None o

Re: BASIC vs Python

2004-12-23 Thread Tim Jarman
In article <[EMAIL PROTECTED]>, Alan Gauld <[EMAIL PROTECTED]> wrote: > I dunno. Here in the UK there was a small home computer called (I > think) the Oric(*) which had a membrane keyboard, 4K or RAM and > ran Forth.It had a small cult following before dying out. It > looked a bit like the early

Re: Koolaid (was Re: Optional Static Typing)

2004-12-23 Thread Tim Churches
means. > > I always thought the connotation was more that those who > "drank the Kool-Aid" were unthinking drones, following what > others told them to do. I thought it was an allusion to "The Electric Kool-Aid Acid test" by Tom Wolfe - see http://en.wikipedia.org/wiki/The_Electric_Kool_Aid_Acid_Test Tim C -- http://mail.python.org/mailman/listinfo/python-list

Re: Koolaid (was Re: Optional Static Typing)

2004-12-24 Thread Tim Jarman
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > > P.S.: The ironic thing about all this is that it was > actually something called "Flavor Aid", made by a > company called Jel Sert (http://www.jelsert.com), > and not Kool-Aid at all. What would be even funnier > is if

Re: Python on Linux

2004-12-28 Thread Tim Roberts
27;t want to uninstall the old version. Red Hat installs packages that are needed for its configuration scripts. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

<    12   13   14   15   16   17   18   19   20   21   >