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: Retrieving Filename from Path

2005-08-31 Thread robert . dowell
>>> import os.path >>> help(os.path) Help on module ntpath: NAME ntpath - Common pathname manipulations, WindowsNT/95 version. FILE c:\data\utils\python24\lib\ntpath.py DESCRIPTION Instead of importing this module directly, import os and refer to this module as os.path. FUNCTION

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: Python Doc Problem Example: os.system

2005-09-05 Thread Robert Wierschke
Xah Lee schrieb: > Python Doc Problem Example: os.system > > Xah Lee, 2005-09 > > today i'm trying to use Python to call shell commands. e.g. in Perl > something like > > output=qx(ls) > > in Python i quickly located the the function due to its > well-named-ness: > > import os > os.system("ls"

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

Using Python to interact with BMC Patrol

2005-09-07 Thread Andrew Robert
Hi Everyone, Has anyone done any Python coding to manage/interact/customize BMC Patrol? If anyone has, could you please point me to where I can find documentation/guides on this? I checked the Python SIGs and Vault of Parnasus but didn't see anything available. Any insight you might have on thi

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: CGI File Uploads and Progress Bars

2005-09-08 Thread Robert Brewer
cgi.FieldStorage, and override make_file to provide your own file-like object that you can monitor as its "write" method is called (see read_binary for the actual upload r/w code). The existing FieldStorage class places the file size (gleaned from the Content-Length request header) into sel

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
he one Python you > installed (and hence all the things installed by it), or will install > things again. > > Otherwise, I agree with Robert - use the official one. Of course, if > one of the other two includes all the extra functionality you want, > use it. One thing that should be noted

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

Re: Get Mac OSX Version

