Re: pain

2005-09-01 Thread James Stroud
ere's a throw away project that could be > a test for the new language or framework. If you want to try a > new/different language, you need to show the benefit other than "it's > cool/new". A manager insisting on java is probably only thinking about na

Function returns a function

2005-09-06 Thread James Stroud
of deprecation (really not trying to start a lambda pro/con thread here). Any ideas on how to do this with a regular function, or is the way I've done it the pythonic choice? James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http:/

Re: Function returns a function

2005-09-06 Thread James Stroud
Thank you Paul, this makes much more sense. James On Tuesday 06 September 2005 02:16 pm, Paul Rubin wrote: >     def FunctionMaker(avar, func, label): >        def callback(): >           avar.set(label) >           func() >        return callback -- James Stroud UCLA-DO

Re: Ode to python

2005-09-07 Thread James Stroud
ps we see a spark of inspiration: > Abolish all globals, and all mutinous variables. > Embed precious methods in organized crucibles. -- 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: encryption with python

2005-09-07 Thread James Stroud
;t be traced back to the > originals. > > It would be great if there exists a library already written to do this, > and if there is, can somebody please point me to it?? > > Thanks in advance, > J -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Ange

Re: encryption with python

2005-09-07 Thread James Stroud
et a really big class. If your class might grow to several million, consider taking more bits of the hash. Also, as long as you remember the function, you can get back the student ID from the birthday and SS, in case they drop out and re-enroll next year. James -- James Stroud UCLA-DOE Insti

Re: encryption with python

2005-09-07 Thread James Stroud
n birthday-SS#-ID triplet. If you lied, they repeat until they verify your algorithm. This has historically been a very successful attack. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.or

Re: Question about consistency in python language

2005-09-08 Thread James Stroud
his does not work? > > >>h = {}.update(l) > > and instead I have to go: > >>h = {} > >>h.update(l) > > to initialize a dictionary with the given list of pairs? > > when an analagous operation on strings works fine: > >>s = "".join

Re: OOP Newb

2005-09-09 Thread James Stroud
t figure out how to use oop for anything. Does > anyone know where I can find out how to write an object (or anything > else!) in python, or can anyone explain it to me? -- 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: encryption with python

2005-09-10 Thread James Stroud
y perfect security. I hereby place this algorithm in the public domain. Use it freely. 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: encryption with python

2005-09-10 Thread James Stroud
considerations of the OP's original query: import sha def encrypt(x,y, password): def _dosha(v): return sha.new(str(v)+str(password)).hexdigest() return int(_dosha(_dosha(x)+_dosha(y))[5:13],16) So now what is the criticism? That its still a "secret algorithm" bec

Re: encryption with python

2005-09-10 Thread James Stroud
is a little beyond me. 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

p2exe using wine/cxoffice

2005-09-13 Thread James Stroud
quot;C:\Python23\lib\site-packages\py2exe\build_exe.py", line 768, in find_dependend_dlls alldlls, warnings = bin_depends(loadpath, images, dll_excludes) File "C:\Python23\lib\site-packages\py2exe\build_exe.py", line 1086, in bin_depends for result in py2exe_util.depends(im

Re: p2exe using wine/cxoffice

2005-09-15 Thread James Stroud
to make my software available to windoze users--despite their unfortunate ignorance, they are people too. That's what I always say. On Thursday 15 September 2005 00:59, Tim Roberts wrote: > James Stroud <[EMAIL PROTECTED]> wrote: > >My department has switched from vmware to wine/cxof

Re: My First Python Script

2005-09-15 Thread James Stroud
; > mySet = '0' + str(x) > > else: > > mySet = x > > print mySet > > x +=1 > > ZeroThrough255() > > > The file is also attached. -- 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: Best Encryption for Python Client/Server

2005-09-19 Thread James Stroud
ate > network/connection between several scripts on different machines, to > communicate instructions/data/files etc. to each other over the net. Is SSL > the best method? Any recommendations of something to get started with? > Thanks in advance. -- James Stroud UCLA-DOE Institute for Genomics

