Re: Portable SciPy v0.1 released

2007-04-27 Thread James Stroud
prefixes to variables, or especially as suffixes to abbreviations. This is a *python* list for crying out loud! James -- http://mail.python.org/mailman/listinfo/python-list

Re: editing scripts on a mac

2007-04-27 Thread James Stroud
-featured text editor, so you will switch soon to a real one. Second, its too easy to save as rtf, even with the txt extension--and it will take some time and frustration to realize your mistake. The best option is TextWrangler for non-vi, non-emacs people. Sometimes its even a good option for vi & emacs people. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory addressing

2007-04-27 Thread James Stroud
the __repr__() output and hope to re-create the object later, say between invocations of the interpreter. You would either need the contents of the object stored or you would need to know those contents via a reference (in the same invocation). In short, you propose to do accounting that you should otherwise allow the interpreter to do for you. James -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I put an Exception as the key of a hash table

2007-04-28 Thread James Stroud
thus are not using exceptions in their intended way. You might describe the reason you are generating error codes and gather suggestions about a more pythonic (i.e. reasonable) approach. James -- http://mail.python.org/mailman/listinfo/python-list

Re: My Python annoyances

2007-04-28 Thread James Stroud
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

Re: Counting

2007-04-29 Thread James Stroud
t" The word * %s * belongs in line number: %d" % (k, > j) > > print "Total keywords in this file are: %d" %(total) > You probably want something that goes a little like this: for i,line in enumerate(linelist): for k in line.split(): if keyword.iskeyword(k): total += line.count(k) print "The word '%s' belongs in line num: %d" % (k, i+1) print "Total keyords are: %d" % total James -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting

2007-04-29 Thread James Stroud
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

Re: Counting

2007-04-29 Thread James Stroud
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 - "

Re: Counting

2007-04-29 Thread James Stroud
[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 >

Re: fastest way to find the intersection of n lists of sets

2007-04-29 Thread James Stroud
ould hold true especially for large sets with sparse overlap between lists. So it might be reasonable consider the content of your sets and lists and write your code based on the content or on assuming a particular composition. James -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I parse a string to a tuple??

2007-04-30 Thread James Stroud
> Is there an easy way to do this? > > Thanks!, > Soren > For this particular, very narrow, example, following the example as closely as I possibly can: import re atext = "text1 \n text2 \n text3 \n text4" atup = tuple(re.split(r'\s*\n', atext)) James -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp match string with word1 and not word2

2007-04-30 Thread James Stroud
--not possible in python regex. You will have to use something else--or maybe you don't understand the homework problem. James -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp match string with word1 and not word2

2007-04-30 Thread James Stroud
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

Re: python TK scrollbar problem

2007-04-30 Thread James Stroud
//www.pythonware.com/library/tkinter/introduction/x7583-patterns.htm You need to also determine exactly what it is you want to scroll. You probably don't want to scroll frame_grid as that contains your scrollbar. Google "tkinter scrolled frame". Here is an example: http:/

Re: Master's Thesis Help Needed

2007-04-30 Thread James Stroud
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

Re: Tcl-tk 8.5?

2007-05-02 Thread James Stroud
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

Re: Slicing Arrays in this way

2007-05-02 Thread James Stroud
3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13]] James -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
Regards, > > Jeremiah > For the impatient: http://tinyurl.com/2z6qeq James -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
.3, but its very cool that one can depend on wx being present on 10.4+ machines. So there is no need to bundle python/wx with your app when developing for Macs. (Yes, I noticed the author is running OS X 10.3.) James -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
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

Re: adding methods at runtime and lambda

2007-05-03 Thread James Stroud
ter way to do this today than to use lambda? It seemed > the simplest way to do this that I could find. > You don't absolutely require lambda. def add_self(afun): def _f(self, *args, **kwargs): return afun(*args, **kwargs) return _f superdict = addm(dict(), add_self(myUtils.HasDrive), "hasdrive") James -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter listboxes

