Re: Catching stderr output from graphical apps

2005-08-12 Thread Robert Kern
ut and let c.l.py and the py mailing list know if it works on Windows. [1] http://codespeak.net/py/current/doc/home.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: random seed

2005-08-16 Thread Robert Kern
single seed yourself instead of getting it from system time. random.seed(1234567890) is traditional and works just fine. Other favorites: 3141592653589793 2718281828459045 -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of drea

Re: Testing for presence of arguments

2005-08-17 Thread Robert Kern
point) and a scripting language would > not cut it. http://cens.ioc.ee/projects/f2py2e/ -- 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: GUI tookit for science and education

2005-08-17 Thread Robert Kern
MATLAB will probably be somewhat more convenient. Once you move outside of that box and start doing real programming, Python (with Numeric, ipython, matplotlib, scipy, et al.) beats MATLAB handily. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the

Re: GUI tookit for science and education

2005-08-17 Thread Robert Kern
James Sungjin Kim wrote: > Robert Kern wrote: > >>... Once you move outside of that box and start doing real >>programming, Python (with Numeric, ipython, matplotlib, scipy, et al.) >>beats MATLAB handily. > > As one who is really newbie on Python, In MATLAB we

Re: GUI tookit for science and education

2005-08-17 Thread Robert Kern
John Hunter wrote: >>>>>>"Robert" == Robert Kern <[EMAIL PROTECTED]> writes: > > > Robert>H = U*D*V.T > > Robert> then I'm more than happy with that tradeoff. The small > Robert> syntactic conveniences MATLAB p

Re: Module Name Conflicts

2005-08-18 Thread Robert Kern
>>> import sys >>> sys.path.insert(0,'foo1') >>> import blah as blah1 >>> sys.path.insert(0,'foo2') >>> import blah as blah2 >>> sys.modules['blah'] >>> blah2.__file__ 'foo1/blah.py' >>> -- 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: Module Name Conflicts

2005-08-18 Thread Robert Kern
n't rename the java package to 'Cmd' or anything > like that. Any ideas? Why not copy cmd.py into your package under a different name? -- 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: Module Name Conflicts

2005-08-18 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Robert Kern wrote: > >>Why not copy cmd.py into your package under a different name? > > It offends my sense of modularity. For the record, I'm trying to use > pdb, the debugger, which in turn uses cmd. So it would be a matter of > ta

Re: while c = f.read(1)

2005-08-18 Thread Robert Kern
() can take a function to call repeatedly until it # receives a given sentinel value, here ''. return iter(lambda: fileobj.read(blocksize), '') f = open('blah.txt', 'r') try: for c in reader(f): # ... finally:

Re: Database of non standard library modules...

2005-08-19 Thread Robert Kern
Jon Hewer wrote: > Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Har

Re: while c = f.read(1)

2005-08-19 Thread Robert Kern
o the itertools.chain iterates through each > line and yields a character. As far as I can tell, that code is just going to read the whole file in when Python does the *arg expansion. What's the point? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows hi

Re: Idempotent XML processing

2005-08-19 Thread Robert Kern
g function? Read up on XML canonicalization (abrreviated as c14n). lxml implements this, also xml.dom.ext.c14n in PyXML. You'll need to canonicalize on both ends before hashing. To paraphrase an Old Master, if you are running a cryptographic hash over a non-canonical XML string represent

Re: Well, another try Re: while c = f.read(1)

2005-08-19 Thread Robert Kern
nd short explanations would be enough since I'm really newbie > to Python. No sorry, that's not how the newsgroup works. You read the documentation first, then come back with specific questions about what you didn't understand or couldn't find. http://www.catb.org/~esr/faqs/sm

Re: Well, another try Re: while c = f.read(1)

2005-08-20 Thread Robert Kern
James Kim wrote: > Robert Kern wrote: > >>http://www.catb.org/~esr/faqs/smart-questions.html > > Is it a *smart* way or *necessary* way? It's the polite way. And probably the only way you're going to get your questions actually answered. Read the documentation. I

Re: Well, another try Re: while c = f.read(1)

2005-08-20 Thread Robert Kern
Paul Rubin wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >>>>http://www.catb.org/~esr/faqs/smart-questions.html >>> >>>Is it a *smart* way or *necessary* way? >> >>It's the polite way. And probably the only way you're going to

