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
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:/
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
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
;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
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
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
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
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
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
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
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
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
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
;
> 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
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
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
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:/
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
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
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
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
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
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
)
> 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
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
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
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
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
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
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
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
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://
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
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
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
;>
> >> 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
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
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
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
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
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
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
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
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
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
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
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
> > 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
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 ;-)
>
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
>
> 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
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
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
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
)
> 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
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
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
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
> 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
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 ""
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
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
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
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
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
(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
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
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
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
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
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
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
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
__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
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
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,
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
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
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
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
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
> 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
101 - 200 of 1138 matches
Mail list logo