Re: Recursion head scratcher

2009-12-02 Thread Tim Wintle
. It will be one line shorter to print the other order. As a hint - think of what the python interpreter's stack looks like when it's running your code at the moment - that's the stack you're currently using (and need to use) to store the results you print. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: [Twisted-Python] ANN: Twisted 9.0.0

2009-12-02 Thread Tim Allen
[email protected] wrote: > A message with some ticket links from a thread on the twisted-python > mailing list: http://bit.ly/8csFSa Some of those tickets seem out of date; a better plan would be to query for tickets with the "py3k" keyword: http://twistedmatrix.com/trac/search?q=py3

Re: Question on Python as career

2009-12-03 Thread Tim Roberts
the profile >expectancy? I am amazed that a PhD does not already have some clues about the answers to these questions. Your best plan is to start exploiting your network of contacts. If you don't already have a network of commercial contacts, then you have a long, hard road ahead of you

Re: editor with autocompletion

2009-12-04 Thread Tim Chase
So I want an editor with auto complete. I there any such tool in Python ?(not only in python any other) I want it for my new lang vim? emacs? or do you want the editor to be written in Python? -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Organization of GUIs

2009-12-05 Thread Tim Roberts
t's possible to handle that, but each layer has to know about "notifications", and has to be able to hand "notifications" up the hierarchy tree until it gets to someone who knows what to do about it. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket question

2009-12-05 Thread Tim Roberts
perlsyntax wrote: > >I just want to know could it be done makeing my own socket tool that >connect to two server at the same time.And what link do i need to look at? You can certainly connect to two (or any number) servers at the same time, but you have to create two sockets to do it

Re: Float precision and float equality

2009-12-05 Thread Tim Roberts
gt;> round(x-y,6) 0.0 Mark's solution is the generically correct one, which takes into account the rough range of the values. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a docstring for a module?

2009-12-06 Thread Tim Chase
* He hasn't actually defined a docstring. Docstrings have to be string literals, you can't do this: """%s does everything you could possibly want.""" % "xyz" I've occasionally wanted something like this, and have found that it can be done by manually assigning to __doc__ (either at the modul

Re: switch

