Recursive Property of Octal Numbers

2005-10-01 Thread James Stroud
py> b[0][0][0] '\xb6' py> b[0][0][0][0] '\xb6' py> b[0][0][0][0][0] '\xb6' 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

"no variable or argument declarations are necessary."

2005-10-02 Thread James A.Donald
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that means that if I misspell a variable name, my program will mysteriously fail to work with no error messag

Re: "no variable or argument declarations are necessary."

2005-10-02 Thread James A.Donald
James A. Donald: > > Surely that means that if I misspell a variable name, my program will > > mysteriously fail to work with no error message. On Sun, 02 Oct 2005 17:11:13 -0400, Jean-François Doyon > No, the error message will be pretty clear actually :) Now why, I wonder,

Re: Newbie Text Processing Question

2005-10-04 Thread James Stroud
ne): newfile.write(make_the_prelude(aline)) newfile.write(aline) newfile.write(make_the_afterlude(aline)) else: newfile.write(aline) afile.close() newfile.close() James On Tuesday 04 October 2005 20:13, Gregory Piñero wrote: > That's how Python works. You read in the whole file, edit

return struct in ctypes

2005-10-05 Thread James Hu
ckage seems very simple. and the ctypes tutorial doesn't handle these cases either.   Thanks in advance   James          -- http://mail.python.org/mailman/listinfo/python-list

ctypes questions

2005-10-06 Thread James Hu
ks in advance James -- http://mail.python.org/mailman/listinfo/python-list

PIL Image can't open png file with "I"?

2005-10-07 Thread James Hu
Hi, I have png file with mode "I", 16 bit, And I tried to open it with im=Image.open("output.png"), im.show() I got all white image. Don't why? Can Image only support 'RGB' or 'RGBA' png files? Thanks James -- http://mail.python.org/mailman/listinfo/python-list

Re: Daisy Daisy, give me your answer do

2005-10-08 Thread James Stroud
not help...unless, of course, he marks it up with "Rich Backspace Formatting" (RBF). Ideally, he would backspace once for every character. 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: Help with creating a dict from list and range

2005-10-14 Thread James Stroud
Could be even simpler since enumerate creates tuples anyway: dct = dict(x for x in enumerate(description)) James On Friday 14 October 2005 08:37, Steve Holden wrote: > >>> dct = dict((x[1], x[0]) for x in enumerate(description)) > >>> dct > > {'second'

Re: Comparing lists

2005-10-16 Thread James Dennett
her factors that might matter in given situations. And of course there will be many situations where programmer time and simplicity are more important than saving a millisecond, or even a second, and we won't waste excessive resources in optimising runtime at the expense of other factors. -- James -- http://mail.python.org/mailman/listinfo/python-list

[newbie]Is there a module for print object in a readable format?

2005-10-17 Thread James Gan
I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I tried pickled, marshel. They do different work. Is there another module which do this kind of job? Thanks! James Gan -- http://mail.python.org/mailman

make: circular dependency for Modules/signalmodule.o

2005-10-18 Thread James Buchanan
Can someone please help me make this problem go away? Thanks! James Buchanan -- http://mail.python.org/mailman/listinfo/python-list

Intersection of lists/sets -- with a catch

2005-10-18 Thread James Stroud
personal opinion that such a modification to the set type would make it vastly more flexible, if it does not already have this ability. Any thoughts on how I might accomplish either technique or any thoughts on how to make my code more straightforward would be greatly appreciated. James -- Jam

Re: [newbie]Is there a module for print object in a readable format?

2005-10-18 Thread James Gan
17 Oct 2005 11:31:46 +0200, enrico.sirola_NOSPAM wrote: > > >>>>>>>"James" == James Gan <[EMAIL PROTECTED]> writes: >> >> James> I want the object printed in a readable format. For >> >>[...] >> >>James> I tried pick

Re: [newbie]Is there a module for print object in a readable format?

2005-10-18 Thread James Gan
Yes, that's what I need! Thank you all bruno modulix wrote: > James Gan wrote: > >>I want the object printed in a readable format. For example, >>x =[a, b, c, [d e]] will be printed as: >>x--a >> |_b >> |_c >> |___d >> |_e >> >>

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread James Stroud
e types of operating systems enough and is basing conclusions on limited information...Or is a troll. The OP probably works for microsoft. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.o

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread James Stroud
for such should be explicitly described, and not left to interpretation. James On Wednesday 19 October 2005 14:31, Kenneth McDonald wrote: > Perhaps you didn't read my original post? I'm being forced to > consider Windows > for reasons beyond my control. Given that I wanted

Re: what does 0 mean in MyApp(0)

2005-10-19 Thread James Stroud
>From Google: Results 1 - 10 of about 1,340,000,000 for 0. (0.09 seconds) James On Friday 30 September 2005 07:15, Alex wrote: > I'm looking at a tutorial with the code below > > from wxPython.wx import * > > class MyApp(wxApp): > def OnInit(self): >

Re: make: circular dependency for Modules/signalmodule.o

2005-10-20 Thread James Buchanan
be because the Minix make program is less capable than gmake. gmake and other make programs can obviously handle this. Configure might have run incorrectly or both rules are one and the same on Minix, because there is no LDSHARED or signalmodule$(SO). Maybe... Still working on it, but this has

create user message for wxPython

2005-10-20 Thread James Hu
t) def OnStart(self, event): print 'got start message' Thanks a lot in advance! James -- http://mail.python.org/mailman/listinfo/python-list

