Re: Python becoming less Lisp-like

2005-03-15 Thread James Graves
Brandon J. Van Every <[EMAIL PROTECTED]> wrote: >James Graves wrote: >> >> So with Python 3000, you're going to end up with a language just as >> big as CL, but without the most fundamental building blocks. Ah >> well, to each his own. > >Preventing

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread James Graves
Brandon J. Van Every <[EMAIL PROTECTED]> wrote: >James Graves wrote: >> >> If you want to do application development, Common Lisp is where it's >> at, no doubt about it. There are more and better libraries for CL >> these days, and they are easier to inst

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
Your users are, what me might call, "ignorant luddites". The built in 'File->Create Archive' command produces a zip file in OSX. I propose that zip is indeed the native compressed format. Perhaps you should install OS 7.5 on their machines (c. 1993) to make them feel mo

Re: setDocumentLocator in validating parser (xmlproc)

2005-03-18 Thread James Kew
setattr(xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "set_locator", set_locator) HTH, James Kew http://jameskew.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Drawing Cogwheels and Combinatoric diagrams

2004-12-01 Thread Andrew James
Gentlemen, I'm looking for a graphing or drawing python package that will allow me to draw complex geometric shapes. I need to be able to create shapes like cogwheels and Venn diagrams: http://encyclopedia.thefreedictionary.com/Venn The library must support alpha blending and the ability to retu

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

Import Semantics, or 'What's the scope of an import?', and class attribute instantiation

2004-12-04 Thread Andrew James
n-specific advanced features I can use (things like closures, lambda forms, map(), etc. etc.). Could anyone point me towards some good resources? I would much appreciate some assistance in finding some answers to these questions, as the research I've done seems to be inconclusive, if not downr

Error in previous post - Import behaviour

2004-12-04 Thread Andrew James
All, The example given in the previous e-mail I sent was wrong (and makes the question look stupid). In the attribute instantiation example, the __main__ declaration should read: > if __name__ == 'main': > y = myY() I meant it to show that even if I never instantiate X, its attributes still

RE: Mean, median, and mode - third time's the charm!!!

2004-12-06 Thread Frohnhofer, James
> > median = lambda x: x.sort() or ((len(x) % 2) and (x[(len(x)>>1)])) or > (sum(x[((len(x)>>1)-1):(len(x)>>1)+1])/2.0) > > >>> median( [2,3,4,5,6,7]) > 4.5 > >>> median( [2,3,4,5,6]) > 4 How about >>> median = lambda x: x.sort() or (x[(len(x)-1)/2] + x[len(x)/2])/2.0 >>> median([2,3,4,5,6,7])

Re: regex syntax

2004-12-07 Thread James Stroud
Ich kann nicht spricht Deutch, aber: import re regex = re.compile(r'(.*)(\.jpg)$') m = regex.match("bild.jpg") g = m.groups() print g[0] print g[1] Auf wiedersehen! James On Monday 06 December 2004 04:03 pm, Andreas Volz wrote: > Hi, > > ich kann nicht gut

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Andrew James
You're looking for the Singleton pattern to ensure that only one instance of your class is instantiated at a time. There's a particularly useful discussion about this at: http://c2.com/cgi/wiki?PythonSingleton I suggest you try the different methods out and pick the one best suited to your situ

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: Creating Fixed Length Records

2004-12-09 Thread Andrew James
then I > could create the format string once, then pass it a tuple with the > values for that record. Just a thought. > > So, gurus, what are your suggestions to tame this record? Are there > easier ways that I'm just not seeing? > > Thanks, > --greg -- Andrew James <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

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
an example somewhere, so It didn't occur to me that it could be done (too good to be true, even though it is obvious, phenomenon), and I never tried it, already /knowing/ the answer. Thanks everyone for your answers. James -- http://mail.python.org/mailman/listinfo/python-list

Re: A beginner's problem...

