Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Sun, Oct 26, 2008 at 11:19 PM, Pedro Borges <[EMAIL PROTECTED]> wrote: > The scripts i need to run but be executed with no apparent delay specially > when the text transforms are simple. That makes no sense whatsoever! If you are performing data conversion with Python, interpreter startup time

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > You must be in a real big hurry if half a second matters that much to you. > Maybe if it took 5 seconds for the interpreter to start up, I could > understand having a problem with the start up time. +1 This thread is stu

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:45 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > Pedro was talking about cold startup time: > > $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches" > $ time python -c "pass" > > real0m0.627s > user0m0.016s > sys 0m0.008s $ sudo sh -c "echo 3 > /proc/sys/vm/dro

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 12:03 PM, Andy O'Meara <[EMAIL PROTECTED]> wrote: > I think we miscommunicated there--I'm actually agreeing with you. I > was trying to make the same point you were: that intricate and/or > large structures are meant to be passed around by a top-level pointer, > not using a

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:15 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Not if the startup is the main cost for a command you need to repeat many > times. Seriously if you have to spawn and kill python processes that many times for an initial cold startup and subsequent warm startups to be

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 3:36 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > It this a theoretical problem or an actual one, that we might have other > suggestions for? Heaven knows! I hardly think invoking hundreds and possibly thousands of short-lived python interpreters to be an optimal solution t

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:28 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Any command line based on python is a real example of that problem. > There are plenty of them. Yes, but in most cases you are not invoking your command-line app x times per y units of time. --JamesMills -- -- -- "Pr

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:36 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > It's not optimal but it is very common (CGI for example). Which is why we (The Python Community) created WSGI and mod_wsgi. C"mon guys these "problems" are a bit old and out dated :) --JamesMills -- -- -- "Pro

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:40 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Depends on the tool: build tool and source control tools are example > it matters (specially when you start interfaciing them with IDE or > editors). Having fast command line tools is an important feature of > UNIX, and

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:46 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> +1 This thread is stupid and pointless. >> Even for a so-called cold startup 0.5s is fast enough! > > I don't see the need to be rude. > And I DO care for Python startup time and memory footprint, and others do > too.

Re: Looking for a pure python Mysql module

2008-10-27 Thread James Mills
on this mailing list regarding this very subject. Search for it. cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Using threads to quit the main python process

2008-10-28 Thread James Mills
test = Test() timer = Timer(5, Event(), "stop") manager += stdin manager += test manager += timer while True: try: manager.flush() stdin.poll() timer.poll() except SystemExit: break except KeyboardInterrupt: break

Re: gl Multiple versions of python

2008-10-28 Thread James Mills
911') 33882864 1013 (2, 5, 2, 'final', 0) Read the sys documentation for the meaning of the attributes used aboave. cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get high precision timer in python?

2008-10-28 Thread James Mills
On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <[EMAIL PROTECTED]> wrote: > I use python2.5 in WindowsXP. If using time.time() as timer, it seems On the win32 platform should you not be using time.clock vs. time.time ? --JamesMills -- -- -- "Problems are solved by method" -- http://mail.python.org/mailma

Re: How to get high precision timer in python?

2008-10-28 Thread James Mills
2008/10/29 甜瓜 <[EMAIL PROTECTED]>: > 2008/10/29 James Mills <[EMAIL PROTECTED]>: >> On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <[EMAIL PROTECTED]> wrote: >>> I use python2.5 in WindowsXP. If using time.time() as timer, it seems >> >> On the win32 p

Re: How to get high precision timer in python?

2008-10-29 Thread James Mills
On Wed, Oct 29, 2008 at 4:22 PM, Tim Roberts <[EMAIL PROTECTED]> wrote: > I'm not sure you understood what he was saying. time.time() and > time.clock() can both be used for elapsed timing, but because of a fluke of > implementation, time.time() is more precise on Linux, and time.clock() is > more

Re: Improving interpreter startup speed

2008-10-29 Thread James Mills
On Wed, Oct 29, 2008 at 9:43 PM, Lie <[EMAIL PROTECTED]> wrote: > On Oct 27, 2:36 pm, Paul Rubin wrote: >> It's not optimal but it is very common (CGI for example). > > CGI? When you're talking about CGI, network traffic is simply the > biggest bottleneck, not something l