Re: TK question

2005-10-20 Thread James Stroud
ing : from Tkinter import * class optWin: def __init__(self): return None def __call__(self): self.root = Tk() self.root.title("My title") self.root.mainloop() return None ow = optWin() ow() James On Thursday 20 October 2005 19

Re: TK question

2005-10-20 Thread James Stroud
uot; pass def main(): tk = Tk() optWin = optFrame(tk) tk.mainloop() if __name__ == "__main__": main() James On Thursday 20 October 2005 19:16, MBW wrote: > I have a class that is a windows in a GUI > > the following is the code: > > class optWin: > >

findwindow by its class name

2005-10-21 Thread James Hu
is windows' class name? I need to find it by win32gui.FindWindow(classname,None) and send msg from another application, but not using its title "Hello App". MyApp is not the classname, for it couldn't be found by FindWindow("MyApp",None). Thanks a lot in advance! James --

RE: [python-win32] findwindow by its class name

2005-10-21 Thread James Hu
Thanks a lot! Yes, GetHandle() can return 'wxWindowClassNR', which is nice, but all wxPython apps return wxWindowClassNR as well, so when I Post Message, it goes to itself. James -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Moore Se

Module Importing Question

2005-10-21 Thread James Stroud
thought out dependencies, but in my defense, have you seen just about anything else in this world (California Freeways, Tax Forms, A Flow-Chart of Human Metabolic Pathways, umm...whatever)? James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 L

Re: access dictionary with preferred order ?

2005-10-21 Thread James Stroud
t using items/keys etc. ? > > An example: > > a=dict(a=dict(), c=dict(), h=dict()) > prefer=['e','h', 'a'] > > for x in a.values: print x > > would give me > {h:dict()}, {a:dict()}, then the rest which I don't care about the > order

output from external commands

2005-10-23 Thread James Colannino
s = `ls`; So I guess I'm looking for something similiar to the backticks in Perl. Forgive me if I've asked something that's a bit basic for this list. Any help would be greatly appreciated :) Thanks very much in advance. James -- My blog: http://www.crazydrclaw.com/ My homepage

Re: output from external commands

2005-10-23 Thread James Colannino
le. > > Thanks. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: output from external commands

2005-10-24 Thread James Colannino
Kent Johnson wrote: >import os >files = os.listdir('.') > Thanks, that's good to know. I still need to use os.popen() for a few things, but I'll be needing filenames also, so when I try to get filenames I'll use the above. James -- My blog: http://www.

Re: Would there be support for a more general cmp/__cmp__