2009-12-09 Thread Tim Chase
Carl Banks wrote: What if the object is a string you just read from a file? How do you dispatch using polymorphism in that case? This is where I most miss a switch/case statement in Python...I do lots of text-file processing (cellular provider data), so I have lots of code (for each provider

Re: switch

2009-12-09 Thread Tim Chase
MRAB wrote: Tim Chase wrote: switch row['recordtype']: case '01': phone.international += Decimal(row['internationalcost']) // optionally a "break" here depending on // C/C++/Java/PHP syntax vs. Pascal syntax which /

Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread Tim Chase
[email protected] wrote: I'm looking for a small, simple, fast, Python based web server for a simple, client side application we're building. I've used WebStack[1] for this in the past. It allows for stand-alone serving as well as plugging nicely into various "real" servers (apache+mod_pyt

Re: switch

2009-12-10 Thread Tim Chase
Great example Tim. This is something that many of us must be dealing with on a daily basis. The problem has enough details (bar one), to allow an answer and not so detailed as to be confusing. And for me it's a particularly good example, because your need accommodate mulitple provider fo

Re: switch

2009-12-11 Thread Tim Chase
On 12/10/2009 09:22 PM, John Bokma wrote: Tim Chase writes: Please don't delete attribution line(s), added: Asun Friere writes: I tend to prune them because a good newsreader will thread messages and put my reply in the context of the message to which I'm replying. Both T

Re: a list/re problem

2009-12-11 Thread Tim Chase
l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr'] Notice that some of the items in the list start and end with an '*'. I wish to construct a new list, call it 'n' which is all the members of l that start and end with '*', with the '*'s removed. So in the case above n would be ['

Re: Spawning an interactive interpreter in a running python process?

2009-12-11 Thread Tim Chase
I'm curious, in an academic sense, if it's possible to spawn the interactive interpreter (>>>) in a running python application. Ideally, I would like to be able to access the modules, functions and variables the application can. Is something like this possible? While not exactly "the intera

Re: eiger replacement?

2009-12-11 Thread Tim Roberts
d a slight address book malfunction when he sent this. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: read text file byte by byte

2009-12-12 Thread Tim Chase
Steven D'Aprano wrote: 2) Should I use streams? What do you mean by "streams"? they're what come out of proton packs...just don't cross them. It would be bad. -tkc (I suspect the OP is a Java/C++ programmer where "streams" are somewhat akin to generators, but less powerful; so the answer

Re: read text file byte by byte

2009-12-13 Thread Tim Chase
Grant Edwards wrote: If it's a binary file... OK, but... what is a "binary" file? One containing data encoded in base-2. Or one of a system of two files that orbits around a common center of mass? So if you see two files orbiting around a cathedral, they're binary files. f.open('binaryf

Re: power of explicit self?

2009-12-13 Thread Tim Roberts
ve the same kind of code to push "this", for example, even though "this" is not shown in the parameter list. I agree with the other repliers. "Explicit" self is not "implemented" anywhere. It's just an implementation decision. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: parse a string of parameters and values

2009-12-14 Thread Tim Chase
Gabriel Genellina wrote: Peter Otten escribió: bsneddon wrote: I am going to read a text file that is an export from a control system. It has lines with information like base=1 name="first one" color=blue I would like to put this info into a dictionary for processing. import shlex s = 'base=

Re: strptime not strict enough

2009-12-15 Thread Tim Roberts
time. >Where do I get strict date parsing? You do it yourself. Strict date parsing is incredibly tricky. The eGenix mx.DateTime module might be more to your liking. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: file.close() does not really close under Windows?

2009-12-17 Thread Tim Chase
Dani wrote: Is it correct that low-level file handles are not being closed after doing fd = open(filepath) fd.close() no, you are not correct. Demonstration: Cmd window #1: c:\temp> echo hello world > x.txt Cmd window #2 c:\temp> python Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v

Re: Java-to-Python?

2009-12-18 Thread Tim Wintle
On Fri, 2009-12-18 at 15:44 +0100, Virgil Stokes wrote: > I have a rather large Java package for the analysis of networks that I > would like to convert to Python. Many of the classes in the Java package > are "Serializable". > > Any recommendations on Java-to-Python (2.6) would be appreciated.

Re: How Do I...?

2009-12-18 Thread Tim Chase
Victor Subervi wrote: How do I...? Well, you start by reading a book on how to program. You would then learn that what you want (in all likelihood) is a dictionary/map structure for dynamically created key/value pairs. Once you have progressed from your current apprenticeship and achieved

Re: How Do I...?

2009-12-19 Thread Tim Chase
Victor Subervi wrote: On Fri, Dec 18, 2009 at 3:03 PM, Tim Chase wrote: Well, you start by reading a book on how to program. You would then learn that what you want (in all likelihood) is a dictionary/map structure for dynamically created key/value pairs. Once you have progressed from your

Re: Question about dir function

2009-12-19 Thread Tim Chase
Ray Holt wrote: When I run a dir(_builtins_) I get the error message that the name _builtins_ is not defined. I haven't tried the dir function on other functions, but can someone tell me why I am getting this message? Thanks, Ray So close, and yet thrown by requisite extra underscores: >>> di

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Tim Chase
Victor Subervi wrote: On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote: Of course, I can pass the page name as a parameter, but that's not elegant. That is precisely what it is in fact-- elegant; it is non-elegant to have magical behavior where what 'imports' something somehow changes or

Re: How Do I...?

2009-12-20 Thread Tim Chase
Victor Subervi wrote: The aim was not arrogance, but expression of exasperation "Walk a mile in my mocassins." You can't do it. I'm an artist. I think out of my right hemisphere, not my left like you. You couldn't possibly understand. [snip] Thank you for your help anyway. Thank you for your

Re: strptime not strict enough

2009-12-20 Thread Tim Roberts
Chris Rebert wrote: >On Tue, Dec 15, 2009 at 9:47 PM, Tim Roberts wrote: >> Tobias Weber wrote: >>> >>>despite the directives for leading zero stime.strptime('09121', >>>'%y%m%d') returns the first of December. Shouldn't it raise V

Re: Python (and me) getting confused finding keys

2009-12-22 Thread Tim Golden
John wrote: Hi there, I have a rather lengthy program that troubles me for quite some time. After some debugging, I arrived at the following assertion error: for e in edges.keys(): assert edges.has_key(e) Oops!? Is there ANY way that something like this can possibly happen? Three w

Re: Python (and me) getting confused finding keys

2009-12-22 Thread Tim Golden
John wrote: another thread can remove the key prior to the has_key call; or perhaps edges isn't a real dictionary? of course. But unless there is a way of using threading without being aware of it, this is not the case. Also, edges is definitely a dict (has been declared some lines before,

Re: Default working directory

2009-12-22 Thread Tim Golden
vsoler wrote: I'm using Python 2.6.4 on Windows (Vista & 7) I usually start Python by clicking on Start Menu the Python IDLE (Python GUI). However, if I want to save a new source *.py file, the default directory proposed for saving is not the one that I want. What can I do if I want that the c

Simple distributed example for learning purposes?

2009-12-26 Thread Tim Golden
I'm trying to work up a programming course using Python, aimed at secondary school students [*] here in London. One of my aims is to have a series of compact but functional examples, each demonstrating a particular field in which Python (and programming) can be useful. I'm trying to come up with

Re: [wxPy] Why I can not change a ListItem property?

2009-12-26 Thread Tim Roberts
er-draw control. See the ListCtrl_virtual.py example, for instance. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: A way to convert RTF to HTML?

2009-12-27 Thread Tim Wintle
On Sun, 2009-12-27 at 20:10 +, Star Glider wrote: > the problem is that the one of the fields as text in rich text format, > and it needs to be display without the RTF markup, of course. > Is there any way to convert RTF to HTML? Depending on how precisely you need to lay it out you might fin

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Tim Golden
Shawn Milochik wrote: [... suggesting Video rendering and name/address matching ...] Thanks for those, Shawn. The latter's more within my power, but the former certainly has an extra buzz factor. I'll look around to see if I can rustle up some straightforward example of the kind of thing... TJG

Re: getting name of passed reference

2009-12-30 Thread Tim Roberts
MyFunc( 27 ) MyFunc( "abcde" ) If the thing passed in is a list or an object, you can modify the object in place without trickery. You can check that with the "type" operator: if type(varPassed) == list: pass -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple distributed example for learning purposes?

2009-12-31 Thread Tim Golden
Nobody wrote: On Sat, 26 Dec 2009 20:06:02 +, Tim Golden wrote: I'm trying to come up with something which will illustrate the usefulness of a distributed processing model. Since I may not be using the term "distributed" exactly, my criteria are: * It should be clear that

Re: assert type([]) == type(())

2010-01-02 Thread Tim Chase
However the following is not an error for x in []: assert type(x) == type(()) I expected an AssertionError but get no errors at all. Any explaination? number_of_times_through_the_loop = 0 for x in []: assert type(x) == type(()) number_of_times_through_the_loop += 1 print nu

Re: Significant whitespace

2010-01-03 Thread Tim Roberts
oint value "1.1" in a new variable called "DO10I". -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Pymazon 0.1beta released.

2010-01-04 Thread Tim Wintle
On Tue, 2009-12-29 at 19:44 +0100, Chris Colbert wrote: > I'm happy to announce the first beta release of Pymazon: a Python > implemented alternative to the Amazon mp3 downloader. > > Pymazon was created specifically to alleviate the issues surrounding > the Linux version of the Amazon mp3 downlo

Re: parsing an Excel formula with the re module

2010-01-05 Thread Tim Chase
vsoler wrote: Hence, I need to parse Excel formulas. Can I do it by means only of re (regular expressions)? I know that for simple formulas such as "=3*A7+5" it is indeed possible. What about complex for formulas that include functions, sheet names and possibly other *.xls files? Where things

Re: getfirst and re

2010-01-06 Thread Tim Chase
I need to do something like the following: pat = re.compile('edit[0-9]*:[0-9]*') check = form.getfirst(pat) (to check things like 'edit0:1') How do I do this? Well, you can do it either as check = pat.search(string_to_search) which is pretty plainly detailed in the help for the "re

Re: getfirst and re

2010-01-06 Thread Tim Chase
Victor Subervi wrote: On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase wrote: But if you're using it on HTML form text, regexps are usually the wrong tool, and you should be using an HTML parser (such as BeautifulSoup) that knows how to handle odd text and escapings better and more robustly

Re: Something More Elegant

2010-01-09 Thread Tim Chase
Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for it

Re: shell access

2010-01-11 Thread Tim Chase
monkeys paw wrote: How do you access the command line from the python interpreter? on unix: type python >>> print 'hey' 'hey' >>> # I want to access the shell here, how do i do that? If you're interactive, I'd just use standard process/job control, and hit control+Z to suspend and "fg"

Re: Different number of matches from re.findall and re.split

2010-01-12 Thread Tim Chase
Steve Holden wrote: Steve Holden wrote: [...] Can someone explain why these two commands are giving different results? I thought I should have the same number of matches (or maybe different by 1, but not 6000!) re.MULTLINE is apprently 1, and you are providing it as the "maxsplit" argument. C

Re: Simple distributed example for learning purposes?

2010-01-14 Thread Tim Golden
On 13/01/2010 20:24, Aahz wrote: In article, Tim Golden wrote: I'm trying to come up with something which will illustrate the usefulness of a distributed processing model. Since I may not be using the term "distributed" exactly, my criteria are: Distributed spider with firew

Re: a problem with writing a generator

2010-01-14 Thread Tim Chase
pth of recursion (I'd use a dict of fname->recursion-depth to keep tabs on how deep I'd gotten, and raise an exception if I go too deep), but otherwise, that should give you a pretty straight-forward and easy-to-tweak starting point. Hope this helps, -tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple distributed example for learning purposes?

2010-01-15 Thread Tim Golden
On 14/01/2010 18:16, Mike Driscoll wrote: I think distributed transcoding of hi-def videos would be cool, but I haven't found much with Google. Still, you might find this useful for your project: http://pypi.python.org/pypi/AsynCluster/0.3 Thanks. I suspect that that would be overkill for what

Re: Windows drag & drop with win32com and IDropTarget

2010-01-15 Thread Tim Golden
On 15/01/2010 07:20, Greg K wrote: I'm trying to create a program that will process files dragged into its window, however I can't seem to get the cursor to change correctly when something is dragged over the window. I've created an object that implements the IDropTarget interface, but it seems t

Re: Simple distributed example for learning purposes?

2010-01-15 Thread Tim Golden
On 15/01/2010 15:43, r0g wrote: Distributed password cracking? It's really simple yet potentially engaging and could be a good segway into teaching them about computability and security. All you need is a bunch of password hashes and a wordlist. At the moment, that's pretty much what my example

Re: chr(12) Form Feed in Notepad

2010-01-15 Thread Tim Chase
W. eWatson wrote: Grant Edwards wrote: On 2010-01-15, W. eWatson wrote: I thought I'd put a page break, chr(12), character in a txt file I wrote to skip to the top of the page. It doesn't work. Comments? Yes, it does work. Apparently not with with my Brother 1440 laser printer. The characte

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread Tim Chase
W. eWatson wrote: Tim Chase wrote: The pseudo-pipeline comparison would be type file.txt > lpt1: which would send the raw text file to the printer (assuming it's set up on LPT1, otherwise, use whatever port it's attached to in your printer control panel); or are you using s

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-16 Thread Tim Chase
W. eWatson wrote: I am writing a txt file. It's up to the user to print it using Notepad or some other tool. I have no idea how to send it directly to the printer, but I really don't want to furnish that capability in the program. From Google, The Graphics Device Interface (GDI). If you're wri

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-16 Thread Tim Chase
John Yeung wrote: In another response, Tim Chase suggested creating an RTF file instead of plain text. I think this is your best bet if your goal is to get page breaks with the least amount of additional effort. The package he's probably referring to is PyRTF. I took a quick look at it a

Re: Is python not good enough?

2010-01-18 Thread Tim Chase
Phlip wrote: On Jan 12, 7:09 am, ikuta liu wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. This means, to appease the self-righteous indignation of the math professor who would claim = should mean "equality"... ...you gotta type a shif

Re: Parse a log file

2010-01-18 Thread Tim Chase
[email protected] wrote: I want to parse a log file with the following format for example: TIMESTAMPEOperation FileName Bytes 12/Jan/2010:16:04:59 +0200 EXISTS sample3.3gp 37151 12/Jan/2010:16:04:59 +0200 EXISTSsample3.3gp 37151 12/Jan/2010:16:04:

Re: Python IDE for MacOS-X

2010-01-19 Thread Tim Arnold
"Jean Guillaume Pyraksos" wrote in message news:[email protected]... > What's the best one to use with beginners ? > Something with integrated syntax editor, browser of doc... > Thanks, > >JG eclipse + pydev works well f

Re: Create object name from string value?

2010-01-21 Thread Tim Chase
Gnarlodious wrote: for name in ["object1", "object2", "object3"]: d = {name: classname()} print d[name] This works! However I end up saying: d['Server'].Config.BaseURL to get the data, when I should be saying: Server.Config.BaseURL It sounds like you want a mapping of strings to cl

Re: Default return values for out-of-bounds list item

2010-01-21 Thread Tim Chase
MRAB wrote: [email protected] wrote: Is there a built-in method in python that lets you specify a "default" value that will be returned whenever you try to access a list item that is out of bounds? Basically, it would be a function like this: def item(x,index,default): try: return x[

Re: Splitting text at whitespace but keeping the whitespace in thereturned list

2010-01-25 Thread Tim Arnold
(\s+)', "Hello world!") > ['Hello', ' ', 'world!'] also, partition works though it returns a tuple instead of a list. >>> s = 'hello world' >>> s.partition(' ') ('hello', ' ', 'world') >>> --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Sikuli: the coolest Python project I have yet seen...

2010-01-26 Thread Tim Roberts
works by using image analysis to locate the regions on the screen to be tickled. It's a novel idea, although others have correctly pointed out that it's not the most efficient way to automate applications. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mai

Re: myths about python 3

2010-01-28 Thread Tim Roberts
announcement. It is, for the most part, THE canonical example of the wrong way to conduct a development effort. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer daemon

2010-01-29 Thread Tim Wintle
r) to watch the PID file if it were deleted reliably. If the server crashes then it clearly won't get around to deleting it's pid file. The way I do it is to use os.kill (with signal 0 IIRC) to check if the process is still alive when the script starts. If it's not then I delete t

Re: Anyone with Experience Using WinTV Capture Cards?

2009-09-26 Thread Tim Roberts
ce >> with such use that might suggest sources? > >Win XP OS. Any general methods for dealing with such commercially built >capture cards? Let me Google that for you. http://www.lmgtfy.com?q=python+video+capture+windows Most such devices use DirectShow, so you need a C++ extensi

Re: What does the list_folders() method of mailbox.Maildir actually ?do (if anything)?

2009-09-26 Thread Tim Roberts
was added in Maildir++, and the subfolder names start with a dot. It's not a "wierd extension thereof". -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Tim Golden
Steven D'Aprano wrote: On Sun, 27 Sep 2009 16:11:52 +0200, Stef Mientki wrote: I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the user login on the system, some of the data from the database is allowed and other data is

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Tim Golden
Tim Golden wrote: Steven D'Aprano wrote: [... snip further stuff from Stephen whose name I can't even copy from three lines above :) Sorry, Steven. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing tuples of tuples to sqlite

2009-09-28 Thread Tim Chase
I have tuples in the format shown below: (u('2','3','4'),u('5','6','7')u('20','21','22')) Um, this is not valid Python which might explain the errors you're getting. Are you sure you don't mean to write: ((u'2', u'3', u'4'), (u'5', u'6', u'7')...) because "u" prefixing a tuple is

Re: os.listdir unwanted behaviour

2009-09-29 Thread Tim Chase
Piet van Oostrum wrote: Steven D'Aprano (SD) wrote: SD> What you describe is impossible -- os.listdir() returns an ordinary list, SD> it isn't a lazy iterator that updates automatically as the directory SD> changes. (At least not in Python2.5 -- I haven't checked Python 3.1.) He's not usi

Re: os.listdir unwanted behaviour

2009-09-29 Thread Tim Chase
a month or two back where folks were asking to turn os.listdir() into an iterator (or create an os.xlistdir() or os.iterdir() function) because directories with lots of files were causing inordinate slowdown. Yes, listdir() in both 2.x and 3.x both return lists while such a proposed iterator vers

Re: Partial directory search question

2009-09-29 Thread Tim Chase
What's the sanest way to print out all the files in the directory that start with the underscore? Ie, I just want to list _1, _2, _3, _4. I'd use a string's join() method to combine the results of a list-comprehension or generator that filtered the output of os.listdir() based on the startswit

Re: Partial directory search question

2009-09-30 Thread Tim Chase
import os for filename in os.listdir("/usr/bbs/confs/september"): #stat = os.stat(filename) if filename.startswith("_"): print filename yes, as lallous mentioned, this can be done as a list-comprehension/generator. If printing is all you want to do, it's a nice and concise

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-03 Thread Tim Rowe
a fucking idiot... > motherfucking aggresive > it's just few of priest fuckheads > look at lojban's motherfucking idiotic logo If you really knew anything about social function you would be able to work out why people think you are a troll. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: WMI remote call in python script to create process on remote windows computer

2009-10-06 Thread Tim Golden
error? Not clear which "int" error you mean, but trying to help anyway... You need to use raw strings (or use double-backslashes). That may or may not be the cause of your problems, but it certainly won't help. You may also run into theoretical restrictions of what remote WMI proce

Re: Skeletal animation

2009-10-06 Thread Tim Wintle
On Mon, 2009-10-05 at 18:36 +0200, Donn wrote: > see: http://www.panda3d.org/wiki/index.php/Attaching_an_Object_to_a_Joint +1 for Panda 3d. Their Node graph is very intuitive for animating joints, and Panda's API is very nice and clean. TimW -- http://mail.python.org/mailman/listinfo/python-li

Re: best vi / emacs python features

2009-10-07 Thread Tim Chase
One feature I have that emacs don't is that I'm able to efficiently edit a file on a remote machine with vim on a terminal (without graphical interface), and I'm using it. Apart from that, both solutions are emacs has the same efficiency on a terminal. or maybe I don't understand your sentence.

Re: best vi / emacs python features

2009-10-07 Thread Tim Chase
Carl Banks wrote: On Oct 7, 10:29 am, Tim Chase wrote: Perhaps this is a reference to the alt/meta/control/buckey/super key-chords that emacs is infamous for using It's Esc-Meta-Alt-Ctrl-Shift Sure that's not Winkey+Tab+Fn? :-) -tkc :wq! -- http://mail.python.org/mailma

Re: WMI remote call in python script to create process on remote windows computer

2009-10-08 Thread Tim Golden
David Jackson wrote: ok, cut and pasted, but changed the username/password to protect the innocent. this is from interactive prompt. let me know if i am still not doing the slashes correctly please. i doubt authentication is the issue.; i can get pid information using WQL queries. objCreateProc.C

Re: WMI remote call in python script to create process on remote windows computer

2009-10-08 Thread Tim Golden
Processor-Dev1l wrote: On Oct 8, 10:22 am, Tim Golden wrote: David Jackson wrote: ok, cut and pasted, but changed the username/password to protect the innocent. this is from interactive prompt. let me know if i am still not doing the slashes correctly please. i doubt authentication is the

Re: mxDateTime history (Re: mktime, how to handle dates before 01-01-1970 ?)

2009-10-09 Thread Tim Chase
Month arithmetic is a bit of a mess, since it's not clear how to map e.g. Jan 31 + one month. "Jan 31 + one month" usually means "add one to the month value and then keep backing off the day if you get an exception making the date", so you'd get Feb 31, exception, Feb 30, exception, Feb 29, p

Re: What do I do now?

2009-10-12 Thread Tim Chase
Che M wrote: 2. Start your own. As long it is not another new code editor for Python. There are a lot already. How about writing a web framework instead? [grins & ducks] -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: id( ) function question

2009-10-14 Thread Tim Chase
But if I chose as a value another number (a big one, let say 1e10) I get what I will expect also in the case of the chose of the integer 10 showed above: a=1e10 d=1e10 d is a False id(a) 11388984 id(d) 11388920 CPython has the option to cache frequently used items, and does so for a small

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
gt; And I know somebody, in other languages, thinks it's > a Best Practice to avoid using exceptions for flow control. > > Thankfully, python programmers are less dogmatic, and use whatever makes > sense to use. I hope. Absolutely. And it doesn't make sense to use exceptions for flow control :-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
eption ) And with enough static analysis to guarantee that the break will be reached? I think it would be a bit much to expect Python to solve the halting problem! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
cannot decrease indefinitely, if you can define a loop variant then you gurantee that the loop will terminate. Even if you are not being formal, just considering what the loop variants and invariants can save no end of trouble with tricky loops. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