Re: subpackage import problem

2005-08-21 Thread Robert Kern
is executing the contents of foo/sub/B.py while it's trying to create the module object foo.sub. You can get around it, though. Try this in foo/sub/B.py : from foo.sub.A import A class B(A): pass That works for me (Python 2.4.1, OS X). -- 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: Reading my own stdout

2005-08-21 Thread Robert Kern
> (The only option I see now is to do a "-Dprintf=my_log_function" > which I don't like.) Look at the py.io module. http://codespeak.net/py/current/doc/home.html http://codespeak.net/svn/py/dist/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass g

Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
e message you are replying to. We have no idea what "the 2nd option" is. -- 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: Well, another try Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
Steve Holden wrote: > Robert Kern wrote: >>Coincidentally, those are exactly the reasons why I posted it in the >>first place. I care not a whit about decluttering the newgroup, an >>impossible task. > > It's clear that you care not a whit about it. Unfortuna

Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
John Hunter wrote: >>>>>>"Robert" == Robert Kern <[EMAIL PROTECTED]> writes: > > Robert> Greg McIntyre wrote: > >> The 2nd option has real potential for me. Although the total > >> amount of code is greater, it factors o

Re: What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Robert Kern
to specify the attribute at run-time rather than write-time. You can do things like iterate over a list of attributes. -- 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: Library and real path name

2005-08-23 Thread Robert Kern
gt; library.class() > > I want that my library know where are its real path > (site-packages/library/), because it has to load a data file present > into a subpackage directory (like site-package/library/data/file.dat), http://peak.telecommunity.com/DevCenter/PkgResources -- Rober

Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-24 Thread Robert Kern
ed '$' to stand for > the length of the sequence (not the address of the last > element). By "+1" he means, "I like it." He's not correcting 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: use SciPy with Python 2.4.1?

2005-08-24 Thread Robert Kern
standard Python 2.4.1 interpreter, which is, I believe, the largest holdup for Windows binaries for 2.4.1. If you have success building Scipy for Python 2.4.1 on Windows, please let us know on the Scipy list. Thanks. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gras

Re: use SciPy with Python 2.4.1?

2005-08-24 Thread Robert Kern
John Hunter wrote: >>>>>>"Robert" == Robert Kern <[EMAIL PROTECTED]> writes: > > > Robert> [EMAIL PROTECTED] wrote: > >> Is SciPy usable with Python 2.4.1? At > >> http://www.scipy.org/download/ it says that 2

Re: while c = f.read(1) [comment on news hosting]

2005-08-24 Thread Robert Kern
g Eight hierarchies. But I agree that it is quite nice and is what I use to access c.l.py/python-list so that I can use the same server both at home and at work. http://gmane.org -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dream

Re: How to start PEP process?

2005-08-25 Thread Robert Kern
the post-pre-PEP stage. By all means, please do post it here and get some feedback before formally submitting 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: newbie question: convert a list to one string

2005-08-25 Thread Robert Kern
t; > I know I can make a loop like below but is that the fastest/best option > ? > > def unlist(test): > output='' > for v in test: > output = output+" "+v > return output ' '.join(test) -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: overload builtin operator

2005-08-25 Thread Robert Kern
o int.__div__(int1, int2) operator.__div__ does not get called. > Does anyone know if this is possible and if I'm going along the correct > path with my attempts above? > Is it possible to do this using a C extention? No, you can't replace the methods on builtin types. -- Robe

Re: RE Despair - help required

2005-08-25 Thread Robert Kern
x27;s > something obvious). I also tried this RE on KODOS and it works fine > there, so I am really puzzled. > > Any ideas? Look at the second string. It has "\r" in the middle of it where you really want "\\r" (or alternatively r"c:\ret_files"). --

Re: variable hell

2005-08-25 Thread Robert Kern
Nx wrote: > Hi > > I am unpacking a list into variables, for some reason they need to be > unpacked into variable names like a0,a1,a2upto aN whatever is > in the list. Really? Why? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows hig

Re: RE Despair - help required