2005-10-24 Thread James Stroud
uot;the complex numbers are a two dimensional field"? If you mean real numbers, please do explain. 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: namespace dictionaries ok?

2005-10-24 Thread James Stroud
Here it goes with a little less overhead: py> class namespace: ... def __init__(self, adict): ... self.__dict__.update(adict) ... py> n = namespace({'bob':1, 'carol':2, 'ted':3, 'alice':4}) py> n.bob 1 py> n.ted 3 James On Monday 24 O

Re: Importing at runtime

2005-10-24 Thread James Stroud
e is how can I import the code in all of the .py > files without knowing the file names in advance. > > Can this be done ?? > > TIA -- 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: namespace dictionaries ok?

2005-10-24 Thread James Stroud
Oops. Answered before I finished reading the question. James On Monday 24 October 2005 19:53, Ron Adam wrote: > James Stroud wrote: > > Here it goes with a little less overhead: > > > > > > py> class namespace: > > ... def __init__(self, adict): &g

Top-quoting defined [was: namespace dictionaries ok?]

2005-10-25 Thread James Stroud
On Tuesday 25 October 2005 00:31, Duncan Booth wrote: > P.S. James, *please* could you avoid top-quoting Were it not for Steve Holden's providing me with a link off the list, I would have never known to what it is you are referring. I have read some relevant literature to find that this

Re: Top-quoting defined [was: namespace dictionaries ok?]

2005-10-25 Thread James Stroud
On Tuesday 25 October 2005 14:27, Mike Meyer wrote: > That's your right. Be aware that people will ignore, correct and/or > complain about you doing so. If I may be a complete ass: That should be "correct and/or complain about *your* doing so." James -- James Stroud U

simulate DoEvents by python/wxpython

2005-10-26 Thread James Hu
ALSE;     }     }     // let MFC do its idle processing     LONG lIdle = 0;     while ( OnIdle(lIdle++ ) )     ;     return TRUE;     } }     Thanks in advance, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread James Stroud
your windows machine probably wont get zombified. Or you could just do the reasonable thing and erase the hard drive and install Linux. -- 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: [python-win32] simulate DoEvents by python/wxpython