Re: p2exe using wine/cxoffice

2005-09-19 Thread James Stroud
On Saturday 17 September 2005 10:29, Tim Roberts wrote: > James Stroud <[EMAIL PROTECTED]> wrote: > >I think the motivation is to ween people off of M$ products altogether, > > Well, CrossOver Office doesn't really do that. You're still running > Microsoft Offi

Re: Getting tired with py2exe

2005-09-20 Thread James Stroud
ler That's one short "indefinitely": Not Found The requested URL /pyinstaller was not found on this server. Apache/2.0.53 (Fedora) Server at pyinstaller.hpcf.upr.edu Port 80 James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http:/

Re: Object default value

2005-09-20 Thread James Stroud
ue as the > default attribute, so that you can write > > set rng=range(...); > x=rng > y=rng.value > 'x==y > z=rng.attributeXYZ -- 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: Object default value

2005-09-20 Thread James Stroud
d to call vary=myobj.y. Something like that exists for > com objects/VB, for instance an excel range object uses value as the > default attribute, so that you can write > > set rng=range(...); > x=rng > y=rng.value > 'x==y > z=rng.attributeXYZ -- James Stroud UCLA-DOE Ins

Re: Object default value

2005-09-21 Thread James Stroud
elif (anattr == 'old'): try: return self[-2] except IndexError: raise NameError, "No old value yet" else: list.__getattr__(self, anattr) def __iter__(self): return list.__iter__(self[::-1]) def __int__(self): ret

Access function defaults

2005-02-15 Thread James Stroud
Hello all, I'm curious--How do I access a function defaults by name? for example def bob(wife, wives=[]):   # add wife to wives if applicable   if (can_add_wife(wife,wives)):     wives.append(wife)   return len(wives) Say the bob function is adding to wives. What if you want to see what th

Re: Alternative to standard C "for"

2005-02-17 Thread James Stroud
On Sat, 2005-02-05 at 10:49, BJörn Lindqvist wrote: > > I am quite new to Python, and have a straight & simple question. > > In C, there is for (init; cond; advance). We all know that. > > In Python there are two ways to loop over i=A..B (numerical.): > > 1) i = A > >while i > ...do somet

Re: intersection of 2 list of pairs

2005-02-20 Thread James Stroud
Set() > for e in E1: > S1.add((e[0],e[1])) > S1.add((e[1],e[0])) > for e in E2: > S2.add((e[0],e[1])) > S2.add((e[1],e[0])) > S= S1 & S2 > SS=Set() > done=Set() > > for

Re: NOOB coding help....

2005-02-21 Thread James Stroud
) > print 'The Mean average is:', mean > print 'The Median is:', meadian > print 'The Mode is:', mode > > I am attempting to make it so that I can save the mean, meadian, and mode > and then if the user wants the data to give it to him. Thank you for any > assistance you can provide! > > Wade -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: TKinter

2005-02-27 Thread James Stroud
I thought the T was silent. On Sunday 27 February 2005 08:34 am, anthonyberet wrote: > So, is it pronounced 'Tee-Kinter', or 'Tee-Kay-Inter'? > I don't want to appear as a dork down the pub. -- http://mail.python.org/mailman/listinfo/python-list

Scoping issue with import

2005-02-28 Thread James Stroud
Say I have a module, we'll call it "my_imported_mod". It contains a function in it that calls another function, "myfun". The "myfun" function is in the module "my_main_mod", that imports "my_imported_mod". The code of "my_main_mod" might look like this: == from my_imported_mod import

Re: Regular Expressions: large amount of or's

2005-03-01 Thread James Stroud
sing the re module is the right solution here, any > suggestions on alternative solutions or data structures which could > be used to solve the problem? > > André -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: How would you program this?