2007-05-03 Thread James Stroud
nt than the active index (which is marked with an underline). You are probably using the active index and don't realize the difference. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
that he realised the Nazis had murdered Jews 'on an industrial scale', he says. ' We didn't even know the names of the concentration camps.'" http://www.guardian.co.uk/germany/article/0,2763,1446410,00.html James -- http://mail.python.org/mailman/listinfo/python-list

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
default wrote: > On 2 May 2007 20:10:20 -0700, Midex <[EMAIL PROTECTED]> wrote: > >> LIES LIES LIES LIES LIES > > Trying to understand the World Trade Center events is like waking up > to act fifteen of a long Greek Tragedy. It needs a complex fabric of > description to give a full picture. In ex

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
default wrote: > On Fri, 04 May 2007 03:26:17 -0700, James Stroud > <[EMAIL PROTECTED]> wrote: > >> default wrote: >>> On 2 May 2007 20:10:20 -0700, Midex <[EMAIL PROTECTED]> wrote: >>> >>>> LIES LIES LIES LIES LIES >>> Trying to

Re: behavior difference for mutable and immutable variable in function definition

2007-05-04 Thread James Stroud
ning a name to a value rather than "putting a value" into the name. When you assign, you completely change the identity of name, rather than changing the contents of the name. For example: py> x = object() py> id(x) 1074201696 py> x = object() py> id(x) 1074201704 Notice how the identity (id) of x changes. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
MooseFET wrote: > On May 4, 12:32 pm, James Stroud <[EMAIL PROTECTED]> wrote: > [] > >>The Marxist contribution to western thought is that it put everything in >>terms of labor and thus allowed us to quantify the human component of >>economies. > > &g

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
Charles wrote: > On Fri, 04 May 2007 20:19:33 -0700, James Stroud > <[EMAIL PROTECTED]> wrote: > > >>MooseFET wrote: >> >>>On May 4, 12:32 pm, James Stroud <[EMAIL PROTECTED]> wrote: >>>[] >>> >>> >>>>The Mar

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-04 Thread James Stroud
MooseFET wrote: > On May 4, 8:19 pm, James Stroud <[EMAIL PROTECTED]> wrote: >> MooseFET wrote: >>> On May 4, 12:32 pm, James Stroud <[EMAIL PROTECTED]> wrote: >>> [] >>>> The Marxist contribution to western thought is that it put every

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > In article <[EMAIL PROTECTED]>, >MooseFET <[EMAIL PROTECTED]> wrote: >> On May 4, 8:19 pm, James Stroud <[EMAIL PROTECTED]> wrote: >>> MooseFET wrote: >> Groucho Marx. > > Give that man a cigar. > > /BAH

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-07 Thread James Beck
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > On Sat, 05 May 2007 07:54:50 +0100, Eeyore > <[EMAIL PROTECTED]> wrote: > > > > > > >quasi wrote: > > > >> Gib Bogle wrote: > >> > >> >Ah, so the firefighters were in on the conspiracy! > >> > >> No, but the firefighters are very much aw

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread James Stroud
[EMAIL PROTECTED] wrote: > Like i want the > key 170 to take either the name 'dataPackageID' or the name > 'LocalId'.I use this in my code,and hence if either comes it should > work . It should work to do what exactly? Cause a perturbation in the orbit of Mars, or

Re: SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread James Stroud
[EMAIL PROTECTED] wrote: > SkimpyGimpy is a collection of tools for generating > HTML visual, PNG image, and WAVE audio components > for use in web based applications including CAPTCHA Can you advertise "CAPTCHA" as it is trademarked by Carnegie Mellon? James -- http://mail

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread James Stroud
time.sleep(some_number_of_seconds) user_defined_method() A more sophisticated approach would use threading, for example: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464959 James -- http://mail.python.org/mailman/listinfo/python-list

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-07 Thread James Stroud
quasi wrote: > On Mon, 7 May 2007 17:00:01 -0400, krw <[EMAIL PROTECTED]> wrote: > > >>In article <[EMAIL PROTECTED]>, >>[EMAIL PROTECTED] says... >> >>>On Mon, 7 May 2007 10:55:55 -0400, James Beck >>><[EMAIL PROTECTED]> wrot

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-07 Thread James Stroud
Tonico wrote: > On May 4, 2:08 am, quasi <[EMAIL PROTECTED]> wrote: > >>On Fri, 04 May 2007 09:37:37 +1200, Gib Bogle >> >><[EMAIL PROTECTED]> wrote: >> >>>Ah, so the firefighters were in on the conspiracy! >> >>No, but the firefighters are very much aware that there is more to >>9/11 than has bee

Re: interesting exercise

2007-05-07 Thread James Stroud
99"] > > permute("axc",N) or permute("2446",N) should raise ValueError as the > alphabet is not strictly sorted. > > I have a reasonably elegant solution but it's a bit verbose (a couple > dozen lines which I'll post later if there is i