2005-08-25 Thread Robert Kern
Yoav wrote: > Don't think it will do much good. I need to get them from a file and > extract the last folder in the path. For example: > if I get "c:\dos\util" > I want to extract the string "\util" You mean like this: import os os.path.sep + os.path.split

Re: variable hell

2005-08-25 Thread Robert Kern
t code-time, but at the prompt I probably do. Bunch assists both usages. -- 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: variable hell

2005-08-25 Thread Robert Kern
nal idea was, > that having them read into a list was the best way to massage them into the > form required to be used as input values for the insert statement. Again, why unpack them into separate variables when they are *already* in the form that you want to use them? -- Robert Kern [EMA

Re: variable hell

2005-08-25 Thread Robert Kern
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> wrote: > >> In the >>bowels of my modules, I may not know what the contents are at code-time, > > Then how do you write your code? With style. ;-) I use a Bunch w

Re: variable hell

2005-08-25 Thread Robert Kern
quot;", line 1 > a=1 > ^ > SyntaxError: invalid syntax eval *evaluates* an expression. "a=1" is a statement. It has no value. -- 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 dummy python question

2005-08-25 Thread Robert Kern
ions to the language by reading the "What's New in Python 2.x" portions of the documentation for each major revision. Specifically: http://www.python.org/doc/2.2.3/whatsnew/node9.html http://www.python.org/doc/2.2.3/whatsnew/whatsnew22.html http://www.python.org/doc/2.3.5/whatsnew/whatsnew23.

Re: MacPython 2.2 on Mac OS X 10.3.8 - configurePython error

2005-08-25 Thread Robert Kern
bt anyone is going to help fix the problem though. MacPython 2.2 has been long abandoned. The official OS X binary for Python 2.4.1 can be found here: http://www.python.org/ftp/python/2.4.1/MacPython-OSX-2.4.1-1.dmg -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass

Re: variable hell

2005-08-26 Thread Robert Kern
Adriaan Renting wrote: > Not in my Python. > > >>>>for count in range(0, 10): > > ... value = count > ... exec("'a%s=%s' % (count, value)") But that's not what rafi suggested. rafi: > why using the eval? > > exec ('a

Re: DOM text

2005-08-26 Thread Robert Kern
cessfully. Amara should also be particularly well-suited to handling mixed content, but I haven't used it in anger, yet. -- 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: MacPython 2.2 on Mac OS X 10.3.8 - configurePython error

2005-08-26 Thread Robert Kern
Paul Miller wrote: > Robert Kern wrote: >> MacPython 2.2 has been long abandoned. The >>official OS X binary for Python 2.4.1 can be found here: >> >>http://www.python.org/ftp/python/2.4.1/MacPython-OSX-2.4.1-1.dmg > > I realize that, but I have an applicat

Re: question on "import __main__"