subprocess hangs on reading stdout

2009-10-14 Thread Tim Arnold
p.kill() print 'skipping' # this works ok break s = '' if p: s = p.stdout.read() # trhis will hang occasionally if not s: continue --------

Re: the usage of 'yield' keyword

2009-10-15 Thread Tim Golden
Dave Angel wrote: def find(root): for pdf in os.walk(root, topdown=False): for file in pdf[2]: yield os.path.join(pdf[0],file) At the risk of nitpicking, I think that a modicum of tuple-unpacking would aid readability here: for dirpath, dirnames, filenames in

Re: The rap against "while True:" loops

2009-10-15 Thread Tim Rowe
2009/10/11 Philip Semanchuk : > IMHO, break, goto, etc. have their place, but they're ripe for abuse which > leads to spaghetti code. Unrestricted goto can leat to spaghetti code, but surely break can't? AFAICS, any break construct will still be H-K reducible. -- T

Re: () vs []

2009-10-15 Thread Tim Golden
Xavier Ho wrote: On Thu, Oct 15, 2009 at 6:39 PM, Chris Rebert wrote: Nanjundi meant "index method" as in "a method .index()" (i.e. a method named "index") which searches through the container for the given item and returns the index of the first instance of said item, like list.index() does.

Re: Module naming convention about StringIO