Re: interesting exercise

2007-05-08 Thread James Stroud
sherry wrote: > On May 8, 9:31 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Mon, 07 May 2007 20:45:52 -0700, Michael Tobis wrote: >>> I have a reasonably elegant solution but it's a bit verbose (a couple >>> dozen lines which I'll post later if there is interest). Is there some >>> clever

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-08 Thread James Beck
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > On Mon, 7 May 2007 10:55:55 -0400, James Beck > <[EMAIL PROTECTED]> wrote: > > >In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > >says... > >> On Sat, 05 May 2007 07:54

Re: interesting exercise

2007-05-08 Thread James Stroud
Steven D'Aprano wrote: > On Tue, 08 May 2007 10:22:05 +0000, James Stroud wrote: > > >>This takes annoying past annoying to some new level of hell to which >>even satan himself wouldn't venture. > > > And thank you for sharing that piece of spam with u

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-08 Thread James Beck
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > James Beck wrote: > > > > Yep, you must have access to better drugs than I do. > > You get to hallucinate your stuff up. > > Don't forget to adjust your tin beanie! > > >Its not a be

Re: Suggestions for how to approach this problem?

2007-05-08 Thread James Stroud
966) Episomic resistance factors in Enterobacteriaceae. 34. The specific effects of the inhibitors of DNA synthesis on the transfer of R factor and F factor. Med. Biol. (Tokyo) 73:79-83.', 'Levy, S.B. (1967) Blood safari into Kenya. The New Physician 16:50-54.', 'Levy, S.B., W.T. Fitts and J.B. Leach (1967) Surgical treatment of diverticular disease of the colon: Evaluation of an eleven-year period. Annals Surg. 166:947-955.'] James -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter get widget option value

2007-05-08 Thread James Stroud
tate >> to print out >> 'disabled' > > Thanks > Rahul > print w["state"] James -- http://mail.python.org/mailman/listinfo/python-list

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-09 Thread James Beck
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > James Beck wrote: > > > > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > > says... > > > James Beck wrote: > > > > > > > > Yep, you must have access to be

Re: Suggestions for how to approach this problem?

2007-05-09 Thread James Stroud
entire bib, making use of the numbering and eliminating the most probable, but still fairly rare, potential ambiguity. You might want to check out that code, as my testing it showed that it worked with your example. James -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLObject 0.9.0

2007-05-10 Thread James Stroud
elps make sense of maintaining branches based on versions. I'm not sure why the announcements aren't bundled into one because just about everyone who sees this for the first time asks the same question. James -- http://mail.python.org/mailman/listinfo/python-list

Re: searching algorithm

2007-05-10 Thread James Stroud
re space inefficient than "pointers"? The implementation of the dict would, in fact, itself be pointers, where each key (same memory requirement if using pointers) is mapped to a pointer to a dict node or a pointer to a leaf, same as with a more "low level" construction. A printout of the graph as a dict might look a little ugly, though. I could be wrong, however. James -- http://mail.python.org/mailman/listinfo/python-list

Re: name capitalization of built-in types, True, and False

2007-05-11 Thread James Stroud
[EMAIL PROTECTED] wrote: > I see that naming conventions are such that classes usually get named > CamelCase. So why are the built-in types named all lowercase (like > list, dict, set, bool, etc.)? > > And names for instances of classes are usually written in lowercase, > like foo in ``foo = Camel

Re: multi threaded SimpleXMLRPCServer

2007-05-14 Thread c james
I use a variation of the following. Clean and straight forward. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/425043 Vyacheslav Maslov wrote: > Hi, all! > > I need multi threaded version of SimpleXMLRPCServer. Does python library > already have implementation of this one? Or i need

Re: customary way of keeping your own Python and module directory in $HOME

2007-05-14 Thread James Stroud
proper settings of LD_LIBRARY path. Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it? James -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter button state = DISABLED

2007-05-14 Thread James Stroud
o re-bind any events you have bound when the button is "disabled". So its better to just use the "command" parameter rather than binding mouse events. An exception is Checkbutton, where you might want to bind and then query the button's state (or the state of

Re: Name of function caller

