Re: Looking for help with Regular Expression

2006-05-23 Thread James Stroud
[(\d*?)\]\[(\w)\]\]''', > '''[\1][\2]]''', data) > > There's got to be a better way but I'm not sure what it is. I do: Pyparsing. from pyparsing import * crossref = Suppress("[") + Word(alphanums, exact=1) + Suppress("]") footnote = (

Re: Using a package like PyInstaller

2006-05-27 Thread James Stroud
LittlePython wrote: > Is it possible when using packages like PyInstaller to create an .exe for > distribution that parts of the package can bleed out and be left on a system > when the .exe is executed? > > Thx > > Look at innosetup. -- James Stroud UCLA-DOE Insti

Re: Using a package like PyInstaller

2006-05-27 Thread James Stroud
--icon $pbydir/../icons/passerby.ico \ $pbydir/passerby.py passerby/passerby.spec $pythonexe Build.py passerby/passerby.spec You can control installation with innosetup. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 9009

Re: Using a package like PyInstaller

2006-05-27 Thread James Stroud
similar to just about every other application out there for windows. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheat sheet

2007-12-27 Thread James Matthews
Looks good thanks! On Dec 27, 2007 11:06 PM, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Riccardo T. wrote: > > I wrote a little cheat sheet for this wonderful language, but because of > > my still little experience with it, I would like to have a feedback > > Could you have a look at it and

Re: "Impure" Python modules

2007-12-27 Thread James Matthews
I don't quite understand what the word "impure" means here! On Dec 27, 2007 10:53 PM, <[EMAIL PROTECTED]> wrote: > Hi, > > Is there some way to get a list of "impure" Python modules/extensions > from PyPI? I know the mySQL module is a good example, but I am > working on creating some decent inst

Re: Cheat sheet

2007-12-28 Thread c james
Riccardo T. wrote: > I wrote a little cheat sheet for this wonderful language, but because of > my still little experience with it, I would like to have a feedback > Could you have a look at it and tell me what do you think about, please? > > http://greyfox.imente.org/index.php?id=73 > > -- > Gre

Re: What's the limit of variables size in pyhton?

2007-12-31 Thread James Matthews
However some Debuggers will not show you variable's that are too big! On Dec 31, 2007 7:38 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 31 Dec 2007 15:40:31 -0200, هنداوى <[EMAIL PROTECTED]> > escribi�: > > > Python allow you to only take care about variable name and ignore it's > >

Re: Python for web...

2007-12-31 Thread James Matthews
The issue is finding a host with mod_python installed for cheap! On Dec 31, 2007 7:57 AM, David Van Mosselbeen < [EMAIL PROTECTED]> wrote: > on Tue, 25 Dec 2007 20:42:03 -0800 (PST), [EMAIL PROTECTED] < > [EMAIL PROTECTED]> wrote: > > > > Hi everyone, > > > > I have to develop a web based enterpr

Re: ElementTree should parse string and file in teh same way

2007-12-31 Thread James Matthews
When dealing with files you pass it an object! So make your string an object and then it should work! On Dec 31, 2007 8:17 AM, Paddy <[EMAIL PROTECTED]> wrote: > On Dec 31, 3:42 am, "Peter Pei" <[EMAIL PROTECTED]> wrote: > > One bad design about elementtree is that it has different ways parsing a

Re: Killing worker threads

2008-01-06 Thread James Matthews
You can use the stop method! On Jan 6, 2008 2:04 PM, tarun <[EMAIL PROTECTED]> wrote: > Hello All, > > Can anyone help me with a simple code through which the main thread can > kill the worker thread it started. > > Thanks & Regards, > Tarun Devnani > > -- > http://mail.python.org/mailman/listinf

Python In VS

2008-01-06 Thread James Matthews
Dear List I would like to know is it possible to use VS (Visual Studio) as a python IDE! It's a great IDE for C# and i would like to be able to use it for python also! Thanks James -- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http://www.goldwatche

Re: Python's great, in a word

2008-01-07 Thread James Matthews
Just Another Vague Acronym = (Java) On Jan 7, 2008 10:32 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > > The best thing about Python is ___. > > The best thing about Python is its elegance. > > -- > \"Like the creators of sitcoms or junk food or package to

Re: Python's great, in a word

2008-01-08 Thread James Matthews
We have such nice names so the word Python will be something people like and not something people fear (A massive 12 foot snake) and Pythonic is a behavior pattern we should all follow! In layman's terms it means we should all act like snakes a little more! On Jan 8, 2008 5:13 PM, Carl Banks <[EMA

Re: Peer To Peer File Sharing...

2008-01-08 Thread James Matthews
Look at the old source code of the Bittorrent client for ideas! On Jan 8, 2008 8:51 PM, Dom Rout <[EMAIL PROTECTED]> wrote: > Hello. > Well, this is my first post on any USENET group anywhere, so I hope I > get it right. Basically, I just want to get some opinions on a plan of > mine for a new pr

Re: HOW TO HANDLE POINTERS FROM NON-LOCAL HEAPS??

2008-01-11 Thread James Matthews
Ahh it's good to know that you "love" pointers like everyone else! On Jan 11, 2008 9:30 AM, Gary Herron <[EMAIL PROTECTED]> wrote: > abhishek wrote: > > Hi group any idea on HOW TO HANDLE POINTERS FROM NON-LOCAL HEAPS?? > > > > > > Thank you > > > POINTERS? Heaps? Huh? Ummm, let me think --

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-13 Thread James Matthews
When did this list become a politics dialog? Please keep on topic "Python"! Thanks James On Jan 12, 2008 8:07 PM, Joe Riopel <[EMAIL PROTECTED]> wrote: > On Jan 12, 2008 2:00 PM, radiosrfun <[EMAIL PROTECTED]> wrote: > > Whether we agree on "tactics" or n

Re: isgenerator(...) - anywhere to be found?

2008-01-22 Thread james . pye
On Jan 22, 6:20 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > For a simple greenlet/tasklet/microthreading experiment I found myself in > the need to ask the question > > isgenerator(v) > > but didn't find any implementation in the usual suspects - builtins or > inspect. types.GeneratorType

Re: question

2008-01-22 Thread James Matthews
Since you aren't familyer with classes i will keep this within the scope of functions... If you have code like this def a(): def b(): a+=1 Then you can only call function b when you are within function a James On Jan 22, 2008 8:58 PM, <[EMAIL PROTECTED]> wrote: > I&#x

Re: translating Python to Assembler

2008-01-22 Thread James Matthews
The reason you were finding a Python Debugger when looking for the PDB files is because PDB is Python DeBugger! Also why would you be looking for a PDB file if you can read the C source! On Jan 22, 2008 11:55 PM, Wim Vander Schelden <[EMAIL PROTECTED]> wrote: > Python modules and scripts are norma

Re: Stripping whitespace

2008-01-23 Thread James Matthews
Using the split method is the easiest! On 23 Jan 2008 19:04:38 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 10:50:02 -0800, ryan k wrote: > > > Hello. I have a string like 'LNAME > > PASTA ZONE'. I want to create a list of those words and > > basical

Re: help using python on Vista

2008-01-30 Thread James Matthews
You need to go into folder options which is in the control panel and there under the view tab click Show hidden files and folders On Jan 30, 2008 9:36 AM, Safe Alattar <[EMAIL PROTECTED]> wrote: > I have no issues using python on XP. However on Vista I cant get the > python gui (IDLE) to open! >

Re: Does anyone else use this little idiom?

2008-02-02 Thread James Matthews
What i do is a simple range call. for i in range(number of times i want to repeat something) I guess it comes from my C days for(i=0;i<100;i++) { or in python for i in range(99): On Feb 3, 2008 3:34 AM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED]

Re: Does anyone else use this little idiom?

2008-02-03 Thread James Matthews
Because 0 is counted therefore i only have to do it 99 times Thanks On Feb 3, 2008 4:38 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Sun, 03 Feb 2008 01:03:43 -0200, James Matthews <[EMAIL PROTECTED]> > escribió: > > Sorry to be nitpicking, but people coming

Re: Python GUI toolkit

2008-02-03 Thread James Matthews
Just a side question! Does QT support Events from multiple threads without any special calls! Example when i use WX i have to call wx.CallAfter() Thanks! On Feb 3, 2008 6:05 PM, Jorge Godoy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > what i meant was, i tried gtk, didnt like it

Re: Why not a Python compiler?

2008-02-05 Thread James Matthews
You can also compile parts of Python to speed them up! On Feb 5, 2008 9:37 AM, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On Feb 5, 9:19 am, Santiago Romero <[EMAIL PROTECTED]> wrote: > > ( Surely if this question has been asked for a zillion of times... ) > > Sure. You can access comp.lang.pyth

Re: a trick with lists ?

2008-02-07 Thread James Turk
> the guy who coded this did not write it as "self.tasks = tasks"? What is the > use of the "[:]" trick ? if you do a = [1,2,3] b = [] b = a then assign: b[1] = 9 now a[1] == 9 as well with a[:] = b you are actually getting a copy of the list rather than an alias it's

keyword 'in' not returning a bool?

2008-02-08 Thread c james
Try this >>> sample = {'t':True, 'f':False} >>> 't' in sample True >>> type('t' in sample) >>> 't' in sample == True False Why is this? Now try >>> bool('t' in sample) == True True Can someone explain what is going on? -- http://mail.python.org/mailman/listinfo/python-list

Re: Useful site for beginners

2008-02-10 Thread James Matthews
If you don't mind me recommending that you include links to python documentation and show new users how they can read the docs and see the info! James On Feb 10, 2008 9:30 PM, subeen <[EMAIL PROTECTED]> wrote: > This website can be helpful for Python newbies: > http://love-py

Re: Displaying Unicode Chars

2008-02-10 Thread James Matthews
Why don't you use ord? 2008/2/10 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > I want to make a little Python utility where a user can enter the > unicode numerical code and get the actual symbol back in utf-8. > > For example, a user could enter something like u221E > > And get back ∞ > > Now, this d

Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
.append((s_name, regrouped)) iterprint(serieses) for s in serieses: yield s Now, what is consuming my "regrouped" generator when going from inside the loop to outside? Thanks in advance for any clue. py> print version 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Co

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Paul Rubin wrote: > James Stroud <[EMAIL PROTECTED]> writes: >> I defined a little debugging function called iterprint: >> >> def iterprint(thing): ... >>for x in thing: >> iterprint(x) > > of course this mutates the thing that is bein

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Paul Rubin wrote: > James Stroud <[EMAIL PROTECTED]> writes: >> I defined a little debugging function called iterprint: >> >> def iterprint(thing): ... >>for x in thing: >> iterprint(x) > > of course this mutates the thing that is bein

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Paul Rubin wrote: > James Stroud <[EMAIL PROTECTED]> writes: >> I can see I didn't explain so well. This one must be a bug if my code >> looks good to you. > > I didn't spot any obvious errors, but I didn't look closely enough > to say that the code lo

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Peter Otten wrote: > groupby() is "all you can eat", but "no doggy bag". Thank you for your clear explanation--a satisfying conclusion to nine hours of head scratching. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
selector=_selector, keyfunc=_keyfunc, series_keyfunc=_series_keyfunc): keyed = izip(imap(keyer, table), table) filtered = ifilter(selector, keyed) serialized = groupby(filtered, series_keyfunc) return dekeyed(serialized, keyfunc) Thank

Re: win32com.client question

2008-02-13 Thread James Matthews
What do you mean possible? On Feb 13, 2008 3:05 PM, Juan_Pablo <[EMAIL PROTECTED]> wrote: > import win32com.client > is posible in linux ? > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http:/

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Steve Holden wrote: > James Stroud wrote: >> [...] I then append the growing list of series generator >> into the "serieses" list ("serieses" is plural for series if your >> vocablulary isn't that big). >> > Not as big as your ego, apparent

Re: Big time WTF with generators - bug?

2008-02-13 Thread James Stroud
Steve Holden wrote: > James Stroud wrote: >> [...] I then append the growing list of series generator >> into the "serieses" list ("serieses" is plural for series if your >> vocablulary isn't that big). >> > Not as big as your ego, apparent

Re: copying files through Python

2008-02-15 Thread James Matthews
Basically copying a file is reading a character or string from one file and writing it to the other. On Fri, Feb 15, 2008 at 3:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Feb 13, 10:50 pm, Lalit <[EMAIL PROTECTED]> wrote: > > > I need to write a program which would transfer files und

Need help to figure out urllib2.Request()

2008-02-18 Thread James Yu
l = response.read() ==> works fine Any idea ? -- This is a UTF-8 formatted mail --- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

How to overcome the incomplete download with urllib.urlretrieve ?

2008-02-18 Thread James Yu
a pile of incomplete JPG files, each takes only 413 bytes of my disk space. Did I miss something before using urllib.urlretrieve ? -- This is a UTF-8 formatted mail --- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
> Doesn't PostGres come with Export/Import apps ? That would be easiest > (and faster). Yes, PostgreSQL core has import/export apps, but they tend to target general administration rather than transactional loading/moving of data. ie, dump and restore a database or schema. There is a pgfoundry proj

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
On Feb 19, 9:23 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Yes, you can use "pg_dump production ... | psql testdb", but > this can lead to dead locks, if you call this during > a python script which is in the middle of a transaction. The python > script locks a table, so that psql can't write

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
On Feb 19, 8:06 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Any suggestions? If you don't mind trying out some beta quality software, you can try my pg_proboscis driver. It has a DBAPI2 interface, but for you to use COPY, you'll need to use the GreenTrunk interface: import postgresql.interfa

Re: Py_Finalize ERROR!

2008-02-19 Thread james . pye
On Feb 19, 12:11 am, zaley <[EMAIL PROTECTED]> wrote: > Py_Finalize ERROR! > > In my C++ program ,python is embeded . I create one win thread to run > embedded Python code . > So at the begin of thread function I call "Py_Initialize" and at the > end of thread function call "Py_Finalize" . > But af

how to write text into file in ansi encoding ?

2008-02-20 Thread James Yu
UTF-8 formatted mail --- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write text into file in ansi encoding ?

2008-02-20 Thread James Yu
e')) -- This is a UTF-8 formatted mail ------- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

RE: Globals or objects?

2008-02-21 Thread James Newton
t the relative newbie that I am can understand? Thanks in advance, James -- http://mail.python.org/mailman/listinfo/python-list

RE: Globals or objects? (is: module as singleton)

2008-02-21 Thread James Newton
Mel wrote: >> James Newton wrote: >> Could you give a bare-bones demonstration of [implementing a singleton >> by using a module]? > > I had a club-membership application that ran for several years. > Default pathnames, etc. for the particular year came from a m

Re: distutils setup - changing the location in site-packages

2008-02-21 Thread james . pye
On Feb 21, 9:33 am, imageguy <[EMAIL PROTECTED]> wrote: > I have the setup script working, however, when I run the install, it > places the module in the root of site-packages. > > The following is the deatils from the script > setup ( >   name = "mymodule", >   version = "0.1", >   description = "

RE: Globals or objects? (is: module as singleton)

2008-02-21 Thread James Newton
then rewrite the > configuration file when you call a save function... That's what I would normally do, too. Thanks for your help, James -- http://mail.python.org/mailman/listinfo/python-list

RE: Last 4 Letters of String

2008-02-21 Thread James Newton
>>> "string whose last four letters are abcd"[-4:] 'abcd' From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 21 February 2008 11:36 To: [email protected] Subject: Last 4 Letters of String Hello Guys, I

Re: psycopg2: connect copy_from and copy_to

2008-02-21 Thread james . pye
On Feb 20, 9:27 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Up to now I am happy with psycopg2. Yeah. psyco is good. > Why do you develop pg_proboscis? [Good or bad as they may be] 1. Alternate interface ("greentrunk") 2. Non-libpq implementation yields better control over the wire that a

Re: urllib slow on Leopard

2008-02-24 Thread James Matthews
Try running the script when python is running as root. I has issues like this also! On Sun, Feb 24, 2008 at 8:57 PM, mark <[EMAIL PROTECTED]> wrote: > I've recently switched from Ubuntu to OS X Leopard. I have some python > scripts which download info from the web. The scripts were working fine >

Re: Fwd: Problem with threads in python????????

2008-02-27 Thread James Matthews
Yes On Wed, Feb 27, 2008 at 3:56 AM, <[EMAIL PROTECTED]> wrote: > On Feb 26, 7:56 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Tue, 26 Feb 2008 01:46:48 -0200, Manikandan R <[EMAIL PROTECTED]> > > > escribió: > > > > > Hai, > > > > > Is it possible to share a single varia

Re: Book Recomendations

2008-03-02 Thread James Matthews
I liked Core Python Programming 2nd edition! On Sun, Mar 2, 2008 at 4:27 PM, Ken Dere <[EMAIL PROTECTED]> wrote: > Ira Solomon wrote: > > > I am an experienced programmer (40 years). I've done Algol (if you've > > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > > few other

Re: tab completion?

2008-03-04 Thread james . pye
On Mar 4, 8:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > Hi people. > I was just wondering if a tab-completion feature in python command > line interface would be helpful? > If yes, then how can I implement it? > Thanks, > Siddhant Is this what you are looking for? http://docs.python.org/lib/m

The stange behaviour of Tkinter.Canvas

2008-03-11 Thread James Yu
ig() lines to see the difference in gui's behaviours. Thanks, -- This is a UTF-8 formatted mail --- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

How to import custom python file in python server page (psp) ?

2008-03-14 Thread James Yu
;/var/www/.cyu021/.pic/index.psp", line 8, in > import Helper > > ImportError: No module named Helper *PS. I put Helper.py and index.psp in the same dir * Thanks in advance, -- This is a UTF-8 formatted mail --- James C.-C.Yu -- http://mail.python.org/mailman/listinfo/python-list

Missing PyObject definition

2008-03-17 Thread James Whetstone
fined? Thanks! James -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing PyObject definition

2008-03-17 Thread James Whetstone
ome info I found some documentation, but this doesn't //compile because the compile can't find PyObject. Also, I really know what it looks like anyways. //self->attr("handleMessage")(obj); //This boost.python call doesn't work either. //call_m

How to use boost.python to wrap a class with a pure virtual function that has a 'void *' argument

2008-03-22 Thread James Whetstone
ing? I'm writing this code using MS Visual Studio 8 and if anyone can help, it would *very* appreciated. Thanks! James -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use boost.python to wrap a class with a pure virtual function that has a 'void *' argument

2008-03-22 Thread James Whetstone
eMessage").ptr(), h); } catch (const error_already_set) { // Catch and ignore exception that is thrown if Python // onMessage raised an exception. Print it to sys.stderr, // since there is nothing we can do about it here. PyErr_Print(); } PyGILState_Release(gstate); } "

Re: why cannot assign to function call

2009-01-09 Thread Rhodri James
good luck. I will look forward to continuing to see weekly questions on this list. :-) It would help if you were using "=" on things that were conceptually the same across the languages, instead of things that only looked similar. Which is where the data model comes in, as has alre

Re: Detecting open files and forcing closure

2009-01-09 Thread Rhodri James
lement a backup strategy. If you are, I'd suggest your problem is XCOPY -- you really need something more combat capable instead. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

NorthwestPythonDay, 31 Jan 2009

2009-01-10 Thread James Thiele
Posted for Brian Dorsey Hello everyone, On behalf of the Seattle Python Interest Group, I'd like to invite you to join us for an informal day of Python talks & socializing. When: January, 31st 9am - 5pm Where: University of Washington campus, Seattle, Washington Price: Free! Details and updated

Re: why cannot assign to function call

2009-01-10 Thread Rhodri James
anomalous in comparison with other C data types. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Object help

2009-01-11 Thread James Mills
is listless IIRC. Why are you asking us ? We're Python devs/programmers not C++ cheers James PS: I wouldn't touch C++ with a 10-foot pole -- http://mail.python.org/mailman/listinfo/python-list

urllib2 - 403 that _should_ not occur.

2009-01-11 Thread James Mills
in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 403: Forbidden >>> However, that _same_ url works perfectly fine on the same machine (and same network) using any of: * curl * wget * elinks * firefox Any helpful ideas ? cheers James -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - 403 that _should_ not occur.

2009-01-11 Thread James Mills
On Mon, Jan 12, 2009 at 12:58 PM, Philip Semanchuk wrote: > > On Jan 11, 2009, at 8:59 PM, James Mills wrote: > >> Hey all, >> >> The following fails for me: >> >>>>> from urllib2 import urlopen >>>>> f = >>>>> ur

Re: urllib2 - 403 that _should_ not occur.

2009-01-11 Thread James Mills
doesn't store the http's response content anywhere - only the parsed results - *sigh*. My solution now is to parse and store the data I required in a simple object and pickle this to a set of cached files and compare this against hashed versions of the content. cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Object help

2009-01-11 Thread James Mills
rest of the world! :) cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: template inheritance

2009-01-11 Thread James Matthews
Not always sometimes you want to show some template code (You have a blog about web dev) and sometimes you want to nest some code. On Sun, Jan 11, 2009 at 10:04 PM, Diez B. Roggisch wrote: > Alex K schrieb: > >> While building a website using template inheritance one usually does >> the following

Re: hlep: a text search and rename question

2009-01-12 Thread James Stroud
= [] for line in cue: if line.strip().startswith('FILE'): break for line in cue: if line.strip().startswith('TITLE'): titles.append(line.split('"')[-2]) flacs = glob.glob('*.flac') flacs.sort(key=lambda f: int(re.search(r'\d+', f).group(0

Re: hlep: a text search and rename question

2009-01-12 Thread James Stroud
James Stroud wrote: cue = iter(open('CDImage.cue').readlines()) It just occurred to me that this could simply be: cue = open('CDImage.cue') James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jam

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
'\nset tk::Priv(x) %x\nset tk::Priv(y) %y\ntk::ListboxMotion %W [%W index @%x,%y]\n' py> b.tk.call('bind', 'Listbox', '', _) '' James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
James Stroud wrote: py> b.tk.call('bind', 'Listbox', '', _) You want b.tk.call('bind', 'Listbox', '', "") of course. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 900

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
() lb = Listbox(tk) lb.pack() tk.tk.call('bind', str(lb), '', "break") for i in range(12): lb.insert(END, str(i)) Sorry for not reading more carefully. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
James Stroud wrote: tk.tk.call('bind', str(lb), '', "break") Which is equivalent to lb.bind('', "break") But I checked and overriding the default behavior of Listbox does not work (tk.tk.call('bind', "Listbox", '

Re: Unexpected behavior with dictionary keys containment and a user-defined class

2009-01-12 Thread James Stroud
m I misunderstanding something? Well, the only conclusion is that dict uses the hash of an object to test containment while lists use id. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard IPC for Python?

2009-01-13 Thread James Mills
es can communicate via Bridge by propagating events. Example: http://trac.softcircuit.com.au/circuits/browser/examples/remotepy.py cheers James 1. http://trac.softcircuit.com.au/circuits/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard IPC for Python?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 3:40 AM, Laszlo Nagy wrote: > Can anyone tell me if select.select works under OS X? Yes it does. cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: executing multiple functions in background simultaneously

2009-01-13 Thread James Mills
(wait) on them. pydoc threading.Thread cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming friction

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 11:29 AM, killsto wrote: > I'm trying to implement a basic user controlled sliding box with > pygame. I have everything worked out, except for two things. Try the pygame mailing list :) cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: executing multiple functions in background simultaneously

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 11:35 AM, MRAB wrote: > The disadvantage of threads in Python (CPython, actually) is that > there's the GIL (Global Interpreter Lock), so you won't get any speed > advantage if the threads are mostly processor-bound. The OP didn't really say what this function does :) *sig

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 11:50 AM, Russ P. wrote: > Here's the definition on the Wikipedia page for object oriented > programming (and it does *not* sound like Python classes): > > Encapsulation conceals the functional details of a class from objects > that send messages to it. ... Encapsulation is

Re: problem calling method

2009-01-13 Thread James Mills
kwargs) ... cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 12:27 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "James Mills" writes: >> You do realize this is a model and not strictly a requirement. Quite >> a few things in Python are done merely by convention. >> Don&#x

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 12:57 PM, Terry Reedy wrote: > public = no leading underscore > private = one leading underscore > protected = two leading underscores > > Python uses encapsulation by convention rather than by enforcement. As mentioned previously this is not encapsulation, but access cont

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread Rhodri James
t to the obviousness of the "leading underscore => private" convention, and I just don't see a burning need for it, that's all. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
in the OO programming "community." Again, stop confusing terminology. Should Python get strict and enforce access control of object members ? No. Why ? I can think of several reasons. Give me one use-case where you strictly require that members of an object be private and their access

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 1:25 PM, Rhodri James wrote: > I wouldn't violently object to having some means of policing class > or module privacy, but it does have consequences. When it's a > convention, you can break it; when it isn't, you can't, even if > you do ha

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
elf): self.x = None I'll give you a hint ... It's the simpler one :) cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 1:50 PM, Carl Banks wrote: > 1. Wise people don't believe everything that is written on Wikipedia. > 2. The person who wrote that line in Python.org is a wise person. Agreed. > You know what? Computer science buzzwords mean jack squat to me. I > don't give a horse's tai

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
loped by 100 developers. No I"m sorry this is not a valid use-case. cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
ly result in 1/3 of the size in terms of LoC. I should also point out that your numbers you pulled out of your hat would require 22years of development time given the industry standard of 5 LOC/hg per developer. Good luck with that. cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
in a language such as Python and would very likely end up being much smaller and more manageable. I have a question for you: All your arguments seem to lean towards size and the importance of encapsulation. What is the largest system you have worked on - that has been written entirely in Python ?

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 4:35 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "James Mills" writes: >> Bare in mind also, that enfocing access control / policing as you >> called it has a performance hit as the machine (the Python vm) >>

Re: pep 8 constants

2009-01-13 Thread James Mills
global variable in a module that gets used in several places and is more or less used as a standard configured value - I tend to use ALL CAPS. Still I would avoid using this idiom altogether and jsut stick with default values. For Example: FOO = 1 def f(x=FOO): ... Use this instead

<    16   17   18   19   20   21   22   23   24   25   >