Re: Is Python a Zen language?

2006-03-01 Thread Robert Boyd
On 25 Feb 2006 15:00:37 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > I have at times the impression that many people who talk about Zen > > philosophy confuse it with some home brewn mixture of platonism with > > its transgressive move t

Re: Numerical solver

2006-03-01 Thread Robert Kern
Laszlo Zsolt Nagy wrote: > Robert Kern wrote: > >>In [7]: scipy.optimize.fmin_cobyla? >> >>Type: function >>Base Class: >>String Form: >>Namespace: Interactive >>File: >>/Library/Frameworks/Python.framework/Versions/2.4

Re: how to overload sqrt in a module?

2006-03-02 Thread Robert Kern
ts the features you want. In [8]: class A(object): ...: def __init__(self, x): ...: self.x = x ...: def sqrt(self): ...: return 2*self.x ...: ...: In [9]: a = A(10) In [10]: import numpy In [11]: numpy.sqrt(a) Out[11]: 20 In [12]: numpy.sqrt(10) Out[12]:

Re: how to overload sqrt in a module?

2006-03-02 Thread Robert Kern
), that someone was Travis Oliphant. For anything else you want, that someone is probably you. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: scipy

2006-03-03 Thread Robert Kern
d will continue. I expect that we will be placing tarballs on PyPI soon. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: forcing exceptions

2006-03-03 Thread Robert Kern
ur code should be unicode strings, and you shouldn't try to pass around encoded regular strings if at all possible, although pure ASCII strings generally work because it is the default encoding. So double-check self.sect[1] and figure out why it isn't a unicode string. -- Robert Kern

Re: add an asynchronous exception class

2006-03-04 Thread Robert Kern
ected (it needed changing the semantics > of "except:"). Also, PEP 348 was rejected and is a huge, complex > reorganization of the whole exception system. The relevant part of PEP 348 survived as PEP 352. http://www.python.org/peps/pep-0352.html -- Robert Kern [EMAIL PROTECTED]

Re: Advice from distutils experts?

2006-03-04 Thread Robert Kern
27;) if newer(__file__, target): # ... parse Python headers contents = """ #include "Python.h" /* ... */ """ % (stuff, more_stuff) f = open(target, 'w') f.write(contents) f.close() return target ext = Exte

Re: Python advocacy in scientific computation

2006-03-04 Thread Robert Kern
Is or APIs > that look funny. We are used to seeing sin(x) in our calculus textbooks > and because of that we don't find Math.Sin(x) particularly elegant -- > even though Math.Sin(x) is more OOP and sin(x) clutters the global > namespace. > > Now please go ahead and tell me how Python can help me become a better > scientist. And try to steer clear of the computer science buzzwords > that don't mean anyting to me. 1. You will probably spend less time writing and running software. 2. If you play your cards right, more people will be able to use and improve your software. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-04 Thread Robert Kern
. Are you tried using ipython in pylab mode? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-05 Thread Robert Kern
Michael Tobis wrote: >> $ rm `find . -name "*.pyc"` > > Ouch. Is that a true story? Yup. Fortunately, it was a small, purely personal project, so it was no huge loss. It was enough for me to start using CVS on my small, purely personal projects, though! -- Robert Kern

Re: Python advocacy in scientific computation

2006-03-05 Thread Robert Kern
Brian Blais wrote: > Robert Kern wrote: > >>That said, we have an excellent array object far superior to Matlab's. >> >> http://numeric.scipy.org/ > > I'd like to ask, being new to python, in which ways is this array object far > superior > to

Re: Python advocacy in scientific computation

2006-03-05 Thread Robert Kern
sturlamolden wrote: > Robert Kern wrote: >>Yes, and this is why you will keep saying, "My simulation is running too >>slowly," and "My simulation is running out of memory." All the vectorization >>you >>do won't make a quadratic algorithm ru

Re: Opening files without closing them

2006-03-05 Thread Robert Kern
h method would > you rather use? Why? Just keep doing what you are doing, please. -- Robert Kern [EMAIL PROTECTED] "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Opening files without closing them

2006-03-05 Thread Robert Kern
Erik Max Francis wrote: > Robert Kern wrote: > >>>I usually use: >>> >>>try: >>> f = open(file) >>> contents = f.read() >>>finally: >>> f.close() >>> >>>But now I am wondering if that is the same thing. Whi

Re: reshape a list?