2005-10-27 Thread James Hu
Thanks a lot! -Original Message- From: Mark Hammond [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 7:16 PM To: James Hu; Python-win32@python.org; python-list@python.org Subject: RE: [python-win32] simulate DoEvents by python/wxpython Build 205 of win32gui does have

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-27 Thread James Stroud
for an_el in alist: try_something(an_el) See also <http://www.artima.com/intv/dry.html>. 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: Tkinter Frame Size

2005-10-28 Thread James Stroud
ate command that I saw to use, but made the window even > smaller... What can I do? Thanks! Here is a very simple way: from Tkinter import * app = Tk() app.geometry("%dx%d%+d%+d" % (600, 400, 0, 0)) f = Frame(app) f.pack() app.mainloop() -- James Stroud UCLA-DOE Institute for Gen

Re: Scanning a file

2005-10-28 Thread James Stroud
ount > > That's a lot of lines. This is a bit off topic, but I just can't stand > unnecessary local variables. > > print file("filename", "rb").read().count("\x00\x00\x01\x00") The "f" is not terribly unnecessary, because the part o

drag/move image from staticBitmap control?

2005-10-28 Thread James Hu
screen, just like maps.google does, is it possible to do that? Any sample code or any idea or suggestion are appreciated! Have a nice weekend!   James -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Frame Size

2005-10-28 Thread James Stroud
the frame then pack the frame in the Tk(). However do not mix grid and pack in the same frame or it will lock up your app. E.g. *dont* do this: L1 = Label(f, text="Bob & Carol & Ted & Alice") L1.grid(row=0, column=0, columnspan=2) L2 = Label(f, text="Barney&

Re: newstyle classes and __getattribute__

2005-10-28 Thread James Stroud
. return None ... else: ... return object.__getattribute__(self, key) ... py> t = T(name="test123",port=443) py> dir(t) ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__'

callback for ctypes

2005-11-01 Thread James Hu
callback implementation? Thanks, James -- http://mail.python.org/mailman/listinfo/python-list

WTF?

2005-11-01 Thread James Stroud
Why do my posts get held for suspcious headers and troll Xha Lee gets to post all sorts of profanity and ranting without any problem? -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman

Re: WTF?

2005-11-01 Thread James Stroud
On Tuesday 01 November 2005 14:26, Grant Edwards wrote: > On 2005-11-01, James Stroud <[EMAIL PROTECTED]> wrote: > > Why do my posts get held for suspcious headers ... > Held? It's not a moderated group... And I quoteth (that's King James for "cuteth-and-pastet

Re: Python's website does a great disservice to the language

2005-11-02 Thread James Stroud
the php logo looks better. For a real cool logo, check biopython.org. 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: Hexadecimal Conversion in Python

2005-11-02 Thread James Stroud
as you can, but it will take some time. You will also do well to avoid typos and grammatical errors in your communications. Also, you need to answer Fredrik's question. Let me restate it. What do you mean by ''? This encodes in hex to '2e2e2e2e'. Is this the

Re: I need Motivation

2005-11-04 Thread James Stroud
for classic macs. Very easy to program in, if you can find a quadra. -- 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: Tkinter- New Window

2005-11-04 Thread James Stroud
;t even > tried to get it to read the value of the label, but I think that it > will be a similar type problem. Any nice ways around this problem? I do > want these values only to be called when the function is called. Thanks! Looks like you are reinventing the wheel. Check out the tkMess

__new__

2005-11-05 Thread James Stroud
carol, b.__init__ should be called. However, this does not seem to be the case (see code below). What am I not understanding? Shouldn't the interpreter call b.__init__ when b is returned from carol.__new__? James py> class bob(object): ... def __init__(self): ... print self.

Re: newbie questions

2005-11-05 Thread James Stroud
work. It outputs the results and return values of commands as it goes. Try this: def printlines(): print "firstline" makeline() print "secondline" printlines() Again, idle may work more like you want. Play with it for a few hours. > Anybody help here?? thanks -xra

Re: text widget example?

2005-11-06 Thread James Stroud
n't find a good one, so here's a 5 minute version (your exercise is to put in a scroll bar). See: http://www.pythonware.com/library/tkinter/introduction/ James from Tkinter import * import tkFileDialog import tkMessageBox class MyText(Frame): def __init__(self, parent=

Re: Regular expression question -- exclude substring

2005-11-07 Thread James Stroud
7;00 noise1 01 noise2 00 target 01 target_mark 00 dowhat 01'] py> rgx = re.compile(r"(00.*?01) target_mark") py> rgx.findall('00 noise1 01 noise2 00 target 01 target_mark 00 dowhat 01') ['00 noise1 01 noise2 00 target 01', '00 dowhat 01'] My understandi

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-07 Thread James Stroud
On Monday 07 November 2005 16:56, python wrote: > > so how can i use python to debug code and change that code without having > to restart the code. look into reload() -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90

Re: Regular expression question -- exclude substring

2005-11-07 Thread James Stroud
On Monday 07 November 2005 17:31, Kent Johnson wrote: > James Stroud wrote: > > On Monday 07 November 2005 16:18, [EMAIL PROTECTED] wrote: > >>Ya, for some reason your non-greedy "?" doesn't seem to be taking. > >>This works: > >> > &g

overloading *something

2005-11-07 Thread James Stroud
, how about the "**something" operator? 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: overloading *something

2005-11-07 Thread James Stroud
On Monday 07 November 2005 20:21, Robert Kern wrote: > James Stroud wrote: > > Hello All, > > > > How does one make an arbitrary class (e.g. class myclass(object)) behave > > like a list in method calls with the "*something" operator? What I mean > >

Re: overloading *something

2005-11-07 Thread James Stroud
On Monday 07 November 2005 20:36, Alex Martelli wrote: > > > I've looked at getitem, getslice, and iter. What is it if not one of > > > these? > > Obviously James hadn't looked at __iter__ in the RIGHT way! I was attempting to re-define iter of a subclassed list

Regular Expressions and Dividing Strings

2005-11-08 Thread James Colannino
o separate variables. Thanks in advance :) James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated militia being necessary to the security of a free state, THE RIGHT of the people to keep and bear arms SHALL NOT BE INFRINGED." --Unite

Re: Regular Expressions and Dividing Strings

2005-11-08 Thread James Colannino
Christoph Haas wrote: >You probably mean: > >a="root:root" >b,c = a.split(":") > >b and c contain both sides of the colon. > > Thanks. That's exactly what I was looking for. james -- My blog: http://www.crazydrclaw.com/ My homepage: http:

Re: overloading *something

2005-11-08 Thread James Stroud
On Monday 07 November 2005 20:36, Alex Martelli wrote: > Ron Adam <[EMAIL PROTECTED]> wrote: > > James Stroud wrote: > > > Hello All, > > > > > > How does one make an arbitrary class (e.g. class myclass(object)) > > > behave like a list in method

Re: PYTHON LOOSING FOR JAVA???????

2005-11-09 Thread James Colannino
Bill Mill wrote: >+1 QOTW > > My ignorance shows here. What does that mean? :-P James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "If Carpenters made houses the way programmers design programs, the first woodpecker to come along would

Re: overloading *something

2005-11-09 Thread James Stroud
On Tuesday 08 November 2005 22:54, Robert Kern wrote: > James Stroud wrote: > > Does anyone else find the following annoying: > > > > py> from UserDict import UserDict > > py> aud = UserDict({"a":1, "b":2}) > > py> def doit(**kwargs):

Re: append to non-existing list

2005-11-09 Thread James Stroud
On Wednesday 09 November 2005 07:00, Yves Glodt wrote: > > I will never mention any p-language except python in this list anymore... +1 QOTW -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.pyth

tiff tags

2005-11-10 Thread James Hu
=(4, '\x00\x00\n\x00')   But there are more: how can I write the following tags?   296=(1,) 266=(1,) 339=(1,) 282=((1073741824, 1073741824),) 283=((1073741824, 1073741824),) 284=(1,) 305=(2, ...) 269=(2, …) 274=(3, '\x01\x00') 277=(3, '\x01\x00')   Than

Re: Python as a HTTP Client

2005-11-10 Thread James Tanis
ould just let me connect using an URL, send a few GETs, > and receive the answer as a string/file etc. > > Does this exist, and where can I read about it? > > /David > > -- > http://mail.python.org/mailman/listinfo/python-list > -- James Tanis [EMAIL PROTECTED] http://pycoder.org -- http://mail.python.org/mailman/listinfo/python-list

RE: IE Temporary Internet Files & Python

2005-11-10 Thread James Hu
Maybe the reason is ..\Content.IE5\index.dat can't be deleted! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of rtilley Sent: Thursday, November 10, 2005 11:03 AM To: python-list@python.org Subject: Re: IE Temporary Internet Files & Python Laszlo Zsolt N

Python music interfaces

2005-11-10 Thread James Harris
can use Python with Tk for the display part but there seems to be a plethora/cornucopia of Python music interfaces. (For example, <http://wiki.python.org/moin/PythonInMusic>.) I'd appreciate if you could recommend which would be good for me to look at in order to do the above. --

Stopping Execution

2005-11-10 Thread James Colannino
The reason I ask is that I need to conditionally end a script I'm writing at various places. Thanks in advance. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated militia being necessary to the security of a free state, THE RIGHT o

Re: Stopping Execution

2005-11-10 Thread James Colannino
Fredrik Lundh wrote: > the usual way: > >sys.exit() # or "raise SystemExit" >[...] > Ah, thank you. I wasn't aware that I'd have to import a module to have that ability. I'm still very new, so I have a lot to get used to :-P James -- My blog:

Internal Variables

2005-11-11 Thread James Colannino
t the python interpreter that I'm running. Thanks in advance. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated militia being necessary to the security of a free state, THE RIGHT of the people to keep and bear arms SHALL NOT BE

os.chown()

2005-11-11 Thread James Colannino
change ownership based on the name instead of the number? Perhaps there's a function that will let me lookup the uid from the username, and the gid from the groupname? Thanks :) James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated

Re: os.chown()

2005-11-11 Thread James Colannino
Mike Meyer wrote: >You want pwd.getpwnam and grp.getgrnam. > > Thanks. Hope my newbie questions haven't gotten on anybody's nerves yet ;) James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated militia being necess

weird problem with os.chmod

2005-11-11 Thread James Colannino
384 (which results in the funky permissions.) If I could figure out how Python was converting 0600 to 384, I could try to emulate that behavior in my script. Any input would be greatly appreciated. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A

Re: weird problem with os.chmod

2005-11-11 Thread James Colannino
James Colannino wrote: >So then I entered the command print 0600, and saw that the >actual number being output was 384 (why would it output 384?!) > > Ok, so further research revealed that 0600 is actually the octal representation for 384 (which makes sense.) So then, I guess

Re: weird problem with os.chmod

2005-11-11 Thread James Colannino
James Colannino wrote: >Ok, so further research revealed that 0600 is actually the octal >representation for 384 (which makes sense.) So then, I guess my >question would have to be, is there a way for me to make Python aware >that the 0600 I'm passing to int() is octal and no

911, need drvmcdb.sys desperately

2005-11-12 Thread James Hu
cated in c:\windows\system32\drivers\drvmcdb.sys Please send it to [EMAIL PROTECTED], coz I couldn't use this account from tomorrow I will appreciate your BIG HELP so much! You are my life saver! Regards, James -- http://mail.python.org/mailman/listinfo/python-list

need drvmcdb.sys

2005-11-13 Thread james HU
Anybody has this file in ..\system32\drivers\drvmcdb.sys in your computer? please send it to me. You will save my life! thanks a lot!   James Yahoo! FareChase - Search multiple travel sites in one click. -- http://mail.python.org/mailman/listinfo/python-list

Re: new in programing

2005-12-09 Thread James Stroud
, depth, lim, todo, inc, *args + (first,)) else: do_something(*args) do_deeply(first=1, depth=6, lim=8, todo=do_something, inc=1) James -- http://mail.python.org/mailman/listinfo/python-list