2005-03-02 Thread James Stroud
like there will be more than one solution (if I remember my 8th grade algebra--its beginning to get very foggy). Given a proper set of linear equations, I think numarray and scientific python have very convenient tools for this. An introductory linear algebra book can provide everything you need t

Re: Need direction to kill a virus

2005-03-02 Thread James Stroud
of the header reveals a file name: 'details.txt > .pif' (Spaces shove the extension 'pif' out into the peripheral > vision and the eye's focus is supposed to mistake 'txt' for the extension). > The other legible words are: Window

Re: py2exe

2005-03-03 Thread James Stroud
Python and am going through > "How to think like a computer scientist". I've also downloaded py2exe > and I don't really know how to use it. For one what is the disutil? > thanks for the help yall. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box

Re: Multiline regex help

2005-03-03 Thread James Stroud
of the output -- I'll deal with that > later; "RelevantInfo" shortened to "Info" for readability): > > Info1[0], Info[1],Info[2] > ... Info3[0]Info2[Info1[0],Info3[0]]Info2[Info1[1],Info3[1]]... > Info3[1]Info2[Info1[0],Info3[1]]... > Info3[2]Info2[Info1[0],Info3[2]]... > ... > > I don't really care if it's a list, dictionary, array etc. > > Thanks again for your help. The multiline option in the re module is very > useful. > > Take care. > > -- > Clarke's Conclusion: > Never let your sense of morals interfere with doing the right thing. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiline regex help

2005-03-03 Thread James Stroud
I found the original paper for Martel: http://www.dalkescientific.com/Martel/ipc9/ On Thursday 03 March 2005 12:26 pm, James Stroud wrote: > Have a look at "martel", part of biopython. The world of bioinformatics is > filled with files with structure like this. > > http://

Re: Suspicious header

2005-03-04 Thread James Stroud
01:56 pm, phil wrote: > everything I post to this list bounces awaiting moderator > approval, due to suspicious header. > COuld someone tell me what's wrong. I'm on lots of list > with no problem. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics

Re: using python to parse md5sum list

2005-03-05 Thread James Stroud
red across a lan of 4 windows computers. > > I've dabbled with different languages over the years and i think > python is a good language for this but i have had a lot of trouble > sifting through manual and tutorials finding out with commands i need > and their syntax. > > Can so

Re: running a C program with python script

2005-03-08 Thread James Stroud
script > > thanks > m.smadi -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: running programs from within python

2005-03-09 Thread James Stroud
;> > >> NameError: global name 'os' is not defined > >> > >> however i dont get the same error when running from the python CLI. > >> (and yes i am importing the os module) > > > > Can you give the full exception message (i.e. copy-paste i

Re: An Odd Little Script

2005-03-09 Thread James Stroud
TECTED] > NovaSys Health > Little Rock, Arkansas > > "We are the music makers, and we are the dreamers of dreams." W.W. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: FW: list reduction

2005-03-10 Thread James Stroud
think I need to use filter and lambda but > > i've looked in the documentation > > and I haven't been able to figure out > > how to use it. > > > > Apologies if this is a bad question. > > > > Thanks -- Jame

Iterate using tuple as index

2005-03-10 Thread James Stroud
like this: for list1_item, list2_item in (some_kind_of_expression): do_something(list1_item, list2_item) Practically, I'm not so sure B is better than A, but the second would be a little more aesthetic, to me, at least. Any thoughts on what "some_kind_of_expression" would be? J

Re: Iterate using tuple as index

2005-03-10 Thread James Stroud
Thank you everyone for pointing me to "zip". Very Handy! James -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: looking up dictionaries by values

2005-03-10 Thread James Stroud
gt; 201, I need to say the key is really susan. > > Is there a way to do this that does not traverse the entire dictionary > multiple times? > > Thanks. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Installing Python 2.3.5

2005-03-11 Thread James Stroud
501 975.4859 > Computer Programmer [EMAIL PROTECTED] > NovaSys Health > Little Rock, Arkansas > > "We are the music makers, and we are the dreamers of dreams." W.W. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: novice question

2005-03-11 Thread James Stroud
oop through > > the grp dictionary and reduce the lists > > so that each only contains unique elements ? > > > > thanks -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-15 Thread James Stroud
bit ugly, but we learn to > overlook the occasional cosmetic blemishes of those we love :-) The answer is obvious, the naked comma should be an empty tuple. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-16 Thread James Stroud
ourse for backward compatability? Comma is not used for anything else in python as far as I know. This would be very unambiguous. Then, the purity would manifest itself the naked comma being an empty tuple. Think about the zen of: , James -- James Stroud, Ph.D. UCLA-DOE Institute for Genom