2006-03-06 Thread Robert Kern
In [24]: (a == b).all() Out[24]: True -- Robert Kern [EMAIL PROTECTED] "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail

Re: Opening files without closing them

2006-03-06 Thread Robert Kern
y' clause tries to close f. f might have been previously > bound to some other file (which still has other handles alive) and so > the wrong file gets closed. And even if 'f' wasn't bound to anything, you will get a NameError instead of the exception that you're rea

Re: Numeric/Numarray equivalent to zip ?

2005-04-30 Thread Robert Kern
ually the case in this excellent library, but if not, both would be useful to know. Thanks, Look at combining concatenate(), reshape(), and transpose(). In Scipy, I would use hstack() and vstack(). -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the

Re: wxPython: ansi or unicode?

2005-05-01 Thread Robert Kern
versions of the unicode version of wxPython were somewhat unstable. I believe this has been largely resolved, and the ANSI versions will be going away. I may have some details wrong. If you want an authoritative answer, ask on the wxPython lists. -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: compare two voices

2005-05-01 Thread Robert Oschler
00) Da wedder is god tuday (80) Ta wegger es gid towday (50) In the example above, the original sentence gets a 100, the second choice which is close gets an 80, and the last option which is pretty bad gets 50. With a little effort you could automatically create the "dithered" phoneti

Re: MRO problems with diamond inheritance?

2005-05-01 Thread Robert Dick
M.E.Farmer: > Your answer lies somewhere in this page ;) > http://www.python.org/2.2.2/descrintro.html > M.E.Farmer delegate.py (use PyPI) may also be useful. -Robert Dick- -- http://mail.python.org/mailman/listinfo/python-list

RE: Quick and dirty dialogs?

2005-05-02 Thread Robert Brewer
rking > well enough to find it. If by "didn't need TK" you mean "I don't want to have to learn Tk", try Steve Ferg's EasyGUI: http://www.ferg.org/easygui/ Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: odeint function in SciPy

2005-05-02 Thread Robert Kern
Ben Champion wrote: > Thanks for the link! I think it has the information I want in it (the > numerical method eg Runge-Kutta). However I am not sure which of the > solvers listed within that file is used by odeint. LSODA -- Robert Kern [EMAIL PROTECTED] "In the fields of hell w

Re: odeint function in SciPy

2005-05-03 Thread Robert Kern
FLChamp wrote: > Thanks for your help! I don't suppose you happen to know what order > this method is? If your answer isn't in the docs I pointed you to or in the source, then I don't know it. Happy hunting. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell

Re: Strange behaviour of __cmp__

2005-05-05 Thread Robert Kern
[EMAIL PROTECTED] wrote: > See the following... > > class X(list): > > def __cmp__(self,anX): > print "comparing from",id(self) > return cmp(self.v,anX.v) > > > x1=X() x2=X() x1.v=-1 x2.v=100 x1>x2 > > False > x1 > False > > I

Re: F.readline

2005-05-05 Thread Robert Kern
Alex Nordhus wrote: > Having some trouble with f.readline and python. Specifically looking for > the command to tell it to go and read a specific line. There is no such command built in. You will have to build it yourself out of the components that are available. -- Robert Kern

Re: F.readline

2005-05-05 Thread Robert Kern
Erik Max Francis wrote: > Robert Kern wrote: > >>There is no such command built in. You will have to build it yourself >>out of the components that are available. > > linecache is probably what he's looking for. Well, I'll be darned, indeed it is. Hooray for

Re: win32: structured storage

2005-05-06 Thread Robert Kern
tlviewer wrote: > Is there another way to parse the central directory out of > a CHM file? google("chmlib python") -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

Re: How to create email distribution list in yahoo mail?

2005-05-07 Thread Robert Kern
egelendu wrote: > How to create email distribution list in yahoo mail? This is a mailing list/newsgroup for the Python programming language. Questions about Yahoo Mail should go somewhere else. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are th

Re: Encryption with Python?

2005-05-07 Thread Robert Kern
tely unsuitable for cryptographic purposes." Do yourself a favor and don't try to roll your own cryptographic functions. Do everyone else a favor and don't call something "unbreakable" unless you actually have the domain expertise to make that determination. And do read

Re: Encryption with Python?

2005-05-07 Thread Robert Kern
Anthra Norell wrote: > Thanks a lot for the feedback. This is certainly a great learning > experience. It's a fascinating topic too. Without wishing to annoy, I'd be > interested in knowing more. I insert questions below. > > - Original Message - > From: &qu