2007-05-15 Thread James Stroud
*original_parameters): do_something_to_caller_without_magic(caller) do_something_with_original_parameters(*original_parameters) James -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread James Stroud
walterbyrd wrote: > Python's lack of an EOF character is giving me a hard time. > > I've tried: > [ stuff ] for s in f: do_whatever_with_s(s) James -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I count the number of spaces at the left end of a string?

2007-05-16 Thread James Stroud
walterbyrd wrote: > I don't know exactly what the first non-space character is. I know the > first non-space character will be * or an alphanumeric character. > This is another of the hundreds of ways: py> for i,c in enumerate(astring): ... if c != ' ': break ... py> print i -- http://mail.p

Re: How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread James Stroud
> or this: > > f = open('testdata','r') > s = f.readline() > while s: > print repr(s) > s = f.readline() > > Please post real, runnable code. You've done something wrong > and we've no way to guess what it was if you won't show us your > code. > I'm guessing it was runnable when he pasted it into google groups. James -- http://mail.python.org/mailman/listinfo/python-list

Re: remove all elements in a list with a particular value

2007-05-16 Thread James Stroud
John Zenger wrote: >>>>print [x for x in items if x != ''] > > ['SRCPARAM', '1', '6.35e-07', '15.00', '340.00', '1.10', '3.0'] > This can be shortened to [x for x in items if x] James -- http://mail.python.org/mailman/listinfo/python-list

Re: Regexes: How to handle escaped characters

2007-05-17 Thread James Stroud
r that never > takes part in a match. The docs are not very promising regarding > such a thing, or did I miss something? > > Any other ideas? > > Tschö, > Torsten. > You should probably provide examples of what you are trying to do or you will likely get a lot of i

Re: Regexes: How to handle escaped characters

2007-05-17 Thread James Stroud
Torsten Bronger wrote: > Hallöchen! > > James Stroud writes: > > >>Torsten Bronger wrote: >> >> >>>I need some help with finding matches in a string that has some >>>characters which are marked as escaped (in a separate list of >>>indi

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-18 Thread James Stroud
ns) You must decide for yourself how to deal with ambiguities. For example, will '1.0' be a float or an int? The above assumes you want all values in a column to have the same type. Reordering the loops can give mixed types in columns, but would not fulfill your stated requirements. Some things are not as efficient as they might be (for example, eliminating the clumsy make_str). But adding tests to improve efficiency would cloud the logic. James -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-19 Thread James Stroud
e files, taking a 1/N sample can save a lot of time with little > chance of misdiagnosis. Why stop there? You could lower the minimum 1/N by straightforward application of Bayesian statistics, using results from previous tables as priors. James -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
Int (were the tenths-decimal place to vary randomly). You could generate a similar statistical model to convince yourself with vanishing uncertainty that the column that tests positive for Int four times in a (random sample) is not actually a Float (even with only one decimal place known). James -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
James Stroud wrote: > Now with one test positive for Int, you are getting pretty certain you > have an Int column. Now we take a second cell randomly from the same > column and find that it too casts to Int. > > P_2(H) = 0.9607843--> Confidence its an Int column from round

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
John Machin wrote: > So, all in all, Bayesian inference doesn't seem much use in this scenario. This is equivalent to saying that any statistical analysis doesn't seem much use in this scenario--but you go ahead and use statistics anyway? -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
a Centauri where organizations are fundamentally different from here on Earth and we can not make any reasonable assumptions about them--like that they will indeed cough up money when the time comes or that they speak a dialect of an earth language or that they even generate spreadsheets for us to parse. James -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-21 Thread James Stroud
an 20%, but no where near the 0.001 cutoff to conclude the column is not Int) and the final probability P_7(H|D) = 0.9986247 (rounding up to our 0.999 criteria for confidence that it is an Int ;). James -- http://mail.python.org/mailman/listinfo/python-list

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-21 Thread James Stroud
, especially given reasonable foreknowledge of how data types are typically encoded. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Call script which accepts com. line par. from another script and error control

2007-05-23 Thread James Stroud
nt mod1.doit(37) except ValueError: print 'Gracefully handling 37....' print print mod1.doit(37) # end of mod2 James -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating Graphs for the Web

2007-05-23 Thread James Stroud
nyone recommend a good library I can use for this? > > > Matplotlib! > > In the perennial spirit of one-upsmanship (or one-sidewaysmanship at the very least): Pychart! James -- http://mail.python.org/mailman/listinfo/python-list

Re: read file to a dictionary