Re: Why tuple with one item is no tuple

2005-03-16 Thread James Stroud
ple or grit on my monitor?  :-) OK, OK, I'll give up on the commas. Maybe we should just use dollar signs :? -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create stuffit files on Linux?

2005-03-16 Thread James Stroud
t; Is there a native OS X archive or package format? > Obviously it must have tar and gzip installed, but I wonder > how a *.tgz file would appear on the desktop or how the > GUI would handle it. > > Yours, > Noah -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and P

Re: ANNOUNCE: Ice 2.0 released

2004-12-03 Thread James Stroud
> > PS: Please feel free to set FU-Ts as appropriate. > > What are FU-Ts? "It took me 3 hours to figure out FU meant 'Felix Unger'."" -- Oscar Madison, The Odd Couple MTC. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomic

Re: regex syntax

2004-12-07 Thread James Stroud
n ".jpg" vorkommt > oder nicht und dann eine Entscheidung treffen. Ich hab mir schon > überlegt einfach die letzten viel Stellen des strings "per Hand" auf die > Zeichenfolge zu vergleichen und so regex zu umgehen. Aber ich muss es > irgendwann ja doch mal nutzen ;-) >

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

2004-12-07 Thread James Stroud
ith an answer sometimes. As far as lists go, this is my favorite, and I've subscribed to lists in a variety of fields. I'm afraid that scaring off newbies would remove some of the charm of this list. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics 611 Charles E. Youn

Re: [Newby] question about modules

2004-12-10 Thread James Stroud
> > As far as I can tell from the online docs, "capwords" should be defined in > the built-in "regex" module. Why is it telling me that capwords is not > defined? -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics 611 Charles E. Young Dr. S. MBI

Re: lies about OOP

2004-12-13 Thread James Stroud
ood as > procedural apps, and you'd get the benefit of code reuse if you do it > properly. Code reuse now consists of cutting and pasting followed by > enough modification that I wonder if it was worth it to cut and paste > in the first place. > > Thanks. -- James Stroud, Ph.D. UCLA-D

Re: do you master list comprehensions?

2004-12-13 Thread James Stroud
7;, 'your', 'holy', 'grail'] > > puts all the words in a list, like I want. > > How to do this with [lc] instead of for-loops? > > I tried funnies like [[w for w in L] for L in data], > that is correct syntax, but you'd never guess. > > I

Re: Python mascot proposal

2004-12-13 Thread James Stroud
nted > thought process but maintain clear, symbolic imagery, I'd love to see > more suggestions or renditions! -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics 611 Charles E. Young Dr. S. MBI 205, UCLA 951570 Los Angeles CA 90095-1570 http://www.jamesstroud.com/ -- ht

Re: Organising data within a program

2004-12-13 Thread James Stroud
) > and am wondering about the best way of organising the data within the > program. > > >From my understanding I would have something like person1 > > =("name","address","phone","subs-due") > Then you would putmembershipdatabase

Why no list heritable type?

2004-12-16 Thread James Stroud
pythonic reason I am missing here? James -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics 611 Charles E. Young Dr. S. MBI 205, UCLA 951570 Los Angeles CA 90095-1570 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no list heritable type?