2009-10-15 Thread Tim Golden
Peng Yu wrote: It says on http://www.python.org/dev/peps/pep-0008/ ... don't get too hung up on things like this. Just use the modules. But StringIO does not following this convention. Although on the same page, it also mentions the following. However, since StringIO is in the library, shall

Re: Problem

2009-10-15 Thread Tim Chase
I can't send emails out. Can u fix this problem please? The problem is on line 72. Oh wait...you didn't include any code or the traceback. Yeah, that's gonna make it a little difficult to diagnose. But I'm gonna guess that "The authentication setting might not be correct for your outgoing e-m

Re: subprocess hangs on reading stdout

2009-10-15 Thread Tim Arnold
; > > > -- > Thanks, > --Minesh Hi Minesh, Looks like I need to learn about signals--that code looks nice. I'm using python2.6. thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: for loop: range() result has too many items

2009-10-15 Thread Tim Roberts
a simple concept, I've been surprised how many places itertools.count() has come in handy for me. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-16 Thread Tim Wintle
On Fri, 2009-10-16 at 01:01 +0200, Mick Krippendorf wrote: > Maybe my English (and my memory) is just not so good. I'm german, and > here "abnormal" and "anormal" are both negations of "normal", but with > a slight difference in meaning. "anormal" means just "not normal", > whereas the meaning of "

Re: restriction on sum: intentional bug?

2009-10-16 Thread Tim Chase
Stephen Hansen wrote: Why doesn't duck typing apply to `sum`? Because it would be so hideously slow and inefficient that it'd be way too easy a way for people to program something they think should work fine but really doesn't... alternatively, the function would have to do two /completely/ dif

Re: The rap against "while True:" loops

2009-10-16 Thread Tim Rowe
ry, not merely the only clean way to exit. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-16 Thread Tim Rowe
ppened that shouldn't have". If one uses it when something has happened that *should* have, because it happens to have the right behaviour (even if the overhead doesn't matter), then one is misrepresenting the program logic. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Tim Chase
Stephen Hansen wrote: There really is just a right way verses a wrong way to join strings together; using + is always the wrong way. Sometimes that level of 'wrong' is so tiny that no one cares, like if you are using it to join together two small strings. But when joining together a sequence of s

<    57   58   59   60   61   62   63   64   65   66   >