2007-05-23 Thread James Stroud
ng paranormal conveyances: ConfigParser cPickle shelve I leave it to you to interpret them as I am just a messenger. James -- http://mail.python.org/mailman/listinfo/python-list

Re: 0 == False but [] != False?

2007-05-23 Thread James Stroud
> ... > empty > > But then doing the following gives a surprising (to me!) result > > >>>>[] == False > > False > > Could anybody point out why this is the case? > > Thanks, > Rajarshi > Meditate on: py> isinstance(False, int) True py> isinstance([], int) False py> bool([]) False James -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort lines in a text file

2007-07-23 Thread James Stroud
Daniel wrote: > On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: >> say I have a text file: >> >> zz3 uaa4a ss 7 uu >> zz 3 66 ppazz9 >> a0zz0 >> >> I want to sort the text file. I want the key to be the number after >> the two "zz". Or I guess a string of t

Re: Pure Python equivalent of unix "file" command?

2007-07-23 Thread c james
Take a look at http://www.demonseed.net/~jp/code/magic.py W3 wrote: > Hi all, > > Just a quick one... Is there such a thing? > > Thanks, > /Walter -- http://mail.python.org/mailman/listinfo/python-list

Re: Good String Tokenizer

2007-07-24 Thread James Stroud
gt; Does anyone know of a tokenizer that will allow for this sort of use? > > Thanks in advance, > Jim Howard > Pyparsing: http://pyparsing.wikispaces.com/ 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

Cleaning up a string

2007-07-24 Thread James Stroud
ring at each round. Does some function or library exist for these types of transformations that works more like string.translate or is the above the best one can hope to do without writing some C? I'm guessing that "if s in astr" type optimizations are already done in the replace

Re: Cleaning up a string

2007-07-24 Thread James Stroud
Peter Otten wrote: > unicode.translate() supports this kind of replacement... > and re.compile(...).sub() accepts a function: Thanks Peter! -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.pyth

Re: Flatten a list/tuple and Call a function with tuples

2007-07-25 Thread James Stroud
> > I know the * operator. However, a 'partial unpack' does not seem to > work. > > def g(): > return (1,2) > > def f(a,b,c): > return a+b+c > > f(*g(),10) will return an error. > > Do you know how to get that to work? > > Thanks, > cg >

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-25 Thread James Stroud
proliferate and self > reinforce. All honest people have left this sad newsgroup. Buy bye, > assholes, I am not going to miss you!!! > > Martha You have convinced me to subscribe to clpm! Sounds like it will be fun reading. -- James Stroud UCLA-DOE Institute for Genomics and P

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-25 Thread James Matthews
Welcome aboard On 7/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Python is a better language, with php support, anyway, but I am fed up with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin Perl experience for everyone. Instead of being helpful, snide remarks, back-bitin

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-25 Thread James Matthews
Wow! They might leave this newsgroup now also! On 7/25/07, Jürgen Exner <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > Python is a better language, with php support, anyway, but I am fed up > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > Perl experience for eve

Re: first, second, etc line of text file

2007-07-25 Thread James Stroud
o access the file multiple times at arbitrary positions, you may need to seek(0), cache lines already read, or slurp the whole thing, which has already been suggested. 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: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread James Stroud
em and wandered into the interior design department by accident and found what I like to call "the motherload". No, the girls definitely weren't doing the sciency stuff back then. But that has been a few years already, so maybe things have changed. James -- James Stroud UCLA-DOE I

<> vs !=

2007-07-27 Thread James Matthews
Dear Lists What is the difference between <> and != Thank You James -- http://www.goldwatches.com/watches.asp?brand=55 http://www.jewelerslounge.com -- http://mail.python.org/mailman/listinfo/python-list

◘►FREE Satellite TV on your PC◄◘

2007-07-28 Thread Ana James
Watch all your favorite shows on your Computer from anywhere in the World! Save 1000's of $$$ over many years on cable and satellite bills. INSTANT DOWNLOAD For More Details: http://tvonpc.cq.bz -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP in Python book?

2007-07-30 Thread James Stroud
ck > > Balme your professors. They are not paying for the books. Of course most will be give a lot of lip-service to educational access for disadvantaged groups but thier choice of books usually suggests otherwise. The high price of textbooks and the tendency for professors to overlook alternativ

Help text embedding in C code?

2007-07-30 Thread James Stroud
d I should just start typing HTML.reStructuredText for this sort of thing? James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help text embedding in C code?