Re: Ask for a tool to protect my .pyc file :)

2005-05-07 Thread Robert Kern
an open source software community for a free tool to keep your source proprietary? High expectations. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: hard memory limits

2005-05-07 Thread Robert Kern
>>This is the exact error message: >> >>*** malloc: vm_allocate(size=9203712) failed (error code=3) >>*** malloc[489]: error: Can't allocate region >> >>Nothing else. No stack trace, NOTHING. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell wher

RE: how to calc the difference between two datetimes?

2005-05-08 Thread Robert Brewer
n should I use? Use datetime.datetime objects and subtract one from the other: http://docs.python.org/lib/datetime-datetime.html import datetime time0 = datetime.datetime(2005, 5, 6, 23, 3, 44) time1 = datetime.datetime(2005, 5, 7, 3, 3, 44) td = time1 - time0 print 'time difference is %s seco

Re: Fredrik Lundh

2005-05-08 Thread Robert Kern
tion and threatening to your consulting > business really draws out your true nature. Oy, my head hurts. Take it off-list, both of you. The rest of us don't care about your bickering. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the grav

Re: Fredrik Lundh

2005-05-08 Thread Robert Kern
D H wrote: > Robert Kern wrote: > >>It's called Daily Python-URL not Daily Python-Like-Languages-URL. *That* >>explains it. > > google for logix site:pythonware.com He's announced plenty non-python > stuff that is of interest to python users, includi

Re: is there a python object which can interpret java-script?

2005-05-09 Thread Robert Kern
project. It's unmaintained, and I've never tested it, but it's worth a try. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: extra a column from a 2-D array?

2005-05-10 Thread Robert Kern
http://numeric.scipy.org from Numeric import * s = array([[1,3,5], [2,4,6], [9,8,7]]) print s[:,1] -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: why this happend using model random?

2005-05-10 Thread Robert Kern
for j in range(10): > a[i][j] = randint(0, 100) So every time you index into "a[i][j]" you are always getting "col[j]". -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: why this happend using model random?

2005-05-10 Thread Robert Kern
flyaflya wrote: > Robert Kern wrote: > >>flyaflya wrote: >> >> >>>from random import * >>> >>>col = [0 for i in range(10)] >>>a = [col for i in range(10)] >> >> >>This is the problem. The list "a" now has t

Re: Library Naming Conventions.

2005-05-10 Thread Robert Kern
[EMAIL PROTECTED] wrote: > quoting: > > Modules should have short, lowercase names, without underscores. > > this still doesn't explain Cookie. PEP-008 didn't exist since the beginning of Python's development. Cookie (I believe) predates PEP-008. -- Robe

Re: Encryption with Python?

2005-05-10 Thread Robert Kern
ticisms with "I don't understand so you must be wrong." Education is a process one must engage in. You don't just step in it. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard

Re: Encryption with Python?

2005-05-11 Thread Robert Kern
stings. ;-) Okay, I'll buy that. :-) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Graphing Utilities.

2005-05-11 Thread Robert Kern
b, which I thought might interest you. Having not > gotten funky with them, I cannot vouch for their quality. They're not TeX-quality. Yet. A pslatex backend certainly would be interesting. A Gnuplot backend would probably not be feasible. Does it expose its raw drawing operations? -- Rob

Re: pyvm -- faster python

2005-05-11 Thread Robert Kern
ntrivial wrappers include ad hoc typemaps that use the Python C API. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Graphing Utilities.

2005-05-11 Thread Robert Kern
s destined for inclusion in their LaTeX-typeset papers. However, some people, like you and me, *are* making such plots and a pslatex-based solution would be a perfect fit for that use case. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the grav

Re: Finding startup files

2005-05-11 Thread Robert Kern
rtunately, 99.99% of the users of this > particular application (analysis of medical laboratory data) will be working > with Windows. > > I'm totally new to Python (obvious,yes?) so how might argv[0] fail? If I make a symbolic link to the executable script and run it using that

Re: Python Documentation (should be better?)

2005-05-11 Thread Robert Kern
tation. Searching on www.python.org trolls through the entire www.python.org site. The search box doesn't narrow its scope just because you happen to be in the Documentation section currently. It doesn't get the current documentation because Google's magic gets a bit confused

Re: Python Documentation (should be better?)