2005-09-13 Thread Robert Kern
rbt wrote: > Is there a similar function to sys.getwindowsversion() for Macs? platform.mac_ver() (And while we're at it: platform.win32_ver() might be prefered to sys.getwindowsversion()) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-13 Thread Robert Kern
he error code (or else wrongly assume that nothing wrong can happen). Uncaught exceptions *do* make the program bail out at the point of bogosity (more or less). >>If you look at the Python C source, you'll notice that probably 50% of >>the code is devoted to error handling (that was a

Re: round() wrong in Python 2.4?

2005-09-13 Thread Robert Kern
t;> 0.0225 0.022499 >>> round(0.0225, 3) 0.023 >>> [~]$ python2.4 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 in

Re: py2app without a mac?

2005-09-13 Thread Robert Kern
which is provided with py2app. And so the circle is complete Again, it's probably not going to work without some major surgery on py2app. And if you don't have a Mac to test on, you probably won't get far. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the

Re: What XML lib to use?

2005-09-13 Thread Robert Kern
libxml2 and libxslt under the covers for greater standards compliance including c14n. I've been using extensively recently and highly recommend it. http://codespeak.net/lxml -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Antoon Pardon wrote: > Op 2005-09-13, Robert Kern schreef <[EMAIL PROTECTED]>: > >>Jeremy Sanders wrote: >> >>>Nils Grimsmo wrote: >>> >>>>Why did round() change in Python 2.4? >>> >>>It the usual floating point representatio

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Grant Edwards wrote: > On 2005-09-14, Robert Kern <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: > >>>0.0225 isn't representable and it happens that the actual number >>>you get differ. Now which number python should choose when it is >

Re: What XML lib to use?

2005-09-14 Thread Robert Kern
His interpretation of your words is a perfectly valid one even in the context of this thread. "in Python" explicitly provides a context for the rest of the sentence. In English, at least, it is perfectly reasonable to presume that explicit contexts override implicit ones. -- Robert Kern

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Reinhold Birkenfeld wrote: > Robert Kern wrote: >>Antoon: >>"Python 2.3 isn't rounding 0.0225 up while pyton 2.4 rounds it down." > > Written in Pseudocode: > > not (Py2.3 rounding up and Py2.4 rounding down) I presumed the "isn't&qu

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Robert Kern wrote: > Reinhold Birkenfeld wrote: > >>Robert Kern wrote: > >>>Antoon: >>>"Python 2.3 isn't rounding 0.0225 up while pyton 2.4 rounds it down." >> >>Written in Pseudocode: >> >>not (Py2.3 rounding up and Py2.

Re: help for conversion of NUMARRAY to PIL object

2005-09-15 Thread Robert Kern
In [13]: a = zeros((256,256, 4), UInt8) In [14]: img = Image.frombuffer('RGBA', (256,256), a) -- 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: help for conversion of NUMARRAY to PIL object

2005-09-15 Thread Robert Kern
inly does on my machine. Is it raising an exception on yours? If so, please post the code that is causing the error and the exception that is raised and the versions of PIL and numarray that you are using. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high

Re: encryption with python?

2005-09-15 Thread Robert Kern
Ed Hotchkiss wrote: > What's the best module for encryption with python, anyone out there > using python and encryption together? It depends on what your needs are. What do you need to accomplish? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass gro

Re: My First Python Script

2005-09-15 Thread Robert Kern
Ed Hotchkiss wrote: > But then I still get the error with the len(x) statement .. hmm That's because integers don't have a length. But if you follow James' advice, you don't need to calculate lengths of anything. -- Robert Kern [EMAIL PROTECTED] "In the fields o

Re: encryption with python?

2005-09-15 Thread Robert Kern
t; Any info on using this file? Didn't see > any on this guys site ... It's fairly straightforward. The _test() function should be self-explanatory once you learn some more Python (which I suggest you do before entrusting secure data to code that you write). -- Robert Kern [EMAIL PROTEC

Re: Problem with Help when using numarray

2005-09-16 Thread Robert Kern
>File "C:\Python24\lib\pydoc.py", line 1226, in docroutine > if object.im_self: >File "C:\Python24\Lib\site-packages\numarray\generic.py", line 537, > in __nonzero__ > raise RuntimeError("An array doesn't make sense as a truth value.

Re: Wrapping float

2005-09-17 Thread Robert Kern
the arguments to __init__. C.f. http://www.python.org/2.2/descrintro.html#__new__ In [11]: class WrapFloat(float): : def __new__(cls, value, *args, **kwds): : return float.__new__(cls, value) : def __init__(self, value, wrap=None): : float.__init__(s

Re: problem with setup.py

2005-09-17 Thread Robert Kern
on't > know which. Add the following line to your ~/.bashrc (assuming that you are using bash as your shell): export MACOSX_DEPLOYMENT_TARGET=10.3 Then start a new Terminal.app window (the change doesn't take effect until a new shell is started). I haven't needed to do this w

Re: problem with setup.py

2005-09-17 Thread Robert Kern
the finder, so you have to edit it from the terminal. $ open ~/.bashrc That should open it in TextEdit.app . -- 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: Roguelike programmers needed

2005-09-18 Thread Robert Kern
Thomas Jollans wrote: > what exactly is RPG/roguelike etc ? (what debian package provides an > example?) Google is your friend. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard

Re: Validating XML parsers

2005-09-19 Thread Robert Kern
but found no > mention of w3.org schemas. Apparently not all that came up. http://codespeak.net/lxml/ -- 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: slice lists

2005-09-19 Thread Robert Kern
The syntax was there since 1.4 for the Numeric module[1], but the list object itself wasn't updated to utilize that syntax until later. [1] http://numeric.scipy.org -- 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: Windows paths, Java, and command-line arguments, oh my!

2005-09-19 Thread Robert Kern
he config file in c:\config). What doesn't work is > these two lines: > > cmd = r'java -jar sforcedataloader.jar -Dc:\config' That's not the same thing as the examples you give above. Namely, you're missing the "salesforce.config.dir=" which is probably pretty

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Robert Kern
> SSH can be used for functionality like this, through tunneling. You > can even > tunnel interprocess communication through SSH. Its not exceptionally > complicated. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the grave

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Robert Kern
essor Indeed. As I am a grad student, that would have been most embarassing. And I do *not* recommend Googling "asshole" without SafeSearch on. *shudder* -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die

Re: Best Encryption for Python Client/Server

2005-09-20 Thread Robert Kern
ation of SSH is provided by the package Paramiko. Good luck. -- 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: Classes derived from dict and eval

2005-09-20 Thread Robert Kern
ned by compile(). The globals must be a dictionary and locals can be any mappping, defaulting to the current globals and locals. If only globals is given, locals defaults to it. globals needs to be a real dictionary. The implementation uses the C API, it doesn't use the overridden

Re: Finding where to store application data portably

2005-09-20 Thread Robert Kern
it may not have pygame but > it definitely has python). Surely this is something that's crying out > for an official function in os or sys. On OS X, the data should probably go to ~/Library/Application Support/Bombz/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell wher

distutils and decorators

2005-09-21 Thread Robert Brewer
2.4, or 3. Is there some better way to optionally test decorators, like using eval, or 4. other...? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's documentation come of age

2005-09-21 Thread Robert Kern
not use silly+walks instead. Is this really a significant problem for 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: C#3.0 and lambdas

2005-09-21 Thread Robert Kern
l that would require something like this: low_level_drawline(x1, y1, x2, y2) that isn't amenable to *argument unpacking. -- 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

<    7   8   9   10   11   12   13   14   15   16   >