Re: new in programing

2005-12-09 Thread James Stroud
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > >>Python iterates over "things" (objects), of which integer numbers are >>just one possible choice. The range built-in command produces ranges of >>integers which are useful for tasks such as

Re: newby question: Splitting a string - separator

2005-12-09 Thread James Stroud
est goes like this: py> data = "Guido van Rossum Tim Peters Thomas Liesner" py> names = [n for n in data.split() if n] py> names ['Guido', 'van', 'Rossum', 'Tim', 'Peters', 'Thomas', 'Liesner'] I think it is theoretically faster (and more pythonic) than using regexes. James -- http://mail.python.org/mailman/listinfo/python-list

Make a generator from a recursive function

2005-12-09 Thread James Stroud
"cheating" would be to generate the list and make an iterable from it. Note: this is not the same as "cross" from the "N-uples from list of lists" thread. James -- http://mail.python.org/mailman/listinfo/python-list

Re: puzzled about class attribute resolution and mangling

2005-12-09 Thread James Stroud
t, > > Brian vdB > > This is name mangling at work. Mangling turns self.__v in the Derrived class's __init__ method to self._Derrived__v and self.__v in the Base class's __init__ method to self._Base__v. These are different names bound to different values and are reflected as such. self.u is the same name in both cases and the value was bound in the Derrived class, and not re-bound in the Base class. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Make a generator from a recursive function