2004-12-16 Thread James Stroud
Steve Holden wrote: > I think the thing you are really missing is the fact that list and the > other built-in types can be used as the basis for inheritance: I've never seen this done in any manual that I can remember. Its so useful, that I thought I would have run into it before as an example

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

2004-12-20 Thread James Stroud
James On Sunday 19 December 2004 06:39 pm, Peter Hansen wrote: > As one uninterested so far in .NET, and not concerned primarily > with speed, and concerned definitely with maturity and stability, > and not in the least interested in static typing, I thank you > for saving me the time

Re: Tuple Question

2004-12-21 Thread James Stroud
> t[0] > > Traceback (most recent call last): >File "", line 1, in ? >File "", line 3, in __getitem__ > TypeError: descriptor '__getitem__' requires a 'tuple' object but > received a 'int' > > Thanks, > > VL -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics 611 Charles E. Young Dr. S. MBI 205, UCLA 951570 Los Angeles CA 90095-1570 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple Question

2004-12-21 Thread James Stroud
def __getitem__(self, name): > ... return tuple.__getitem__(self, name) > ... > > >>> data = (1,2,3,4,5) > >>> t = MyTuple(data) > >>> t[0] > > Traceback (most recent call last): >File "", line 1, in ? > File ""

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread James Stroud
int ":" Now, what happened to the whitespace idea here? This code seems very unpythonic. I think : is great for slices and lamda where things go on one line, but to require it to specify the start of a block of code seems a little perlish. -- James Stroud, Ph.D. UCLA-DOE Institute f

wxPython Install

2005-03-26 Thread James Stroud
solutions I could dream of created more problems. If I can't install an operating system then put wxPython on it without jumping through hoops, my probelm will be wxPython. Thank you in advance to the kind person who offers a reliable solution. James -- James Stroud UCLA-DOE Institute

Re: The Greatest News Ever!

2005-03-26 Thread James Stroud
On Saturday 26 March 2005 01:55 pm, Dennis Lee Bieber wrote: > On Sat, 26 Mar 2005 17:02:56 + (UTC), R.Meijer > > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > Now, what I don't understand is what this is doing in a python newsgroup? > > The same thing it was doing

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread James Stroud
On Saturday 26 March 2005 02:52 pm, Mike Meyer wrote: > Because newlines are optional statement terminators. Yes; I have accidentally found that ; can be used also as an optional statement terminator--when rewriting some perl code. James -- http://mail.python.org/mailman/listinfo/python-list

String Splitter Brain Teaser

2005-03-27 Thread James Stroud
sensus consecutives = 0 # keeps track of how many in a row for achar in astr: if (achar == "/"): consecutives = 0 continue else: consecutives += 1 if (consecutives > 1): consensus.append(possibilities) possibilities = [achar] else: possibilities.appe

Re: String Splitter Brain Teaser

2005-03-27 Thread James Stroud
(srciter.next()) >   ...         else: >   ...             stack.append([i]) >   ...     return stack Very pretty: group("AGC/C/TGA/T") [['A'], ['G'], ['C', 'C', 'T'], ['G'], ['A', 'T']] -- James Stroud, Ph.D. UCLA-DOE Instit

Re: how to add a string to the beginning of a large binary file?

2005-03-27 Thread James Stroud
On Sunday 27 March 2005 07:56 pm, could ildg wrote: > I want to add a string such as "I love you" to the beginning of a binary > file, How to? and how to delete the string if I want to get the original > file? There are many ways. Define large. -- James Stroud, Ph.D. UCL

Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread James Stroud
ctions), but I'm not too good with classes yet. I've > written some really small programs just for kicks (most involve > statistics of different situations using random numbers). > > I'd like to get to the next level, but I'm not sure how. Are there any > suggestion

Re: Who Knows of a Good Computational Physics Textbook?

2005-03-29 Thread James Stroud
book "Python Scripting for > Computational Science" by Hans P. Langtangen . > > Searching "computational physics" at Amazon returns some relevant > books. -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.j