2005-08-26 Thread Robert Kern
ith the name "__main__" and uses that if it's there. > 2. since if running a script independently, the __name__ should be > '__main__', why it's not in the above code? It is. However, you wrote "!=" instead of "==". -- Robert Kern [

Re: overload builtin operator

2005-08-26 Thread Robert Kern
> Apart from parsing the expression string myself and checking for divide > by zero I can't find another way to solve the problem. It might be easier to parse the expression and wrap all of the numbers by a subclass of float that does division like you want. -- Robert Kern [EMAIL PRO

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-26 Thread Robert Kern
as other such fun tasks like deciding if a dataset that says it's using feet is actually using meters). I have already called "Not It." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die."

Re: formal math ?

2005-08-27 Thread Robert Kern
to integrate with a full-featured CAS than it is to write one yourself. http://home.arcor.de/mulk/projects/mascyma/index.xhtml.en http://library.wolfram.com/infocenter/MathSource/585/ > I have checked numarray and I think it can not do this. No, it cannot. -- Robert Kern [EMAIL PROTECTED]

Re: What are new-style classes?

2005-08-28 Thread Robert Kern
on the left sidebar of http://docs.python.org http://www.python.org/doc/newstyle.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: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-29 Thread Robert Kern
Magnus Lycka wrote: > Robert Kern wrote: > >>If I may digress for a bit, my advisor is currently working on a project >>that is processing seafloor depth datasets starting from a few decades >>ago. A lot of this data was orginally to be processed using FORTRAN >>sof

Re: variable hell

2005-08-29 Thread Robert Kern
> >>>You might be able to do something along the lines of >>> >>>for count in range(0,maxcount): >>>value = values[count] >>>exec(eval("'a%s=%s' % (count, value)")) >> >>why using the eval? >> >>exec ('a%

Re: Robust statistics and optimmization from Python

2005-08-29 Thread Robert Kern
t think of any, but it's easy enough to do maximum likelihood with Laplacians and the functions above. If you find suitable FORTRAN or C code that implements a particular "robust" algorithm, it can probably wrapped for scipy relatively easily. -- Robert Kern [EMAIL PROTECTED] "In

Re: overload builtin operator

2005-08-29 Thread Robert Kern
Iain King wrote: > Robert Kern wrote: >>You have silly users. > > You mean you don't? Damn. Can I have some of yours? No, you may not. Mine! All mine! -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allo

Re: using common lisp with python.

2005-08-29 Thread Robert Kern
e a reason to use Python as a glue layer. I'd > recommend rewriting your LISP code in Python before I'd recommend using > Python to interface between Common LISP and C. Agreed. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: new line

2005-08-29 Thread Robert Kern
Kuljo wrote: > Dear friends > I'm so sorry to bore you with this trivial problem. Allthou: I have string > having 0x0a as new line, but I should have \n instead. In [9]: '\x0a' Out[9]: '\n' They're the same thing. -- Robert Kern [EMAIL PROTECTED] "

Re: suggestion for Python graphing package, please

2005-08-29 Thread Robert Kern
Stewart Midwinter wrote: > I need a graphing library that I can access from within a Tkinter > application running on Windows. http://matplotlib.sourceforge.net -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams all

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
dex. from Numeric import * A = array([[0, 1], [2, 3], [4, 5]]) A[$-1, $-1] The result of len(A) has nothing to do with the second $. -- 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: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
Antoon Pardon wrote: > Op 2005-08-30, Robert Kern schreef <[EMAIL PROTECTED]>: > >>Bryan Olson wrote: >> >>> Currently, user-defined classes can implement Python >>> subscripting and slicing without implementing Python's len() >>>

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
Bryan Olson wrote: > Robert Kern wrote: > > from Numeric import * > > A = array([[0, 1], [2, 3], [4, 5]]) > > A[$-1, $-1] > > > > The result of len(A) has nothing to do with the second $. > > I think you have a good observation there, but I'

Re: py2app and Bittornado

2005-08-30 Thread Robert Kern
Then you can do python setup-app.py py2app If you need more help, I suggest asking on the PythonMac-SIG mailing list. -- 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: py2app and Bittornado

2005-08-30 Thread Robert Kern
g my inbox to rape > by a bunch of useless messages would you? Use GMane. http://dir.gmane.org/gmane.comp.python.apple -- 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://m

Re: reg email packages work

2005-08-30 Thread Robert Kern
t's sent to >>the client. > > msg.as_string() have all the client data(which include > headers and body of the message He's not asking you for a description of it. He is asking for the output itself. -- 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: dynamicly updating an objects fields

2005-08-31 Thread Robert Kern
Uwe Lauth wrote: > kyle.tk wrote: > >>I want to make a function that will work like this: >> >>def updateField(object, fieldName, newValue): >> object.fieldName = newValue > > This function already exists in python. > It is called settattr. Or

Re: Mapping network drive on Linux

2005-08-31 Thread Robert Kern
ne, 1, data) > > How am I supposed to do similar thing on Linux? You would run the appropriate, external programs using os.system() or subprocess. As for what those might be, you will have to read your distribution's documentation or google around for HOWTOs. -- Robert Kern [EMAIL PR

Re: Calling ftp commands from python

2005-08-31 Thread Robert Kern
to my local > computer, how do I do it in python on the Unix side? > > I don't want to use mount since I don't have permission. http://miketeo.net/projects/pysmb/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams

Re: To Python List Moderator

2005-08-31 Thread Robert Kern
David Fickbohm wrote: > Can you please remove me from the list starting tomorrow I am going an a > weeks vacation. You have to do it yourself. http://mail.python.org/mailman/listinfo/python-list -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: OpenSource documentation problems

2005-08-31 Thread Robert Kern
/frame.html should be better-publicized. -- 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: is there a better way to check an array?

2005-09-01 Thread Robert Kern
se > except ValueError: > pass fieldIsRequired = not (k in notRequiredAry) -- 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 built email message doesn't support OutLook Express

2005-09-01 Thread Robert Kern
itespace, as html ignores >>these. > > I am sending text message as a paragraph We. Need. To. See. The. Actual. String. Otherwise, we cannot help you. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die.&quo

Re: Python C module questions

2005-09-01 Thread Robert Kern
rning Python sequences into > C arrays and vice versa? http://numeric.scipy.org > Thanks, > Jeremy Brewer > > The code is below: You probably shouldn't post such large pieces of code to the list. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the

Re: Writing formatted data (numeric) to a binary file

2005-09-01 Thread Robert Kern
or loop. For homogeneous blocks of numbers like this, you'll probably want to use Numeric of numarray. http://numeric.scipy.org import Numeric data = Numeric.array(all_of_the_numbers, Numeric.Float32) s = data.tostring() f = open(filename, 'wb') f.write(s) f.close() -- Robert

Re: Python C module questions

2005-09-01 Thread Robert Kern
;s C API has this). > > Another question: how does the distutils package handle version > upgrades? Say for example I find some bugs in my C code and need to > recompile it, will it just overwrite what's present in the > site-packages directory? It will overwrite the file