2007-07-30 Thread James Stroud
Carsten Haese wrote: > On Mon, 2007-07-30 at 16:24 -0700, James Stroud wrote: > >>Hello All, >> >>I have a python module I wrote in C some time ago and I have since >>forgotten how to use my functions and so I wanted to add some >>doc-strings such that "

Re: What is the "functional" way of doing this?

2007-07-30 Thread James Stroud
x27;functional' way to do the same. > > Thanks, > beginner > Does it get any more functional than lambda? py> f = lambda n, r=None: f(n/26, (r if r else [])) + [n%26] if n/26 else [n%26] py> f(30) [17, 1, 20, 12] py> f(30000) [1, 18, 9, 22] py> f(3000) [4, 11, 10] py

Re: What is the "functional" way of doing this?

2007-07-30 Thread James Stroud
James Stroud wrote: > py> f = lambda n, r=None: f(n/26, (r if r else [])) + [n%26] if n/26 > else [n%26] > py> f(30) > [17, 1, 20, 12] > py> f(3) > [1, 18, 9, 22] > py> f(3000) > [4, 11, 10] > py> f(1000) > [1, 12, 12] > > Oops, th

Re: What is the "functional" way of doing this?

2007-07-30 Thread James Stroud
quite painful in Python (no tail >>>recursion, and look at all that list copying). >> > > It might actually be : > > def f(n): > if n > 0: > return ([n%26] + f(n/26)) > else: > return [] > > Wouldn't t

Re: Encryption recommendation

2007-07-31 Thread James Stroud
implementation for production software. -- 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: calling a .net application from Python 2.5

2007-08-01 Thread James Matthews
http://pythonnet.sourceforge.net/ On 8/1/07, Acm <[EMAIL PROTECTED]> wrote: > > I am working with Python 2.5. > > I would like to know how to call a .NET application (or .dll) from a > Python script. > > Can anyone help please? > > Thank you. > > -- > http://mail.python.org/mailman/listinfo/python

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-01 Thread James Matthews
I am very happy with there support i concur with what Joshua wrote! I have yet to see a full paying consumer not happy with wingide On 8/1/07, Steve Holden <[EMAIL PROTECTED]> wrote: > > Joshua J. Kugler wrote: > > On Wednesday 01 August 2007 13:53, Robert Dailey wrote: > >> He's secretly an emplo

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread James Stroud
sable(object): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): return functools.partial(self.func, *args, **kwargs) For example: @enclosable def do_something_with(a, b): [etc] James -- James Stroud UCLA-DOE Institute for Genomics and

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread James Stroud
James Stroud wrote: > import functools > class enclosable(object): > def __init__(self, func): > self.func = func > def __call__(self, *args, **kwargs): > return functools.partial(self.func, *args, **kwargs) > > For example: > > @enclosable > def

►►►Get FREE Satellite TV on your PC ◄◄◄

2007-08-03 Thread Ana James
Watch Satellite TV On Your Computer Without Paying Monthly Fees... FOR FREE? Watch all your favorite shows on your Computer from anywhere in the World! Save 1000's of $$$ over many years on cable and satellite bills. INSTANT DOWNLOAD Plus Free Unlimited Downloads Movies, MP3s Music, etc !!! Mo

How to pass a reference to the current module

2007-08-03 Thread James Stroud
mething_with(AModule, funcname) Ideally, it would be nice to leave out AModule if the functions were designed in the same namespace in which do_something_with is called. Thanks in advance for any suggestions. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Ang

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
James Stroud wrote: > Basically, what I am trying to acomplish is to be able to do this in any > arbitrary module or __main__: > > > funcname = determined_externally() > ModuleUser.do_something_with(AModule, funcname) > > > Ideally, it would be nice to leave out AM

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
James Stroud wrote: > James Stroud wrote: > >> Basically, what I am trying to acomplish is to be able to do this in >> any arbitrary module or __main__: >> >> >> funcname = determined_externally() >> ModuleUser.do_something_with(AModule, funcname) >&

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
like it much, however, because it seems unnatural. 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 to pass a reference to the current module

2007-08-03 Thread James Stroud
current module when all you have is the name of the function in a > string. The answer to that would be "globals()[funcname]". This is like a bad case of phone-tag. Please see my response to your previous post for why this does not seem feasible to me. James -- James Stroud

<    11   12   13   14   15   16   17   18   19   20   >