Re: instance vs class attributes

2005-03-29 Thread James Stroud
f.a = an_a ... >>> abob = bob() >>> abob.get_a() 2 >>> abob.a 2 >>> abob.set_a(14) >>> abob.a 14 >>> abob.get_a() 14 >>> class carol: ... self.a = 22 ... Traceback (most recent call last): File "", line 1, in ? File &quo

Re: instance vs class attributes

2005-03-29 Thread James Stroud
On Tuesday 29 March 2005 05:37 pm, James Stroud wrote: > > 1) What are the benefits of using a member variable without the 'self' > >    qualifier? (I think this is because you can use _x without an > >    instance of A().) > > No such thing as a benefit here. sel

Re: instance vs class attributes

2005-03-29 Thread James Stroud
ge, > and secondly it's not working on my computer... > > pan -- James Stroud, Ph.D. 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: Pseudocode in the wikipedia

2005-04-01 Thread James Stroud
TED] > > > The free wikipedia is adopting a standard pseudocode: > > http://en.wikipedia.org/wiki/Wikipedia_talk:Wikicode/Specification -- James Stroud, Ph.D. 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: Finding attributes in a list

2005-04-02 Thread James Stroud
__init__(self, azip): for azip in alist: self.data.append(Player(atup)) James -- James Stroud, Ph.D. 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: Finding attributes in a list

2005-04-02 Thread James Stroud
On Saturday 02 April 2005 09:51 pm, James Stroud wrote: > where team could be initialized by a tuple: > >   class Team(list): >     def __init__(self, azip): >       for azip in alist: >         self.data.append(Player(atup)) Sorry, this should read: where team could be initia

Re: Help me dig my way out of nested scoping

2005-04-03 Thread James Stroud
finally, call the third party function and return its result > return F(AW, BW) > > # end code - > > OK, here's my problem: How do I best store and change lastX, A(lastX) > and B(lastX) in FW's scope? This seems like it should be easy,

Re: Gnuplot.py and, _by far_, the weirdest thing I've ever seen on my computer

2005-04-04 Thread James Stroud
tmpHMTkpL' notitle > > (and it makes the graph image just fine) > > I mean what the hell is going on? My permissions on /tmp are wide open > (drwxrwxrwt). It does the same thing when I run as root. And it > _always_ works when I use the interpreter or interactive python. > > Any clues would be greatly appreciated. I'm baffled. -- James Stroud, Ph.D. 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: Best editor

2005-04-06 Thread James Stroud
On Tuesday 05 April 2005 11:22 am, ChinStrap wrote: > I keep hearing everyone say Emacs, but I can't understand it at all. Both emacs and vi suffer from the fact that they can not be used by ordinary humans. Thus, I recommend using either to impress your friends. James -- http://mail.python.org

Re: singleton objects with decorators

2005-04-12 Thread James Stroud
quot;why make every thing so fancy?" I call this pattern: "Using a Class to Be Something Single Because It Already Is Single" or "uactbssbiais", for short. James -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http

Re: Rookie Question: Passing a nested list into a function?

2005-04-14 Thread James Stroud
r(textfilelist[0][1], textfilelist[1][1], textfilelist[0][0]) > > > -- > I don't if there is a "legal" way to do this, but I would appreciate some > guidance. > > Thanks, > > Brett -- James Stroud, Ph.D. 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: question about functions

2005-04-14 Thread James Stroud
t;the first argument: $_[0]\n"; > print "the second argument: $_[1]\n"; } > > In other words, can I call the arguments from a list? -- James Stroud, Ph.D. 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: question about functions

2005-04-14 Thread James Stroud
> print "the second argument: $_[1]\n"; } > > In other words, can I call the arguments from a list? -- James Stroud, Ph.D. 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: pre-PEP: Suite-Based Keywords