2005-05-11 Thread Robert Kern
Ivan Van Laningham wrote: > Hi All-- > > Robert Kern wrote: > >>Ivan Van Laningham wrote: >> >> >>>http://www.python.org/doc/ >>> >> >>Searching on docs.python.org goes through just the stuff that's on >>docs.python.org,

Re: Python Documentation (should be better?)

2005-05-11 Thread Robert Kern
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> wrote: > >>I believe that docs.python.org was added mostly to aid Google searches. >>I *do* think that the Documentation link should go to docs.python.org. I >>believe

Re: OSx 10.4 lacks pythonIDE?

2005-05-12 Thread Robert Kern
baza wrote: > Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use > text edit all the time?? PythonIDE never came with the OS. You have to install it yourself. http://homepages.cwi.nl/~jack/macpython/ -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: doc tags?

2005-05-13 Thread Robert Kern
t[urn]), >>attributes (@var), references (@see), etc? >> >>I guess I have just not found the link to the last flameware about it :-)) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Numarray question

2005-05-13 Thread Robert Kern
ent about what the semantics should be. In the face of ambiguity, numarray refuses the temptation to guess and forces the user to explicitly request certain behavior via alltrue() or sometrue() or whatever strikes their fancy. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: create words of various lengths

2005-05-13 Thread Robert Kern
y. I inderstand that there would be too many > permutations. So why don't you take one step back and tell us what you think you need this list *for*? We might be able to come up with feasible alternatives. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows

Re: create words of various lengths

2005-05-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi Robert, > At first I thought it would be an interesting thing to have a little > swift module to create a database of all words in the dictionary. Okay, take one more step back. Why is it interesting to have such a dictionary? How do you intend to use it

Re: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread Robert Kern
B wrote: > > On 13/5/05 03:35, in article > [EMAIL PROTECTED], "Robert Kern" > <[EMAIL PROTECTED]> wrote: > >>baza wrote: >> >>>Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use >>>text edit all the t

Re: create words of various lengths

2005-05-13 Thread Robert Kern
m source. It works just fine. Numeric will never be released "just for Windows." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Robert Kern
datetime.date(1954,1,1)] In [7]:L.sort(key=lambda x: (x.month, x.day)) In [8]:L Out[8]: [datetime.date(1954, 1, 1), datetime.date(2005, 5, 2), datetime.date(1984, 12, 15)] -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread Robert Kern
list. There are some good use cases for doing so, but until you've been writing Python code for a while and the Pythonic idioms come naturally to you, you should probably resist the urge. Python is not Fortran. def abc(x, y): ... e = Numeric.matrixmultiply(f, x) g = Numeric.matrixmultiply(Num

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Robert Kern
ned on your system. For example, on OS X, lsof(1) does the trick. > Other solutions which modify the source to be logged, are not > solutions, because it is far simpler to introduce here and there print > statements... -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gr

Re: converting a set into a sorted list

2005-05-14 Thread Robert Kern
iltin_function_or_method Base Class: String Form: Namespace: Python builtin Docstring: sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to d

RE: Is isinstance always "considered harmful"?

