n1.bind("", self.button1Click)
> self.button1.bind("", self.button1Click)
>
>
> def button1Click(self, event):
> filePick = tkFileDialog.askopenfilename()
--
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
button1 = Button(self.myContainer1)
> self.button1.configure(text="...")
> self.button1.grid(row=0, column=2)
> self.button1.bind("", self.button1Click)
> self.button1.bind("", self.button1Click)
>
&g
ith this level
of cleverness. Now, if the LCBE author will go take a crap on some canvas, we
can call it art. How clever, indeed! Clever, clever, clever, clever, clever.
W.
Clever.
(And Stupid.)
Dear LCBE author, please
; couldn't. As I don't know C, I think that weave and PyInline for
> example are out of the solution.
>
> I'm using Linux.
>
> Luis
--
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
into a dict on each loop.
>
> Many thanks,
>
> rbt
Simple assignment.
adict[filename] = an_sha_hash
--
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(s) to a
> python script from the command line?
>
> Thanks,
>
> Jeff Elkins
--
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
es:
> x = x+1
> print "There are", x, "files in this directory."
> return x
>
> rbt
def count_em(valid_path):
root, dirs, files = os.walk(valid_path)
return len(files)
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Come to think of it
file_count = len(os.walk(valid_path)[2])
--
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
f for f in os.listdir('.') if os.path.isfile(f)])
On Friday 20 May 2005 08:08 pm, rbt wrote:
> James Stroud wrote:
> > def count_em(valid_path):
> > root, dirs, files = os.walk(valid_path)
> > return len(files)
>
> Here's another Tback:
> >>> Tr
x84m\x12\x98\x98\xca=o\x0b\x8e\x08O\xb7\x0b\x04SC\x9
> >6
>
> \
>
> >xc7\xab*\x0b\x996\x06\x86\x83(\x8dQ\x9eG\x8f$\xb2x)\xa9fv\x0c1B\x9b\r\xde\
> >x
>
> f
>
> > >fc\x08'
> >
> > and given that
> >
> > >I rolled my own for rel
Hello All,
I would like to get the index of the character closest to the pointer in a
Text, something like Canvas.find_closest(). I want it to bind to ''.
Does anybody know how this might be done?
Thank you,
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box
dh wrote:
> w.index("@x,y" % (event.x, event.y))
--
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
languages, they would probably just
called such thing _pure functions_. The term conveys the meaning, without the
“lamba” abstruseness.
"""
Proposing "jargon" to cure "jargon". Good job! Of course nothing will ever
rival "jargonize", the crown jewl of all &qu
;,text) &target
>
> get error : unsupported operand type(s) for &: 'str' and 'str'
>
> is it some idea that can modity it and make it work?
--
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 Tuesday 31 May 2005 01:44 pm, Jim Anderson wrote:
> Are tcl/tk still supposed to be an intergrated part of the
> python release?
>
> Do I have to download, configure, make, install tcl and tk
> packages to get tkinter running?
I had to do this. Don't forget blt.
--
J
On Friday 03 June 2005 07:17 pm, Elliot Temple wrote:
> Nothing is wrong with it in this case. I just want to know if Python
> can do what I said.
Read the python-list "working with pointers" thread from Tuesday. Good answers
were posted there.
James
--
James Stroud
UCLA-D
[EMAIL PROTECTED] wrote:
> Essay: "C++ is better than C", agree or disagree? (four word maximum)
disagree: too many pluses.
--
http://mail.python.org/mailman/listinfo/python-list
Hello All,
I'm using numpy to calculate determinants of matrices that look like
this (13x13):
[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9.
Hello,
Thank you to those who responded for your answers. They were very
helpful and I'm confident now that numpy is calculating accurate
determinants for these matrices.
But I think I need to restate my problem a little as suggested by some
becuase I'm still bewildered.
First, here is the re
Steven D'Aprano wrote:
[Valuable Response]
Thank you Steven for your helpful comments. Please see my reply to
Bjoern Schliessmann where I have restated my problem.
James
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
[pointless stuff]
OK. Nevermind. I'm rebinding encodings and so taking a sample from the
sample and thus getting the sample back. Terribly sorry.
James
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> The first post comes from Ian Bicking:
>
> http://onyourdesktop.blogspot.com/
>
"Linux was a remote possibility: just why is it so bad as a laptop OS?"
I'm a diehard os x man myself, but I spent about 1.5 days setting up
ubuntu feisty on an Acer Travel Mate TM2480-2779 ($4
Xavier Bérard wrote:
> Hello everyone,
>
> I am wondering if there is a way to use custom drawing in Tkinter.
> I've been using it for few months, and all I know about custom drawing
> is to draw directly on a Canvas with such methods as "create_line",
> "create_rectangle", etc.
>
> Now, the prob
Xavier Bérard wrote:
>>from Tkinter import Invisiblecanvas
>
>
> ?
>
> The whole web never mentions this Invisiblecanvas.
> Do you have anything alike to share ? ;)
>
> Xavier
>
I figured that if you were sincere, you'd call me on this one.
--
http://mail.python.org/mailman/listinfo/python-
Xavier Bérard wrote:
>>>Now, the problem, is that I have already plenty of widgets on my
>>>screen. I just want to draw over them, which is a bit difficult in my
>>>comprehension of things.
>>
>>What are you trying to achieve by "drawing over" widgets?
>
>
>
> Want I want to do is a sort of GUI
Terry Reedy wrote:
> In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion, implying
that python does not. Does python have fully optimized tail recursion as
des
Kay Schluehr wrote:
> On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote:
>> Terry Reedy wrote:
>>> In Python, you have a choice of recursion (normal or tail)
>> Please explain this. I remember reading on this newsgroup that an
>> advantage of rub
anush shetty wrote:
> Hi,
> I have two dictionaries
>
> dict1={'B8': set(['I8', 'H8', 'B2', 'B7', 'F8', 'C9', 'G8', 'B4',
> 'B5', 'B6', 'C8', 'E8', 'D8', 'B3', 'A9', 'A8', 'C7', 'B9', 'A7',
> 'B1']), 'B9': set(['I9', 'H9', 'A7', 'F9', 'B3', 'B6', 'G9', 'B4',
> 'B5', 'C9', 'B7', 'E9', 'B1', 'B2',
Chris wrote:
> hi guys,
>
> i would like to to write a little spider, where, occasionally, the user
> has to interact. For example show a log-in page or something similar
> (since everyone has those verification letter/number pics), or send a
> message by hand.
>
> I had the idea of the script
anush shetty wrote:
> On Jun 12, 2:10 am, James Stroud <[EMAIL PROTECTED]> wrote:
>
>>anush shetty wrote:
>>
>>>Hi,
>>>I have two dictionaries
>>
>>> dict1={'B8': set(['I8', 'H8', 'B2', 'B7
Ed Leafe wrote:
> I have a simple module that reads in values from disk when
> imported, and stores them in attributes, allowing for code like:
>
> >>> import moduleFoo
> >>> print moduleFoo.someSetting
> 'the value'
>
> What I'd like to do is have a more property-like behavior, so th
James Stroud wrote:
> # moduleFoo.py
>
> def get_setting(self, name):
> return do_whatever(name)
>
> def set_setting(self, name, arg):
> return do_whatever_else(name, arg)
>
> class Foo(object):
> someSetting = property(set_setting, get_setting)
>
Beorn wrote:
> Consider this example:
>
> >>> def funcs(x):
> ... for i in range(5):
> ... def g(): return x + i
> ... yield g
>
> I would expect the value of x used in g to be that at the function
> declaration time, as if you've pass g a (x=x) argument, especially
>
Elfine Peterson Tjio wrote:
> I'm trying to make a program that reads Fasta file and print it out. I used
> the SeqIO module and the results is:
>
> 'ATGGTCATSingleAlphabet()'
>
> For this purpose, should I use SeqIO or Fasta?
>
> for example:
>
> from Bio import SeqIO
>
> or
>
> from Bi
johnny wrote:
> Scope of ids:
> When I print "ids", it's always empty string '', as I have intialized
> before. That's not what I want. I want the ids to have
> str(r['id']).join(',')
>
> if res:
> ids = ''
> for r in res['key']:
> ids = str(r['
7stud wrote:
> On Jun 22, 3:23 pm, askel <[EMAIL PROTECTED]> wrote:
>
>>sorry, of course last line should be:
>>Dummy().method2('Hello, world!')
>
>
> ..which doesn't meet the op's requirements.
>
Which were contradictory.
--
http://mail.python.org/mailman/listinfo/python-list
John Henry wrote:
> Hi list,
>
> I have a need to create class methods on the fly. For example, if I
> do:
>
> class Dummy:
> def __init__(self):
> exec '''def method_dynamic(self):\n\treturn
> self.method_static("it's me")'''
> return
>
> def method_static(self, text):
[EMAIL PROTECTED] wrote:
> Hello AGAIN,
>
> I on working on windows and Python 2.4. Where can I find and CHANGE
> python
> grammar. ( I just want to change the keywords )
>
> PLEASE HELP ME
> SOMEBODY!!
>
> THANKS!
>
Nathan Harmston wrote:
> Hi,
>
> I m playing around with extended euclids algorithm from Knuth. I m
> trying to build a function with a function inside it.
>
> def exteuclid(m,n):
> a,a1,b,b1,c,d = 0,1,1,0,m,n
> def euclid(c,d):
>q = c /d
>r = c % d
>if r == 0:
>
James Stroud wrote:
> Nathan Harmston wrote:
> def exteuclid(m,n):
> x = 0,1,1,0,m,n
> def euclid(c,d,x=x):
>a,a1,b,b1,c,d = x
>q = c /d
>r = c % d
>if r == 0:
>print a,b
>return d
>else:
>
Harald Luessen wrote:
> Hi, I am new to python and I miss some understanding of the internals
> of some types and containers. With my C/C++ background I hope to get
> some hints to chose the best data structure for my programs. Here are
> some questions:
This depends on how you define "best". I
Daniel Nogradi wrote:
> Hi list,
>
> Well, the short question is: what are they? I've read Guido's python
> 3000 status report on
> http://www.artima.com/weblogs/viewpost.jsp?thread=208549 where he
> mentions ABC's but don't quite understand what the whole story is
> about.
>
> Anyone has good us
tring
py> class MyClass(UserString):
... def __init__(self, astr):
... self.data = self.clean(astr)
... def clean(self, astr):
... return astr.replace('m', 'f')
...
py> MyClass('mail')
'fail'
py> type(_)
This class is much slower than st
[EMAIL PROTECTED] wrote:
> On Jul 11, 9:49 pm, James Stroud <[EMAIL PROTECTED]> wrote:
>>The "flat is better than nested" philosophy suggests that clean should
>>be module level and you should initialize a MyString like such:
>>
>> m = MyString(clea
es or its subclasses make no sense because
str is immutable. You may or may not want a history (I just made up this
use case), but hopefully you see the utility in using regular classes
for complex behavior instead of forcing an immutable built in type to do
magic.
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
ish to work with "copies", in that when I pass in an
> integer variable into a function, I want the function to be modifying
> a COPY, not the reference. Is this possible?
>
> Thanks.
>
Not only is this possible, that is actually what happens with ints!
--
James Stro
ue)
... def __init__(self, v):
... self.value = v
...
py> c = C(4)
py> c
4
py> def doit(v):
... v.value = v.value * 2
...
py> doit(c)
py> c
8
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.co
Erik Max Francis wrote:
> James Stroud wrote:
>
>> Robert Dailey wrote:
>>
>>> I noticed in Python all function parameters seem to be passed by
>>> reference. This means that when I modify the value of a variable of a
>>> function, the value of
this
type of thing for working with molecular models. I'm not sure how the
code is liscensed.
--
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
Chris Carlen wrote:
> Hi:
>
> From what I've read of OOP, I don't get it. I have also found some
> articles profoundly critical of OOP.
I've also found articles critical of Darwinism--but we can chalk that up
to religious zealotry can't we?
Any gui more complicated than a few entry fields an
W. Watson wrote:
> Thanks for the tips to the posters above. Wow, the Grayson book is $98
> on Amazon. I think I'll see if I can get a library loan!
Its an ebook for $25.00: http://www.manning.com/grayson/
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box
roupby):
py> from itertools import groupby
py> alist = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6,
... 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13,
... 0xF0, 14, 0xF1, 15]
py> def doit(alist):
... i = (list(g) for k,g in groupby(alist, lambda x: 0xf0&x))
... return [k for k in [j + i
James Stroud wrote:
> Here's how I *would* do it:
>
> py> def doit(alist):
> ... ary = []
> ... for i in alist:
> ... if 0xf0 & i:
> ... ary.append([i])
> ... else:
> ... ary[-1].append(i)
> ... return [x for x in ary if x]
&
0 * t.timeit(number=10)/10)
print 'doit2'
t = Timer('doit2(alist)',
'from __main__ import groupby, doit2, alist, c')
print "%.2f usec/pass" % (100 * t.timeit(number=10)/10)
--
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
[EMAIL PROTECTED] wrote:
> On 16 juil, 21:10, Erik Jones <[EMAIL PROTECTED]> wrote:
>> On Jul 16, 2007, at 3:46 PM, [EMAIL PROTECTED] wrote:
>>
>>> Hello,
>>> How can we organize development team with code source control policy,
>>> that limit access to some portion of code ?
>> The specifics large
Arcadio
>
I don't think its wise to mask or otherwise waste cpu cycles catching
and re-throwing lower level exceptions. If you anticipate problems with
certain inputs, test for those possibilities and raise custom exceptions
at module level. At package level, you can import a modul
s property is read-only for users of the API. Have a Nice Day.
"""
def __init__(self):
self._value = None
def get_value(self):
return self._value
value = property(get_value)
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los A
ts and would likely result in the reversal of the Second Law of
Thermodynamics, wherein your refrigerator would end up heating its
contents and milk would spontaneously spoil, among other anomalies.
For these reasons, you might propose a "quit" keyword.
James
--
James Stroud
UCLA-DOE Ins
lue)
...
>>> broke = Old()
>>> broke.value
'broke'
>>> broke.value = 'still broke'
>>> broke.value
'still broke'
>>>
>>> works = New()
>>> works.value
'works'
>>> works.v
Kevin Walzer wrote:
> From the introduction to PyObjC, the Python-Objective-C bridge on Mac
> OS X:
>
> "As described in Objective-C for PyObjC users the creation of
> Objective-C objects is a two-stage process. To initialize objects, first
> call a class method to allocate the memory (typical
[EMAIL PROTECTED] wrote:
> On Apr 20, 4:37 pm, John Machin <[EMAIL PROTECTED]> wrote:
>
>>One inessential but very useful thing about tuples when you have a lot
>>of them is that they are allocated the minimum possible amount of
>>memory. OTOH lists are created with some slack so that appending et
Boris Borcic wrote:
> >>> x = (lambda : ((yield 666),(yield 777),(yield 888)))()
> >>> x.next()
> 666
> >>> x.next()
> 777
> >>> x.next()
> 888
> >>> x.next()
> (None, None, None)
> >>> x = (lambda : ((yield 666),(yield 777),(yield 888)) and None)()
> >>> x.next()
> 666
> >>> x.next()
> 777
Ray wrote:
> hi, I have a question about how to use .grid_forget (in python/TK)
>
> I need to work on grid repeatly. everytime when a button is pressed,
> the rows of grid is different. such like, first time, it generate 10
> rows of data.
> 2nd time, it maybe only 5 rows. so I need a way to RESE
[EMAIL PROTECTED] wrote:
> Hey,
>
> I am helping to develop a project that displays images based on user
> input. One possible way of implementing this is via a widget that
> when it is run, would read in the users input from an input text field
> (probably from a blog), and replace it with the H
Andy wrote:
> On 23 Apr 2007 21:12:45 -0700, [EMAIL PROTECTED] wrote:
>
>> http://www.911blogger.com/node/8053
>>
>> Senator John Kerry was questioned concerning 9/11 during an appearance
>> at Book People in Austin, Texas. Members of Austin 9/11 Truth Now
>> asked Kerry about the officially unexp
Hello,
Does anyone know of an example, however modest, of a screenscraper
authored in python? I am using Firefox.
Basically, I am answering problems via my browser and being scored for
each problem. I have a tendency to go past my peak for training
efficiency, so I would like to scrape the res
Bruno Desthuilliers wrote:
> Kevin Walzer a écrit :
> (snip)
>
>> Thanks to all for an illuminating thread on the mathematical
>> implications of "learning curve" and other aspects. This thread has
>> wandered pretty far from my original question (above)
>
>
> Noticed this too ?-)
I would ha
Alan Isaac wrote:
> Running test.py will print False.
> Is this expected/desirable?
> Thanks,
> Alan Isaac
>
>
> %%% test.py %%%
> from random import seed, getstate
> seed(217)
> x = getstate()
> from test2 import Trivial
> y = getstate()
> print x == y
>
>
> % test2.py %%
James Stroud wrote:
> Hello,
>
> Does anyone know of an example, however modest, of a screenscraper
> authored in python? I am using Firefox.
>
> Basically, I am answering problems via my browser and being scored for
> each problem. I have a tendency to go past
Hertha Steck wrote:
> Hello,
>
> Ray schrieb:
>
>> Hi, Thanks for the help.
>>
>>
>> I was trying to find a book "Python TK" something on last Friday.
>> but didn't find it :-)
>>
>
> There is only one printed book, all the details here:
>
> http://wiki.python.org/moin/GuiBooks
>
> HTH
> Herth
Peter Beattie wrote:
> I am trying to plot something in gnuplot 4.2 using co-ordinates a Python
> 2.5 program computes. Here's what I'm doing:
>
> py> from subprocess import *
> py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE)
> py> plot.stdin.write("plot x*x")
>
> The first command d
[EMAIL PROTECTED] wrote:
> Hi all. I'm learning python these days. I'm going to use this thread
> to post, from time to time, my annoyances with python.
Please start a new thread for each annoyance. Overuse of a single thread
is an annoyance to a great many people.
> I hope someone
> will clar
[EMAIL PROTECTED] wrote:
> I posted to this newsgroup earlier about my annoyances with python and
> now I can't find the post. What did you do with it?
>
I guess it depends on your server. Here at UCLA, we still see it.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Video: Professor of Physics, Phd at Cal Tech says: 911 Inside Job
>
> Cal Tech is the ELITE of ELITE in physics.
>
> If Feynman were alive, he would point his finger straight at the 911
> criminal operators, the yank bastards themselves ...
>
> http://www.911blogge
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
>
>> Hi all. I'm learning python these days. I'm going to use this thread
>> to post, from time to time, my annoyances with python. I hope someone
>> will clarify things to me where I have misunderstood them.
>>
>> Annoyances:
>> 2. There are modules,
Johny wrote:
> I use PIL to write some text to a picture.The text must be seen wery
> clearly.
> I write the text to different pictures but to the same position. As
> pictures maybe different, colour, in the position where I write the
> text, is also different.
> Is there a way how to set the f
thorstenkranz wrote:
> Hi everyone,
>
> I'm new here and I have a question ( I guess as everybody who is new
> here ;-) ),
>
> I'm having some strange problem with Matplotlib, using it in a Tkinter
> application.
>
> I create a Canvas, a figure, subplot and then a toolbar. It works
> fine, but
Rajesh wrote:
> Hi,
>
> The '-I' option adds the path to the list of directories that
> contains modules that can be included in a script. I can use it as "#!/
> usr/bin/perl -I" thereby not asking the user of
> the script to set the in their environment.
>
> Is there any equivalent command-line
Steven W. Orr wrote:
> I have two seperate modules doing factory stuff which each have the
> similar function2:
>
> In the ds101 module, def DS101CLASS(mname,data):
> cname = mname+'DS101'
> msg_class = globals()[cname]
> msg = msg_class(data)
> return msg
>
> and in the fdu modu
Steven W. Orr wrote:
> On Friday, Apr 27th 2007 at 14:07 -0700, quoth James Stroud:
>
> =>Steven W. Orr wrote:
> =>> I have two seperate modules doing factory stuff which each have the
> =>> similar function2:
> =>>
> =>> In the ds101 module, def
Beliavsky wrote:
> On Apr 27, 6:17 pm, Stef Mientki <[EMAIL PROTECTED]>
> wrote:
>
>>Portable SciPy, is an easy installer of SciPy for M$ windows users.
>
>
> If you have an announcement for Windows users, I suggest that you not
> needlessly turn them off by abbreviating Microsoft as M$ . You do
Thomas Nelson wrote:
> On Apr 27, 11:37 am, Tommy Grav <[EMAIL PROTECTED]> wrote:
>
>>>him> I do not have a text editor, but here are the answers to
>>>him> questions 1-5.
>>
>>>Now, frankly, I don't think this answer is correct, since I know OS
>>>X is
>>>a UNIX derivative, but I am loathe to i
Simon Berube wrote:
> On Apr 27, 3:52 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
>>On Fri, 2007-04-27 at 12:41 -0700, Simon Berube wrote:
>>
>>>Hi,
>>
>>> I have a rather simple question for which I couldn't find an
>>>answer. I noticed how a significant number of objects in Python return
>>
[EMAIL PROTECTED] wrote:
> I want to keep track of the number of different exception happens in
> my python program:
>
> ErrorHash = {}
>
> try:
>
> # come code ...
>
> except Exception, e:
> print e
> errcode = e
>
> if (ErrorHash.has_key(errcode)):
>
André wrote:
> I'm really annoyed at Python - and not for the reasons already
> mentioned on this list.
>
> Everyone know that programming is supposed to be a dark art, nearly
> impossible to learn. Computer code is supposed to be something
> impossible to read to the common person and yet reveal
Andy wrote:
> Hi, the file below will print all the keywords in a file and also the
> line # of the keyword. What I couldn't figure out is to count those
> keywords per line. For example - "Line #1 has 3 keywords"
>
> Can I do like -
>
> total[j] = total[j] + numwords(k)
> "Line number %d has %d
James Stroud wrote:
> Andy wrote:
>> Hi, the file below will print all the keywords in a file and also the
>> line # of the keyword. What I couldn't figure out is to count those
>> keywords per line. For example - "Line #1 has 3 keywords"
>>
>> Can
James Stroud wrote:
> James Stroud wrote:
>> Andy wrote:
>>> Hi, the file below will print all the keywords in a file and also the
>>> line # of the keyword. What I couldn't figure out is to count those
>>> keywords per line. For example - "
[EMAIL PROTECTED] wrote:
> That's a short, abridged version of my code :) But, what I want is to
> count total# of keywords per line and print 'em. Rather than
> printing :
>
> The word 'and' belongs in line num: 1
> The word 'del' belongs in line num: 1
> The word 'from' belongs in line num: 1
>
Prateek wrote:
> I have 3 variable length lists of sets. I need to find the common
> elements in each list (across sets) really really quickly.
>
> Here is some sample code:
>
> # Doesn't make sense to union the sets - we're going to do
> intersections later anyway
> l1 = reduce(operator.add, lis
Soren wrote:
> Hi!
>
> I have a string that contains some text and newline characters. I want
> to parse the string so that the string just before a newline character
> goes in as an element in the tuple.
>
> ex:
>
>--> (text1, text2, text3, text4)
>
> Is there an easy way to do this?
>
>
Flyzone wrote:
> Hello,
> i have again problem with regexp :-P
> I need to match all lines that contain one word but not contain
> another.
> Like to do "grep one | grep -v two:"
> The syntax of the string is:
> (any printable char)two:(any printable char)one(any printable char)
> Example:
> Apr 30
Flyzone wrote:
> P.S: i can't have more re.search, so [clip]
This reminds me of a quote by the Great Researcher Roy Garcia:
If it worked the first time, they'd just call it "search".
James
--
http://mail.python.org/mailman/listinfo/python-list
Ray wrote:
> Hi,
>
> would someone tell me how to make scrollbar work under grid?
> I think I'm missing something to connect scrollbar with the grid.
> following is some sample code. it shows the scrollbar, but it do not work.
>
> Thanks a lot for the help!
>
> Ray
>
> #code begin
>
RobJ wrote:
> On Apr 30, 12:00 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
>
>>RobJ <[EMAIL PROTECTED]> wrote:
>>
>>>http://pyschool.robj.webfactional.com/
>>
>>Things start on a pretty bad note when I'm asked to select my OS:
>>Ubuntu Linux
>>Windows XP
>>
>>I'm running MacOSX. What now? Why i
Méta-MCI wrote:
> Hi!
>
>
> See http://wiki.tcl.tk/10630
>
> Any plan to integrate Tcl 8.5 in standard Python?
>
>
>
> @+
>
> MCI
>
Better would be to outegrate it and instead use another gui kit as the
standard.
James
--
http://mail.python.org/mailman/listinfo/python-list
Tobiah wrote:
>
> >>> elegant_solution([1,2,3,4,5,6,7,8,9,10])
> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]
>
>
Here's one I use:
def elegant_solution(alist):
i = iter(alist)
return [[j, i.next()] for j in i]
py> elegant_solution(range(14))
[[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10,
miah_gbg wrote:
> Hi there!
>
> Just wanted to let people know in this group that I have recently
> (April 24th) published an introductory article on wxPython and Mac OS
> X. It is available here: http://www.macdevcenter.com/
>
> Hope someone finds it useful.
>
> Regards,
>
> Jeremiah
>
F
miah_gbg wrote:
> Hi there!
>
> Just wanted to let people know in this group that I have recently
> (April 24th) published an introductory article on wxPython and Mac OS
> X. It is available here: http://www.macdevcenter.com/
>
> Hope someone finds it useful.
>
> Regards,
>
> Jeremiah
>
N
James Stroud wrote:
> miah_gbg wrote:
>
>> Hi there!
>>
>> Just wanted to let people know in this group that I have recently
>> (April 24th) published an introductory article on wxPython and Mac OS
>> X. It is available here: http://www.macdevcenter.com
501 - 600 of 1138 matches
Mail list logo