2005-04-15 Thread James Stroud
27; > statement is calculating an argument to 'f'. Also, it requires a binding > that serves no purpose other than to hold an argument to 'f', yet this > binding persists for the rest of the surrounding function. > > Here is the same code using suite-based keyword arguments > > f(): > if a: > x = 1 > else: > x = 2 > > When reading this code, it is easy to skip over everything that is > involved in calling 'f', if one so desires. Since the suite has its own > namespace, one does not have to worry that the suite creates some bindings > that will be important later in the function. -- James Stroud, Ph.D. 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

2005-04-19 Thread James Stroud
or tell websites for that > purpose. -- 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

Array of Chars to String

2005-04-19 Thread James Stroud
new string every time. I am thinking that something like this has to be a function somewhere already or that I can make it more efficient using a built-in tool. Any ideas? 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: Why Python does *SLICING* the way it does??

2005-04-20 Thread James Stroud
times this topic has graced this list. >>> i = 4 >>> str = "asdfjkl;" >>> print str[:i]+str[i:] asdfjkl; 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: Why Python does *SLICING* the way it does??

2005-04-20 Thread James Stroud
I like this, it works for any integer. >>> str="asdfjkl;" >>> i=-400 >>> print str[:i]+str[i:] asdfjkl; >>> i = 65534214 >>> print str[:i]+str[i:] asdfjkl; Please forgive my reassigning str. I am one of those type first think later program

Re: New line

2005-04-21 Thread James Stroud
st line? > > Thanks in advance > > -- > > "It's all in fun or life isn't worth it!" -- 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: Regular Expressions - Python vs Perl

2005-04-21 Thread James Stroud
icular code library he was using. > > All in all, execution speed for any one particular task is a sucky way to > evaluate a general purpose programming language. If gonzo RegEx query > performance was of utmost importance, would anyone put either of Perl or > Python at the top of h

Re: Handling lists

2005-04-23 Thread James Stroud
i would like to represent > them as a range in the list with max and min val of the range alone. > I shd get something like > list = [[10,14],[78,81],[300,308]] Here is an interesting way: >>> a = iter([1,2,3,4]) >>> [(b,a.next()) for b in a] [(1, 2), (3, 4)] Jame

Re: Variables

2005-04-23 Thread James Stroud
e him that foo is indeed a variable. > > Thanks all! > > Richard B. -- 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: Rudeness on this list [Re: rudeness was: Python licence again]

2005-04-24 Thread James Stroud
On Sunday 24 April 2005 06:59 am, so sayeth François Pinard: > As seen from here, the Python mailing list quality has been degrading > significantly for the last half-year or so. That's funny. That's exactly as long as I've been on this list. I wonder if the correlation

Re: Variables

2005-04-24 Thread James Stroud
cication issue. You guys probably need a relationship couselor or something. I think you should both agree on a common vocabulary and use that. Usually the "bigger" individual makes the most concessions in these areas, but then the "bigger" individual is usually meant for gr

Re: Multiple tuples for one for statement

2005-04-24 Thread James Stroud
for a,b,c in zip(tup1, tup2, tup3): print a print b print c -- 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 documentation moronicities (continued)

2005-04-25 Thread James Stroud
the Dairy Queen in Dalhart, Texas. 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: key binding with mac

2005-04-25 Thread James Stroud
pm, so sayeth Eric Texier: > I am just starting to use python on the mac. > How do I get backspace, the arrows up/down and all the control like > ctrl-a to work nicely under the console. > for now I am getting a bunch of ^? ^[[A when I use any tcsh type of > control. > thanks, -- J

tkinter text width

2005-04-26 Thread James Stroud
rward way. Any ideas? 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: How remove directories with the content in the platform independent way?

2005-04-26 Thread James Stroud
gt; > Thx, A. -- 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 text width

2005-04-27 Thread James Stroud
tting text dynamically and so I rely on the width. I am not after the built in "wrap" option, it does not do what I want. But, say if wrap were turned on, it would be good to know how many characters the Text would wrap at. James -- James Stroud UCLA-DOE Institute for Genomics

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