2005-05-15 Thread Robert Brewer
is.cx/publish/programming/charming_python_b12.html) and generic functions (cf http://dirtsimple.org/2004/11/generic-functions-have-landed.html). Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] > To me, > instanceof seems like the infimum of all possible evils in this case. >

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Robert Kern
xcept it uses the broadcasting rules of numerix Python. Input: somefunction -- a Python function or method Example: def myfunc(a,b): if a > b: return a-b else: return a+b vfunc = vectorize(myfunc) >>> vfunc([1,2,3,4],2) array([3

Re: printing arrays in shell, and .py association with idle

2005-05-17 Thread Robert Kern
, precision, suppress_small, ' ', 0) multiarray.set_string_function(array_str, 0) multiarray.set_string_function(array_repr, 1) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python forum

2005-05-17 Thread Robert Kern
people answering > questions without any problem and it goes very well Various Python web fora have sprung up now and again. None of them ever grab much of an audience. OTOH, if you're volunteering your own time and effort to set one up, I'm not going to stop you. -- Robert Kern [EMA

Re: Python on a public library computer

2005-05-17 Thread Robert Kern
27; There is a Java SSH client that runs in the browser. http://www.oit.duke.edu/sa/security/ssh.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

RE: processing a Very Large file

2005-05-17 Thread Robert Brewer
,0k free, > 27416k cached > > At this point, my computer becomes unusable. > > I'd like to know if I should buy some more memory (a few GB?) > or if it is > possible to make my code more memory efficient. The first question I would ask is: what are you doing with "result", and can the consumption of "result" be done iteratively? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: setting up scipy in windows

2005-05-17 Thread Robert Kern
made for the official python.org distribution. The paths for the ActiveState and Plone distributions are probably different. Move the files to the appropriate places. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: speeding up Python script

2005-05-18 Thread Robert Kern
rch strategy. Read up on "combinatorial optimzation" and "discrete optimization." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python forum

2005-05-18 Thread Robert Kern
Skip Montanaro wrote: > (Is "forums" okay as a plural of "forum" or should I have used "fora"?) dict.org says _forums_. I used _fora_, but I'm silly. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the grav

Re: What's the use of changing func_name?

2005-05-18 Thread Robert Kern
have inside when you change its func_name. However, the function object *does* change. In [1]:def g(x): ...:pass ...: In [2]:g Out[2]: In [3]:g.func_name = 'f' In [4]:g Out[4]: -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: MMS download

2005-05-18 Thread Robert Kern
Chu, Jeong Ho wrote: > Is it possible to download MMS stream by using python? I don't know of a way with Python alone, but you could use mplayer's -dumpstream capabilities to dump to a file. It might even allow you to dump to a pipe, I forget. -- Robert Kern [EMAIL PROTECTED] &

Re: What's the use of changing func_name?

2005-05-18 Thread Robert Kern
tribute for various purposes. For example, a documentation generating tool might look at the .func_name attribute to make the proper documentation. Actually, that's probably *the* biggest use case because I can't think of any more significant ones. -- Robert Kern [EMAIL PROTECTED] "

Re: Counting occurences of words in a list of strings

2005-05-24 Thread Robert Kern
er that doesn't exist in any of self.dict.keys(). '\x00' will probably do. whole = '\x00'.join(tc.strings) for key in self.dict.keys(): self.dict[key]['count'] = whole.count(key) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gra

Re: Checking for a full house

2005-05-25 Thread Robert Kern
t; > My questions is this: is there a better way to do this? A way that's > more natural to python, or just more efficient perhaps? > > ps. A roll of [1, 2, 1, 1, 2] is a full house (three of one kind and > two of another) def isFullHouse(roll): counts = [roll.count(di

Re: Checking for a full house

2005-05-25 Thread Robert Kern
Tony Meyer wrote: > def isfullHouse(roll): > return len(set(roll)) != 2 [1, 1, 1, 1, 2] is not a full house. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http:/

Re: Checking for a full house

2005-05-25 Thread Robert Kern
Tony Meyer wrote: > [Tony Meyer] > >>>def isfullHouse(roll): >>>return len(set(roll)) != 2 > > [Robert Kern] > >>[1, 1, 1, 1, 2] is not a full house. > > Opps. I did say it was untested (that should have been == not !=, too). > What about:

Re: Software licenses and releasing Python programs for review

2005-05-28 Thread Robert Kern
y want to not distribute your code for profit will probably be reluctant to use GPLed code. As a bonus, if they do, they will have to contribute their changes back to the community under the GPL, too, so you can incorporate them into your own code base. -- Robert Kern [EMAIL PROTECTED] "

Re: scipy for python 2.4

2005-05-28 Thread Robert Kern
scipy and help me install. scipy.org has not yet released binaries for Python 2.4. It will compile from source just fine, though. Someone may have also released binary packages for your particular platform, but since you don't mention which one that is, we can't help you with that, yet

Re: scipy for python 2.4

2005-05-28 Thread Robert Kern
used the sourse > from this link... > > http://www.scipy.org/download/ Yes, that's the source I'm talking about (although CVS is better). I don't understand what you mean when you say that the source "was looking for python2.3." The source distribution c

Re: scipy for python 2.4

2005-05-28 Thread Robert Kern
f you can't find binary RPMs for your system. http://www.scipy.org/download/atlasbinaries/linux/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: decimal numarray

2005-05-30 Thread Robert Kern
km wrote: > Hi all, > is there any support for decimal type in numarray module ? Not specifically, no. However, there is the concept of an "object array," which are arrays of arbitrary Python objects. See numarray.objects . -- Robert Kern [EMAIL PROTECTED] "In the fie

Re: Finite Element Solver for Python?

2005-05-30 Thread Robert Kern
Hsuan-Yeh Chang wrote: > Dear All, > > Anyone knows a good Finite Element Solver for python programer? google("finite element python") -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die."

Re: Software licenses and releasing Python programs for review

2005-06-01 Thread Robert Kern
rld. That's a lot more than what you alone could provide. But you can get the process started. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Intellisense and the psychology of typing

2005-06-01 Thread Robert C.Martin
can make quite a few inferences to decide how to suggest intellisense. That said, statically typed languages will always have better intellisense than dynamically typed languages. Indeed, one of the reasons that I have not switched to Ruby as my standard language is the wonderful tools availabl

Re: Generalized Linear Least Squares Problems

2005-06-01 Thread Robert Kern
odify the Python function scipy.linalg.lstsq to take the optional extra arguments and do the generalized problem. Finally, contribute your changes back to scipy and win the accolades you deserve. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: PySol not working on WinXP, SP2

2005-06-01 Thread Robert Kern
If you'd like to give it a try (I'm > not sure how you'd get sound stuff working - I'm not a Windows guy), let me > know. Source, data, and OS X binaries for 4.82 also available from here: http://homepage.mac.com/brian_l/FileSharing6.html -- Robert Kern [EMAIL PROTECT

Re: Beginner question: Logs?

2005-06-01 Thread Robert Kern
ed around a bit and haven't been able to find anything. import math -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner question: Logs?

2005-06-01 Thread Robert Kern
Svens wrote: > Hey thanks... > > Still getting an error message though. Here's what i'm doing: > -- > import math > log10(15625) > -- > -It says that log10 is not defined, but it is since the module is > imported, right? No, read the tutorial. impo

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread Robert Kern
on a block to open its > properties, ...) which library will make my job easyer, PyQT or > WxPython ? wxPython has OGL which provides part of such an interface. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Robert Kern
s. Academic projects with non-commercial clauses languish in obscurity while academic Open Source projects thrive. The contributors to the Open Source projects value knowledge and learning just as much as the lonely developers of the non-commercial-only projects, but for whatever reason, they

Re: Beginner question: Logs?

2005-06-02 Thread Robert Kern
r >>style, and should really only rarely be used. > > Better still, don't even *mention* it to a beginner. > They don't need to know about it. At all. Really. Well, the OP's use is precisely why "from xxx import *" exists: the interactive prompt. -- Robert

Re: (OT) lincense protection generator

2005-06-02 Thread Robert Kern
module >>import databasemodule >>except: >>print "PEBCAK error, call tech support" >>sys.exit(99) > > Yeah, except it's PEBKAC. ;-) I'm pretty sure it's commutative. :-) FOLDOC says PEBCAK, Jargon File says PEBKAC, po-tay-to, po-ta

Re: Scope

2005-06-03 Thread Robert Kern
Elliot Temple wrote: > Nothing is wrong with it in this case. I just want to know if Python > can do what I said. With a number of difficult hacks, yes. Passing around objects as namespaces, however, is vastly easier and far superior. -- Robert Kern [EMAIL PROTECTED] "In th

Re: If - Or statements

2005-06-04 Thread Robert Kern
de for decoding the above >pass It works fine for me. Could you post the smallest complete program (one that defines ext) that displays the behavior and its entire output? As an aside, is 'ext[1] != "wma"' correct or should it be ==? As written, you could collapse t

Re: If - Or statements

2005-06-04 Thread Robert Kern
Ognjen Bezanov wrote: > Robert Kern wrote: > > >>Ognjen Bezanov wrote: >> >> >>>Another newbie-ish question. >>> >>>I want to create an if statement which will check if a particular >>>variable matches one of the statements, and wi

Re: Sorted List (binary tree) why no built-in/module?

2005-06-04 Thread Robert Kern
> or does it just scan the list? It just scans the list since there is no guarantee that it is sorted. The bisect module has a binary search for sorted lists. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to

Re: Software licenses and releasing Python programs for review

2005-06-04 Thread Robert Kern
Thus, the GPL gives permission to release the modified program in certain ways, and not in other ways; but the decision of whether to release it is up to you.""" -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Destructive Windows Script

2005-06-05 Thread Robert Kern
#x27;s no reliable way to know which bytes have been used and which haven't. This is a case where "doing it properly" means "slow." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: how to show simulation at web

2005-06-06 Thread Robert Kern
se ? > > If there are any suggestions about this problem, I will be very happy. First, read this: http://www.catb.org/~esr/faqs/smart-questions.html Then, come back and give us some substantive information about your problem. A small example of code that you think should work, but doesn'

<    17   18   19   20   21   22   23   24   25   26   >