2005-12-09 Thread James Stroud
Alex Martelli wrote: > James Stroud <[EMAIL PROTECTED]> wrote: >... > >>This was my answer to the thread "new in programing": >> >>def do_something(*args): >> print args >> >>def do_deeply(first, depth, lim, doit=True, *args)

Re: newby question: Splitting a string - separator

2005-12-09 Thread James Stroud
Kent Johnson wrote: > James Stroud wrote: > >> The one I like best goes like this: >> >> py> data = "Guido van Rossum Tim Peters Thomas Liesner" >> py> names = [n for n in data.split() if n] >> py> names >> ['Guido', &#x

Re: newby question: Splitting a string - separator

2005-12-09 Thread James Stroud
Steven D'Aprano wrote: > On Fri, 09 Dec 2005 18:02:02 -0800, James Stroud wrote: > > >>Thomas Liesner wrote: >> >>>Hi all, >>> >>>i am having a textfile which contains a single string with names. >>>I want to split this string in

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread James Stroud
and gIvEnThAtwEiNcLuDEsOmEhElPfUlfORmaTtInGInOuRcOdEFroMtImEtOtiME. So I think that being fearful of new additions to the language (read "more ability for expression") is mainly fear of abuse by poor programmers--and that is akin to being afraid of the dark. James -- James S

Re: a new Perl/Python a day

2005-01-09 Thread James Stroud
at? It certainly isn't Perl. Very dry humor indeed! bob = [1,2,3,4] carol = [bob,bob] # not inane dereferencing print carol[1][3] $bob = [1,2,3,4] ; $carol = [ $bob, $bob ] ; # inane dereferencing print "$carol->[1][3]\n" ; -- James Stroud, Ph.D. UCLA-DOE Institute

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread James Stroud
Don't fight it, lite it! You should parse the fasta and put it into a database: http://www.sqlite.org/index.html Then index by name and it will be superfast. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-17 Thread James Keasley
o ascertain a >1% false positive count, from a dataset of nearly 17,000 addresses. With cleaner and more up to date data I would expect the results to be noticably better. [1] It is still my main language, I don't use python enough to think in it as easily as I think in perl ;) - -- Jam

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread James Stroud
Martin v. Löwi said > Hmm. Most applications don't have any crypto needs. Any program where one stores data would have crypto needs. Here are some examples: Database, wordprocessor, spreadsheet, address book, mail program, (should I go on?). What would be the alternative to encryption to satisfy

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread James Stroud
lsely reason that "if I don't need it, the user doesn't", which is up there with "if I can't see them, then they can't see me" in terms of bad logic. James On Mon, 2005-01-24 at 17:17, James Stroud wrote: > I was purposefully making an illogical statement

ModPython: passing variables between handlers?

2005-02-03 Thread Andrew James
uring the life of the request *from anywhere in my application* and which gets cleaned up for me automatically afterwards. Does something like this exist in mod_python? If the approach above isn't possible, what would your recommendations be for a solution to this issue? Many thanks

Re: Python-list Digest, Vol 17, Issue 54

2005-02-03 Thread Andrew James
exist in mod_python? If the approach above isn't possible, what would your recommendations be for a solution to this issue? Many thanks for your time, Andrew James Subject: Re: ModPython: passing variables between ha

Extensions on Linux: import without underscore?

2005-06-18 Thread James Carroll
Hi, I'm creating an extension called _bright.so on linux. I can import it with import _bright, but how can I import bright and get the package? On windows, I've been able to import bright instead of import _bright, but on Linux it seems to need the underscore. I'm tempted to create a bright.py w

Re: Extensions on Linux: import without underscore?

2005-06-18 Thread James Carroll
Thanks Robert. > > Call it bright.so . > If I rename it bright.so, then I get the error: ImportError: dynamic module does not define init function (initbright) I'm using swig with the module declaration %module bright I've looked at some other source, and it looks like there are some good

Re: Extensions on Linux: import without underscore?

2005-06-20 Thread James Carroll
Swig actually was generating a bright.py file, but scons was leaving it in the source directory instead of putting it next to my SharedLibrary(). Once I moved the bright.py next to the _bright.so, it all worked with just import bright. Thanks everyone. My next trick is to try the same thing with

Tuple Unpacking in raise

2005-06-20 Thread James Stroud
py> e = MyErr(sometup) py> print e Error with 1-2 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

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