Re: Are there free molecular libraries written in python ?

2005-09-01 Thread Robert Kern
forge.net/ http://www.scripps.edu/~sanner/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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Find day of week from month and year

2005-09-02 Thread Robert Kern
ed to be populated correctly. Can anyone > help me out on this one? mx.DateTime provides a RelativeDateTime constructor that handles things like this. http://www.egenix.com/files/python/mxDateTime.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high

Re: os.system(r"ls") prints to screen??

2005-09-03 Thread Robert Kern
use the subprocess module. -- 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: Replacing large number of substrings

2005-09-04 Thread Robert Kern
= string.replace(key, value) return string How well this works depends on how large is "large." If "large" is really very large, then you might want to build something using a more suitable algorithm like the Aho-Corasick algorithm. http://www.lehuen.com/nicolas/download/pyt

Re: How to integrate an array?

2005-09-04 Thread Robert Kern
? Do each function separately. The routine that scipy.integrate.quad uses adapts to the local conditions of the function (when the function is flat, it uses fewer samples; when steep, more). -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: How to integrate an array?

2005-09-04 Thread Robert Kern
ples from fixed intervals, then you can use the functions romb(), simps(), or trapz() in scipy.integrate. BTW, a better place to ask scipy questions would be the scipy mailing list. http://scipy.net/mailman/listinfo/scipy-user -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where

Re: Online Modification of Python Code

2005-09-05 Thread Robert Kern
> function: %r'%name).__get__(cmd[0], str))(*args) > > this would (theoretically ;-) let you type commands like >sqrt 9 > and have alogomodule.sqrt called with float('9'), and then >edit > and edit the module source in notepad, and then >

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Robert Kern
r no circumstances should you replace it at all. -- 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: Last mod date

2005-09-06 Thread Robert Kern
an Operating System Utility, but I > can't figure out which module I need to import to access it. os.path.getmtime(filename) http://docs.python.org/lib/module-os.path.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dre

Re: bug in numarray?

2005-09-07 Thread Robert Kern
on list. http://lists.sourceforge.net/lists/listinfo/numpy-discussion -- 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: encryption with python

2005-09-07 Thread Robert Kern
kept in a database anyways. Hope this is a > bit more specific, thanks!!! Why don't you assign an arbitrary ID number to each student that is entirely unrelated to sensitive information (except via the database which is hopefully secure)? -- Robert Kern [EMAIL PROTECTED] "In the fields

Re: Construct raw strings?

2005-09-07 Thread Robert Kern
e between the two; they're both just string objects. If you can, please post a small but complete example script that causes errors (and the actual output of the error itself). -- 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: Need help with C extension module

2005-09-07 Thread Robert Kern
with the structs in the C extension > module code. It's *not* a straightforward task. You have to define an extension type. See http://docs.python.org/ext/defining-new-types.html However, Pyrex really does make defining extension types much, much easier. I highly suggest trying to debug your Pyrex