Re: Regarding shared memory

2008-10-30 Thread James Mills
rt, ssl=opts.ssl) while telnet.connected: try: manager.flush() stdin.poll() telnet.poll() except KeyboardInterrupt: break telnet.close() ### ### Entry Point ### if __name__ == "__main__": main() Client output: $ ./telnet.py localhost 8000 Trying localhost... Connected to localhost test test Data: [1, 2, 3, 4] Circuits can be downloaded from: http://trac.softcircuit.com.au/circuits/ cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Web crawler on python

2008-10-30 Thread James Mills
rcuit.com.au/index.wsgi/projects/pymills/file/edc08c87ecb7/examples/spider.py cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread James Mills
or b to be optional, then you must give it a default value. def foo(a, b=None, c=None): print a print b print c Note, that c must also be a default argument as you cannot have a non-default argument following a default argument. A more useful approach is this common pattern: def foo(*args, **kwargs): ... What you have discovered is not a bug :) cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread James Mills
On Fri, Oct 31, 2008 at 9:18 AM, John Krukoff <[EMAIL PROTECTED]> wrote: > Are you sure? It looks like his complaint isn't that it doesn't work, > but that the error message is misleading. > > With the setup: > > Python 2.5.2 (r252:60911, Sep 22 2008, 12:08:38) > [GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on

Re: Exec and Scope

2008-10-30 Thread James Mills
Manu, Good lord man, what are you trying to solve ? Describe your "actual problem" you're attempting to solve... This looks really really ugly and I would advise against any solution that relies on exec() --JamesMills On Fri, Oct 31, 2008 at 1:47 PM, Emanuele D'Arrigo <[EMAIL PROTECTED]> wrote:

Re: PEP 249 - DB API question

2008-11-04 Thread James Mills
On Wed, Nov 5, 2008 at 3:52 AM, k3xji <[EMAIL PROTECTED]> wrote: > As development goes on for a server project, it turns out that I am > using the MySQLDB and DB interactions excessively. One questions is > just bothering me, why don't we have a timeout for queries in PEP 249 > (DB API)? Because n

Re: PEP 249 - DB API question

2008-11-04 Thread James Mills
On Wed, Nov 5, 2008 at 6:13 AM, k3xji <[EMAIL PROTECTED]> wrote: > >> Try spawning a new process to run your query >> in. Use the multiprocessing library. Your main >> application can then just poll the db/query processes >> to see if they're a) finished and b) have a result >> >> Your application

XMPP xmpppy - User Authorization

2008-11-04 Thread James Mills
Hi all, Can anyone shed any light on how I might be able to react to "User Authorization Requests" from other users on an XMPP server/network using teh xmlpp [1] library ? Thanks, cheers James [1] http://xmpppy.sourceforge.net/irc/ -- -- -- "Problems are solved by

Re: XMPP xmpppy - User Authorization

2008-11-04 Thread James Mills
On Wed, Nov 5, 2008 at 11:28 AM, James Mills <[EMAIL PROTECTED]> wrote: > Can anyone shed any light on how I might > be able to react to "User Authorization Requests" > from other users on an XMPP server/network > using teh xmlpp [1] library ? [SOLVED}: I fou

Red Hat 32 bit RPM for python 2.4+

2008-11-05 Thread James Prav
Hi , Could anybody please point to any available Red Hat 32 bit RPM for python 2.4 or greater version on Net. I searched a lot but could find for other flavour and not Red hat. Thanks in advance, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-05 Thread James Mills
rom http://trac.softcircuit.com.au/circuits/ or get the latest development version by using Mercurial (1): hg clone http://hg.softcircuit.com.au/projects/circuits/ cheers James [1] http://www.selenic.com/mercurial/wiki/ -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: damn street venders

2008-11-05 Thread James Mills
On Tue, Nov 4, 2008 at 12:13 AM, Aspersieman <[EMAIL PROTECTED]> wrote: > +1 +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: find an object ancestor

2008-11-05 Thread James Mills
On Mon, Nov 3, 2008 at 7:16 AM, Michel Perez <[EMAIL PROTECTED]> wrote: > HI all: > > imagine something like this: > > class father: >pass > class son( father ): >pass > > I need to know the son ancestor class how can i know this. >>> class Father(object): pass ... >>> class Son(Father): p

Re: damn street venders

2008-11-05 Thread James Mills
On Tue, Nov 4, 2008 at 7:31 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > I'm pretty sure all of the spam is automated, so your message won't get > through to anyone. It feels good to let our frustration out :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 12:57 AM, I D <[EMAIL PROTECTED]> wrote: > Thanks for your response. > But I cannot use a third party software, I need to use the exisiting API's > within python. Why ? > Even this seems to lose packets, I would really appreciate if any pointers > can be provided to improve

Re: Cisco's $100,000 Developer Contest

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 7:15 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > This seems of interest to Python developers all over the world. > Develop a Python app to run on a Cisco router and win real money! On any Cisco ISR ? Any particular product/version ? --JamesMills -- -- -- "Problems a

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 1:43 AM, Ben Sizer <[EMAIL PROTECTED]> wrote: > On Nov 6, 12:46 am, "James Mills" <[EMAIL PROTECTED]> > wrote: >> >> Try these instead: >> * UDPServer >> ->http://trac.softcircuit.com.au/circuits/br

Re: etymology of "list comprehension"?

2008-11-06 Thread James Harris
2a and 2b, and Wikipedia for comprehension (logic). -- HTH, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Can read() be non-blocking?

2008-11-06 Thread James Mills
andard Input that I use for getting input from the user. (works only on Linux though). You may be able to adapt this to suite your needs. My telnet [3] example shows how this Stdin component is used. cheers James [1] http://trac.softcircuit.com.au/circuits/browser/circuits/lib/io

why does this call to re.findall() loop forever?

2008-11-09 Thread james . kirin40
indall() it never returns. Why does this happen? This is using python 2.6. Thanks so much for any help -james s=""" http://www.sluggy.com/"; rel="nofollow">Sluggy Freelance  save this to imported RSS Comics humor daily webcomics ... saved by 983

Re: why does this call to re.findall() loop forever?

2008-11-09 Thread james . kirin40
My apologies, given that Google Groups messes up the formatting, the regexp should read regexp = re.compile("""(.*?).*?\s*(?:(.*?))?.*?(?:to ((?: ) +))*.*?.*?\s*.*?""", re.DOTALL) -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory error due to the huge/huge input file size

2008-11-10 Thread James Mills
On Tue, Nov 11, 2008 at 7:47 AM, <[EMAIL PROTECTED]> wrote: > refSeqIDsinTransPro = [] > promoterSequencesinTransPro = [] > reader2 = csv.reader(open(sys.argv[2],"rb")) > reader2_list = [] > reader2_list.extend(reader2) Without testing, this looks like you're reading the _ENTIRE_ input stream int

Re: concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread James Mills
On Tue, Nov 11, 2008 at 3:57 PM, davy zhang <[EMAIL PROTECTED]> wrote: > first here is my basic idea is every actor holds their own msg queue, > the process function will handle the message as soon as the dispatcher > object put the message in. > > This idea naturally leads me to place every actor

Re: best python unit testing framwork

2008-11-13 Thread James Harris
d. One nice by-product is that test code does not bloat-out the original source which remains unchanged. And test cases can be written before, alongside or after the code as desired. So, YMMV. -- James -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best Python GUI API?

2008-11-13 Thread James Harris
tive" under different OSs with no code changes. -- James -- http://mail.python.org/mailman/listinfo/python-list

Re: best python unit testing framwork

2008-11-15 Thread James Harris
On 15 Nov, 01:02, "Brendan Miller" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 13, 2008 at 3:54 AM, James Harris > > > > <[EMAIL PROTECTED]> wrote: > > On 11 Nov, 22:59, Brendan Miller <[EMAIL PROTECTED]> wrote: > >> What would heavy python

Re: external program crashes when run through subprocess.popen on XP

2008-11-17 Thread James Harris
ws expert though. > > Any ideas? If it helps there is some finished code at http://codewiki.wikispaces.com/tester.py which used subprocess.Popen and works well under Windows and Linux. Search for Popen to locate the specific call. Note that the code works whether the shell

Re: Using eval, or something like it...

2008-11-19 Thread James Mills
DON'T USE eval! On Thu, Nov 20, 2008 at 10:44 AM, r0g <[EMAIL PROTECTED]> wrote: > Hi There, > > I know you can use eval to dynamically generate the name of a function > you may want to call. Can it (or some equivalent method) also be used to > do the same thing for the variables of a class e.g. >

[ANN]: circuits-1.0a2 released!

2008-11-19 Thread James Mills
Hi all, I'm pleased to announce the release of circuits-1.0a2 Overview == circuits is an event-driven framework with a focus on Component Software Architectures where System Functionality is defined in Components. Components communicate with one another by propagating events throughout the s

Re: Getting fractional part from a float without using string operations

2008-11-20 Thread James Harris
post comments below existing ones rather than above them. It is more familiar on Usenet and, as a consequence, easier to read. James -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 3.0rc3

2008-11-21 Thread James Mills
On Sat, Nov 22, 2008 at 1:06 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team and the Python community, I am > happy to announce the third and last planned release candidate for Python > 3.0. Whoohoo! :) Grea

Re: ANN: Shed Skin 0.1, an experimental (restricted-)Python-to-C++ Compiler

2009-02-23 Thread James Matthews
Nice! I was looking for one of these for a while On Mon, Feb 23, 2009 at 1:54 PM, Mark Dufour wrote: > Hi all, > > I have recently released version 0.1 of Shed Skin, an experimental > (restricted-)Python-to-C++ compiler. > > Please see my blog for more info about the release: > > http://shed-ski

Re: "import" not working?

2009-02-23 Thread Rhodri James
le it: sys.path.append("C:\\DataFileTypes") IMHO, Python is somewhat inconsistent in not producing a compile-type error (or at least an annoying compile-time warning) when presented with invalid escape sequences. What it does, even though it's well-documented and usually the right gu

Re: more on unescaping escapes

2009-02-23 Thread Rhodri James
Files\test" "\P" isn't a valid escape sequence, so it doesn't get replaced. "\t" represents a tab, so it does. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: more on unescaping escapes

2009-02-23 Thread Rhodri James
On Tue, 24 Feb 2009 00:26:29 -, bvdp wrote: So, in this case I'm assuming that the interpreter is converting the escapes on assignment. The compiler converts the escapes on creating its internal representation of the string, before assignment ever gets involved. -- Rhodri

Re: Python AppStore / Marketplace

2009-02-23 Thread Rhodri James
ill) speak English (of a kind). A souq is a bazaar :-) Well, close enough anyway. It's another arabic word that translates as "market" in both the mercantile and financial senses, I believe. Maybe I've just read too much arabic-themed fiction, but I was surprised not to find

Re: thanks very much indeed for your help is there a better way to do this (python3) newby

2009-02-23 Thread Rhodri James
what you write in the rest of the code. In this case you call your input string "items", but then say "Join all the strings in *stringList*..." -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

how to conditionally add a dict in-line

2009-02-23 Thread Wes James
I have this line: navs.append(A(' '+str(i+1)+' ',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query or ''}))) How do I do something like this: vars={'_page':i, if request.vars._query not None then insert this key/value pair ('_query':request.vars._query) else insert

Re: how to conditionally add a dict in-line

2009-02-23 Thread Wes James
On Mon, Feb 23, 2009 at 9:35 PM, Wes James wrote: > I have this line: > > navs.append(A(' '+str(i+1)+' > ',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query > or ''}))) > > How do I do somethi

Re: how to conditionally add a dict in-line

2009-02-23 Thread Wes James
Steven. Thx (see my question below...) On Mon, Feb 23, 2009 at 9:47 PM, Steven D'Aprano wrote: > On Mon, 23 Feb 2009 21:35:38 -0700, Wes James wrote: > >> I have this line: >> >> navs.append(A(' '+str(i+1)+' >> ',_href=self.action(arg

Re: more on unescaping escapes

2009-02-24 Thread Rhodri James
d be done with it. Of course I still need to use \x20 for spaces, but that is easy. Erm, no. "\x20" is exactly the same as " " in a string literal. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix Change Passwd Python CGI

2009-02-24 Thread James Matthews
IMHO That sounds like the biggest security hole I can think of. Anyways you can open a pipe to passwd. to have the change there password. James On Tue, Feb 24, 2009 at 5:19 PM, Derek Tracy wrote: > I am using python version 2.5.1 and need to create a python cgi application > to allow a u

Re: pep 8 constants

2009-02-25 Thread Rhodri James
d out this wasn't already the case - I would have sweared it was. It is. Aahz added it a few weeks ago. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-26 Thread Rhodri James
. It should be trivial to calculate all the different new trees that are one digit longer than a previous tree. Trivial yes, but the number of different new trees is large when you're dealing with four digits, and ridiculous with 5. -- Rhodri James *-* Wildebeeste Herder to the Masses --

Re: What functions, other than sleep(), can be interrupted by Ctrl-C?

2009-02-27 Thread James Matthews
You can hook the it on the main thread and just pass it. And let the threads execute. On Thu, Feb 26, 2009 at 10:47 PM, Gabriel Genellina wrote: > En Thu, 26 Feb 2009 16:17:42 -0200, Maxim Khitrov > escribió: > > > I'm looking for a function in the standard library or pywin32 package >> that wi

Re: why cannot assign to function call

2009-02-27 Thread Rhodri James
unc(foo)# bar is new name for foo With true pass-by-value, this comment is not true. Bar would be a copy of foo, not a new name. What happens to bar is then not reflected in foo (depending on how deep the copy is), which is the objective of pass-by-value. -- Rhodri James

Re: what does this mean....?

2009-02-27 Thread Rhodri James
your code to make sense of it would have helped. Without context, my best guess is that "localFileName" isn't actually a string. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: updates to Python-by-example

2009-02-28 Thread James Matthews
Thanks for adding this. I needed to show someone some examples... On Fri, Feb 27, 2009 at 5:35 PM, steven.oldner wrote: > On Feb 27, 8:40 am, [email protected] wrote: > > Rainy, > > > > Great stuff! Thanks for your examples with the community!! > > > > Regards, > > Malcolm > > Let me add my than

Re: What's so wrong about execfile?

2009-02-28 Thread James Matthews
It is considered one of the big holes in PHP (Remote file include...) However in Python things can be done securely On Sat, Feb 28, 2009 at 7:15 AM, Carl Banks wrote: > On Feb 27, 7:21 pm, Sammo wrote: > > Given that execfile has been removed in py3k, I want to understand > > exactly why. > > >

Re: Email Program

2009-03-02 Thread James Matthews
You can look at Digsby for an example of an email program. On Mon, Mar 2, 2009 at 8:34 PM, Mike Driscoll wrote: > On Feb 28, 7:56 pm, J wrote: > > Is it possible to make a GUI email program in Python that stores > > emails, composes, ect? Also, could I create my own programming > > language in

Re: Email Program

2009-03-02 Thread James Matthews
There is always the issue of packaging at the end but Python is your programming language. On Mon, Mar 2, 2009 at 10:19 PM, Wayne Cannon wrote: > The Twisted package (http://twistedmatrix.com/) has some examples of > interacting with e-mail servers. Twisted supports interaction between > as

Re: Upgrade Python on a Mac

2009-03-02 Thread Wes James
On Mon, Mar 2, 2009 at 2:53 PM, Rey Bango wrote: > Hi, > > I'd like to upgrade the installed version of Python that came standard > on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot > in it, I just wanted to get a better understanding of the process. I'd recommend you put your

Re: Looking for a General Method to Configure Tkinter Widgets

2009-03-03 Thread Rhodri James
lly wise, and I'm failing. If you absolutely must prat around with indirections like this, wouldn't s = getattr(dialog, variable_containing_the_string_stopV).get() be a much less unsafe idea? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie - pass variable to cscript

2009-03-03 Thread Rhodri James
T /msg:hello ' + vBS) Your problem is that vBS has a space in it, so the Windows command interpreter is interpreting it as two separate arguments, r"C:\Program" and r"Files\nasa\nmail.vbs". Gabriel has already posted two solutions (which I won't repeat), but he forg

Re: Question about binary file reading

2009-03-04 Thread Rhodri James
x(ord(b)) Does that look more like what you were expecting? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about binary file reading

2009-03-04 Thread Rhodri James
On Wed, 04 Mar 2009 23:28:32 -, Tino Wildenhain wrote: Rhodri James wrote: On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80

Re: help understanding class or function

2009-03-05 Thread Rhodri James
n it depends on what your function is supposed to be doing. If it's changing every element of the list, doing the changes in-place should be a doddle. If it's filtering some elements out (like your example of omitting every other element) then it's much easier to build a new lis

Re: create boolean

2009-03-06 Thread Rhodri James
= (n is not None) and (n != []) The second comparison isn't actually necessary, since an empty list is True and a non-empty one False. b = (n is not None) and n Putting the comparison in does make the code slightly less "magic", though, so it's not a bad idea to

Re: create boolean

2009-03-08 Thread Rhodri James
On Sat, 07 Mar 2009 05:03:08 -, Grant Edwards wrote: On 2009-03-07, Rhodri James wrote: On Fri, 06 Mar 2009 15:34:08 -, Grant Edwards wrote: On 2009-03-06, Fencer wrote: Hi, I need a boolean b to be true if the variable n is not None and not an empty list, otherwise b should

Re: Ban Xah Lee

2009-03-09 Thread William James
Haines Brown wrote: > If we have studied a field obsessively for some > years, it is natural that we end in a position where our knowledge will > generally be superior. But this does not make us superior. What does make us superior? Are you so dishonest or insane as to assert that everyone is eq

Re: A Dangling Tk Entry

2009-03-09 Thread Rhodri James
g to prove anything. Now if you were to show us a line like "something = dialog.body(something_else)" then you might be onto something, but personally I suspect you're going to find that rather hard. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: A Dangling Tk Entry

2009-03-10 Thread Rhodri James
On Tue, 10 Mar 2009 12:41:07 -, W. eWatson wrote: [snippety snip] Rhodri James wrote: > You're misunderstanding. The line that you arrowed above has absolutely > nothing whatsoever to do with the method "body()", so keeping on showing > us ever full

Re: Behaviour of os.rename()

2009-03-11 Thread Rhodri James
ending "\\?\" Tim's point was that you should read the MS documentation. To be fair it doesn't mention doing a copy and (failing to) delete instead of moving the file when doing cross-volume renames, but that's what the OS will have to do. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to NASA at Python? :(

2009-03-12 Thread James Matthews
>From what I see most startups are jumping to Python to rapidly setup their prototypes. On Thu, Mar 12, 2009 at 10:38 AM, Mikael Olofsson wrote: > [email protected] wrote: > >> In fact, graphics were added for several organizations. I believe they >> will >> be chosen randomly. NASA is still ther

Re: A Dangling Tk Entry

2009-03-13 Thread Rhodri James
entry.insert(0,self.slowdown) <--- no affect. Erm, no. You stated (and showed us the code) that it was entry = Entry(master,...).grid(...) *big* difference, and entry.insert(0, self.slowdown) *raises an exception*, which is a long way from having no effect. -- Rhodri James *-* Wildebe

Re: Special keyword argument lambda syntax

2009-03-13 Thread Rhodri James
would add confusion rather than remove it. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Special keyword argument lambda syntax

2009-03-14 Thread Rhodri James
On Fri, 13 Mar 2009 16:39:16 -, Scott David Daniels wrote: The original proposal was initially appealing to me until I saw this comment. That means a relatively "invisible typo" would turn into good syntax. Possibley this is exactly what Rhodri James is talking about, but

Re: Special keyword argument lambda syntax

2009-03-14 Thread Rhodri James
On Fri, 13 Mar 2009 15:33:26 -, MRAB wrote: Rhodri James wrote: On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky wrote: Specification = Allow keyword arguments in function call to take this form: NAME ( ARGUMENTS ) = EXPRESSION which is equivallent to the

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
ht, Gary's assumption of less understanding rather than more is clearly the safer one to take. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 15:05:04 -, Matthew Woodcraft wrote: "Rhodri James" writes: On Sun, 15 Mar 2009 13:26:17 -, Matthew Woodcraft It seems clear to me that Maxim understood all this when he asked his original question (you need to understand this subtlety to know why

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread Rhodri James
'd much rather fix the locale system and extend the format syntax to override the default locale. Perhaps something like financial = Locale(group_sep=",", grouping=[3]) print("my number is {0:10n:financial}".format(1234567)) It's hard to think of a way of exten

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
stance" there :-) Actually what I want is for the attribute to be stored where I told it, which could well be in the class. If the attribute is specified as "self.attribute", then yes, put it in the instance. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 19:00:43 -, MRAB wrote: Rhodri James wrote: [snip] Frankly, I'd much rather fix the locale system and extend the format syntax to override the default locale. Perhaps something like financial = Locale(group_sep=",", grouping=[3]) print(&

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 23:26:04 -, Aaron Brady wrote: On Mar 15, 1:50 pm, "Rhodri James" wrote: On Sun, 15 Mar 2009 17:55:25 -, Aaron Brady   wrote: > On Mar 15, 12:39 pm, John Posner wrote: >> (My apologies if the thread has already covered this.) I believe I

Re: VMware and pywin32 error...

2009-03-16 Thread James Matthews
The issue seems to be with your windows installation. Try getting another copy etc... There shouldn't be any issues I have tried and used both seamlessly On Mon, Mar 16, 2009 at 7:55 AM, dash dot <""wernermerkl\"@fujitsu(dash) siemens.com"> wrote: > Joshua Kugler schrieb: > >> dot wrote: >> >>> h

Re: PyPy Progress (and Psyco)

2009-03-16 Thread James Matthews
Everything starts out small. I am sure that things will grow if there is a demand for it... On Mon, Mar 16, 2009 at 5:55 AM, JanC wrote: > andrew cooke wrote: > > > Fuzzyman wrote: > >> On Mar 15, 3:46 pm, Gerhard Häring wrote: > > [...] > >>> Me too. I doubt it, though. From an outside view, t

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-16 Thread Rhodri James
this, but how about: print("my number is {fin.format("10d", {0}, True)}".format(1235467, fin=financial)) assuming the locale.format() method remains unchanged? That's horrible, and I'm pretty sure it can't be right, but I'm too tired to thin

Re: Style question - defining immutable class data members

2009-03-16 Thread Rhodri James
class. I blame having two hours of sleep in three days for this particular bit of dimness, sorry. P.S. Do you pronounce 'wildebeeste' like 'vildebeeste'? No, with a "w" not a "v". It's just one of those titles that stick with you no matter what y

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-16 Thread Rhodri James
local locales (!) wouldn't be so hard later on. Anyway, time I stopped hypothesising about locales and started looking at the actual code-base, methinks. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-16 Thread Rhodri James
have a fixed default so that if you don't specify the locale the result is predictable. Shouldn't that be the global locale? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-16 Thread Rhodri James
On Tue, 17 Mar 2009 02:41:23 -, MRAB wrote: Rhodri James wrote: On Tue, 17 Mar 2009 01:47:32 -, MRAB wrote: I'm not against putting a comma in the format to indicate that grouping should be used just as a dot indicates that a decimal point should be used. The locale woul

Re: Run on Startup

2009-03-18 Thread James Matthews
You may also add it to the registry or make it a windows service. Both will startup. On Wed, Mar 18, 2009 at 8:09 AM, Gabriel Genellina wrote: > En Tue, 17 Mar 2009 00:16:53 -0200, MRAB > escribió: > >> Ian Mallett wrote: >> >>> I'd like to make a program that automatically runs on startup (rig

Re: How complex is complex?

2009-03-18 Thread Rhodri James
do it at least as efficiently? If not, there's no point in being clever, do it the readable way. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

<    21   22   23   24   25   26   27   28   29   30   >