2004-12-18 Thread James Martin
Try deleting the Compiled Python File that was created during import -- extension pyc. Then import again. It seems to me (I'm a novice too) that, when you import a module, Python automatically compiles it. Then when you import it later, the compiled version is imported if it exists. "Amir Dek

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

2004-12-20 Thread James Stroud
ol. In how many other languages is it almost as easy to calculate the eigenvectors of a matrix as it is to write the "hello world" program? I haven't found any--and then again, I haven't looked too hard. And that's the point. So they (read "we") are coming. Be prepared.

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 ""

Killing a python thread with a signal

2004-12-22 Thread James Lamanna
So I've created a thread with the threading.Thread class, but I want to be able to kill this thread because it does a select() with a timeout of None. Is there any way to send a signal only to this thread and wake it up from the select? Thanks. Please CC me for I am not subscribed. --

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
think this should only take a couple of lines for one skilled in regex and/or listcomp. Any takers? James p.s. Here is the ugly function I wrote: def build_consensus(astr): consensus = [] # the lol that will be returned possibilities = [] # one element of con

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
ed" thread that started yesterday, some good books are mentioned. James On Monday 28 March 2005 09:07 pm, Anon wrote: > I've gotten off to a good start for programming using Python (my first > programming language). I can do the basics (different kinds of loops, > variables, fun

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
nd then someone would say something about a "Turing Machine", just to show that theoretically, the above code could be understood by something theoretical. James On Friday 01 April 2005 11:23 am, Terry Reedy wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTEC

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
yield.html http://linuxgazette.net/100/pramode.html James On Sunday 03 April 2005 02:12 pm, Brendan wrote: > Hi everyone > > I'm new to Python, so forgive me if the solution to my question should > have been obvious. I have a function, call it F(x), which asks for two > other funct

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

How does Python call the system/primitive calls ?

2005-04-11 Thread James Yu
d readings ?-- James Yu[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

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: Using python from a browser/security hole

2005-04-15 Thread James Carroll
I don't think Jython will help much here... you would have to embed jython in your applet which makes it big, which makes it take longer to download... (or you could install it ahead of time on each client.) I asked my friend who did some smartcard authentication at a previous job... and in his ca

Re: py2exe - create one EXE

2005-04-15 Thread James Carroll
I like that you can automatically invoke NSIS and create an installer, but I thought the question was how can all of the libraries be in a single runnable program executable (not a program that installs, but the program that you wrote.) I don't think you can do this, because (unless you have your

Re: pre-PEP: Suite-Based Keywords

2005-04-15 Thread James Stroud
I_vote_yes(James): I_understand_what_it_does = True Makes_code_formatting_way_more_managable_in_tough_cases = True Makes_code_way_more_readable = True To_cool = True On Friday 15 April 2005 04:45 pm, Brian Sabbey wrote: > Here is a pre-PEP for what I call "suite-based

Re: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib, winzip barfs on Python-2.4.1.tar, cannot download bzip2

2005-04-18 Thread James Carroll
Hi Bill, Python 2.4 requires VC7.1 I just ran into this recently. Once I installed VC7.1, I could easily compile the Python source to create a debug lib. Winzip should be able to read the python source tarball... There is one trick though. Once you download it, it might get renamed to python.ta

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 Carroll
If you have five elements, numbered 0,1,2,3,4 and you ask for the elements starting with the first one, and so on for the length you would have [0:length]. So [0:5] gives you elemets 0,1,2,3,4. Think of the weirdess if you had to ask for [0:length-1] to get length elements... One based 1... n

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
In the absence of any context to this question: Hit the button that says "Enter". James On Thursday 21 April 2005 01:15 pm, ionic wrote: > Hi all > > This is probably going to sound very dull but, how do you get to the next > line after youve finished typing the fir

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread James Stroud
a case of premature optimization. James On Thursday 21 April 2005 10:23 am, Thomas Bartkus wrote: > "djw" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > While I agree with (most of) your points, one should not overlook the > > fact th

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

Re: how can I sort a bunch of lists over multiple fields?

2005-04-27 Thread James Stroud
27;, 'ellie-mae'] d = ['bob','carol','ted','alice'] e = [a,b,c,d] for ary in e: print ary e.sort(lambda x,y:cmp(x[1],y[1])) for ary in e: print ary e.sort(lambda x,y:cmp(x[0],y[0])) for ary in e: print ary James On Wednesday 27 April 20

Re: how can I sort a bunch of lists over multiple fields?

2005-04-27 Thread James Stroud
llie-mae'] d = ['bob','carol','ted','alice'] e = [a,b,c,d] for ary in e: print ary e.sort(lambda x,y:cmp(x[1],y[1])) for ary in e: print ary e.sort(lambda x,y:cmp(x[0],y[0])) for ary in e: print ary James On Wednesday 27 April 2005 10:34 am,

Re: tkinter text width

2005-04-27 Thread James Stroud
pixels at the end of a line for "rounding errors" and will filter for a limited alphabet consisting only of the numbers, the captial letters, and the space. I think I can do this given these limitations. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 9515

Re: Most discussion on comp.lang.python is about developing with Python

2013-11-13 Thread Rhodri James
oderated. God alone knows what Googlegroups thinks it's doing. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rhodri James
s are really module-level globals? Isn't this a strawman you've already disallowed? It sounds to me like you're complaining that Python is ahead of the curve here :-) -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Rhodri James
igid typing with practically non-existent typing (something Modula-2 and C didn't do nearly as well); and so on and so forth. None of this is stuff your students need for their work, so I wouldn't waste time side-tracking them with it. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Rhodri James
On Mon, 09 Dec 2013 23:42:14 -, Roy Smith wrote: In article , "Rhodri James" wrote: Pascal and BCPL contrasted rigid typing with practically non-existent typing Wow, you actually used BCPL? I didn't realize the language ever had any real use. I had only ever hea

Script Request

2013-12-11 Thread Jeff James
Looking for a script which will check connectivity of any or all of our company URL's first thing in the morning to make sure none or our sites are down. Any suggestions ? Thank You -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-12 Thread Rhodri James
, ten languages, that's 50 years I think. Or do I rewrite my diary for next week, so I learn Smalltalk Monday morning, Ruby Monday afternoon, Julia Tuesday morning ... Welcome to Computer Science lectures :-) -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.pytho

Question RE urllib

2013-12-16 Thread Jeff James
So I'm using the following script to check our sites to make sure they are all up and some of them are reporting they are "down" when, in fact, they are actually up. These sites do not require a logon in order for the home page to come up. Could this be due to some port being blocked internally

Re: Question Re urllib (Jeff James)

2013-12-16 Thread Jeff James
/my..com/intranet.html* is down* http://#.main..com/psso/pssignsso.asp?dbname=FSPRD90 * is down* http://sharepoint..com/regions/west/PHX_NSC/default.aspx * is down* Cc: python-list@python.org Date: Mon, 16 Dec 2013 06:54:48 -0500 Subject: Re: Question RE urllib On Mon, Dec 16, 2013

RE: Question RE urllib

2013-12-16 Thread Jeff James
Sorry to be a pain here, guys, as I'm also a newbie at this as well. Where, exactly in the script would I place the " print str(e) " ? Thanks Original message : I'm not really receiving an "exception" other than those three sites, out > of the 30 or so I have listed, are the only sites which s

Re: Question Re urllib (Resolved)

2013-12-16 Thread Jeff James
This worked perfectly. Thank You Where, exactly in the script would I place the " print str(e) " ? The line after the print site + " is down" line. Original Post : I'm not really receiving an "exception" other than those three sites, out of the 30 or so I have listed, are the only sites

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-16 Thread Rhodri James
elopment took one look at it and exclaimed, "It's a hammer, all our problems must be nails!" And the rest is C++. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

RE: Question RE urllib

2013-12-17 Thread Jeff James
So I'm using the following script to check our sites to make sure they are all up and some of them are reporting they are "down" when, in fact, they are actually up. These sites do not require a logon in order for the home page to come up. Could this be due to some port being blocked internally

RE: Use of urllib (update)

2013-12-18 Thread Jeff James
Folks, I promise I'll get to the point where my questions aren't so basic, but I'm just now starting to get into Python. So I'm using the urllib script to check to make sure our company sites are up. As stated earlier, I have three sites which require some form of authentication in order to repo

Re: Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Rhodri James
icit is better than implicit? -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Rhodri James
but it's a painful process and it won't be pretty. It's far better to use a language as it is rather than as you want it to be. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Rhodri James
*stuff* between you and the machine. That's not to say it's the right language to be writing applications. +1 -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

RE: urllib and authentication script integration

2013-12-23 Thread Jeff James
I have some simple code I would like to share with someone that can assist me in integrating authentication script into. I'm sure it's an easy answer for any of you. I am still researching, but on this particular project, time is of the essence and this is the only missing piece of the puzzle for

Re: Postfix conditionals

2014-01-05 Thread Rhodri James
statement to properly comprehend what was going on and what the results would be for my sample data. It looks like a good idea, but I don't think it works that well in practice. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: Postfix conditionals

2014-01-06 Thread Rhodri James
;t have any relevant Perl around any more. I think it had to do with losing the visual cue of indentation, and just having to think that little bit harder to notice that I wasn't dealing with purely linear code. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Rhodri James
y some considerable margin. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Rhodri James
On Tue, 07 Jan 2014 01:35:54 -, Chris Angelico wrote: On Tue, Jan 7, 2014 at 12:26 PM, Rhodri James wrote: On Mon, 06 Jan 2014 21:17:06 -, Gene Heskett wrote: On Monday 06 January 2014 16:16:13 Terry Reedy did opine: On 1/6/2014 9:32 AM, Gene Heskett wrote: > And from

Re: With this artifact, everyone can easily invent new languages

2014-01-10 Thread James Harris
language. So don't let the tool stand in > the way. There is a saying: Grinding a chopper will not hold up the work > of cutting firewood. To the OP: this is a suitable topic for comp.lang.misc which is used for discussions about programming language design and implementation such as parse mechanisms. James -- https://mail.python.org/mailman/listinfo/python-list

Re: With this artifact, everyone can easily invent new languages

2014-01-11 Thread James Harris
"Simeon Chaos" wrote in message news:d7878ab7-2f6d-4bc4-9a28-3ea567bdf...@googlegroups.com... > Thank you, James. I didn't know this group before. I'll post this message > there. You're welcome. It can be hard to find apt groups on Usenet because there are s

Re: How to get Mac address of ethernet port?

2014-01-11 Thread James Harris
sible that two machines could show the same mac address. James -- https://mail.python.org/mailman/listinfo/python-list

Re: Python solve problem with string operation

2014-01-16 Thread Rhodri James
plest way to do this is probably using groupby: from itertools import groupby input = "3443331123377" output = "".join(k for k, _ in groupby(s)) print output -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list

Re: How to write this as a list comprehension?

2014-01-19 Thread Rhodri James
ningful_name(then, name): _,mn,dy,_,_,_,wd,_,_ = localtime(then) return somefunc(mn, dy, wd, name) ... [meaningful_name(then, name) for (then, name) in mylist] I assume there's some good reason you didn't want somefunc() to do the localtime() itself? -- Rhodri James

<    4   5   6   7   8   9   10   11   12   13   >