Re: Need help with C extension module

2005-09-07 Thread Robert Kern
put, output.output) return output -- 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: Manging multiple Python installation

2005-09-07 Thread Robert Kern
to the "make install"? Is passing it to the configure script a problem? > Why "make" > depends on that? I think that parts of the configuration depend on knowing the ultimate installation location. Specifically, you might have problems building extension modules using

Re: sys.stdout

2005-09-09 Thread Robert Kern
the 'aaa' and the '>>>' ? FWIW: Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import s

Re: Inconsistent reaction to extend

2005-09-09 Thread Robert Kern
hen you need a sorted copy but also need to keep the unsorted version around.""" [1] http://www.python.org/doc/faq/general.html#why-doesn-t-list-sort-return-the-sorted-list -- 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 upgrade to 2.4.1 on Mac OS X tiger

2005-09-09 Thread Robert Kern
ng. Instead, the executables get installed to /usr/local/bin . If you want $ python to give you 2.4.1, then make sure that /usr/local/bin comes before /usr/bin in your $PATH. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of

Re: looping over arrays in numarray/numeric

2005-09-09 Thread Robert Kern
me. So how is this done using numeric or numarray? In [1]: from Numeric import * In [2]: a = arange(100) In [3]: b = array((a,a,a)) In [4]: b[1] += b[2] -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to d

Re: where is sys.path initialized?

2005-09-09 Thread Robert Kern
Alex wrote: > No one is answering this question. Why, is it a bit unclear or what? Have patience. No one's getting paid to answer your questions. http://docs.python.org/tut/node8.html#SECTION008110000 -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where th

Re: Python compiled?

2005-09-10 Thread Robert Kern
gt; Nor has 386 'machine language' suffered from being interpreted, at a deeper > level, by microcode. I think both you and Paul may be missing Tim's point. I don't think he's talking about "suffering" in technical respects, like speed. He's talk

Re: class 'Exception', unable to use 'super' to call superclass initializer

2005-09-10 Thread Robert Kern
Exception hierarchy are still old-style classes while super() only works on new-style classes. -- 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: calling command line programs?

2005-09-10 Thread Robert Kern
Yevgeniy (Eugene) Medynskiy wrote: > Hi all, > > This is probably a very newbie question, but after searching google and > docs @ python.org I can't find an answer, so maybe someone would be able > to help? http://docs.python.org/lib/module-subprocess.html -- Robert K

Re: encryption with python

2005-09-10 Thread Robert Kern
7;s, >>so that's the system that should assign the ID numbers and handle >>SSN-based queries. > > Well, IMO just having cleartext SSNs is questionable practice unless you > need those SSNs to report to some other agency that takes SSNs. Colleges generally do have such nee

Re: Question about consistency in python language

2005-09-11 Thread Robert Kern
o be easily mistaken for one another, especially for people whose vision isn't perfect. The problem exists in the fonts people view and edit code with, not just newsreaders. -- 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 upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Robert Kern
Mike P. wrote: > Which one should I go for? What are other people using (i.e. which is the > most popular version)? Any particular advantages/disadvantages for each > version? The official one. http://python.org/2.4.1/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell w

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Robert Kern
old and probably won't be the same version in 10.5. If you want any control over how you distribute your apps, use the official 2.4.1 binary and embed the interpreter inside your .app bundle with py2app. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows hig

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-12 Thread Robert Kern
Mike Meyer wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >>>Come to think of it, what's installed by Apple may count as a >>>different distribution as well. It certainly includes more than just >>>the official distribution. >> >>It&#

Re: py2app without a mac?

2005-09-12 Thread Robert Kern
's no point in pursuing that option. > Otherwise what other options do I have? (google turned > up nothing for me) Ask your Mac users for volunteers. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Ric

Re: How to protect Python source from modification

2005-09-12 Thread Robert Kern
are obviously giving him permission to execute any command. > > On the other hand, they can reasonably expect to set up users without > giving them direct access to the database, in which case I think they > would be upset if the users found this restriction easy to bypass. Certainly, but tha

<    1   2   3   4   5   6   7   8   9   10   >