Re: Destructive Windows Script

2005-06-06 Thread Robert Kern
hall find. -- 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-06 Thread Robert Kern
Michele Simionato wrote: > The problem is that Google gives me too many non-relevant hits. google("fat undelete") google("ext2 undelete") -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed t

Re: Reading a CSV file into a list of dictionaries

2005-06-06 Thread Robert Kern
itect': 'ABC Architects', 'PNumber': '3056', 'Contractor': 'XYZ Contracting'} {'Architect': 'ABC Architects', 'PNumber': '3056', 'Contractor': 'XYZ Contracting'} [etc.] -- 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: Software licenses and releasing Python programs for review

2005-06-06 Thread Robert Kern
e's almost never a *desire* to ask for more permissions. The code has never been granted any legal powers. It's still just contributors. -- 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 a CSV file into a list of dictionaries

2005-06-07 Thread Robert Kern
uot;"" The rows are not all of the same format. The OP *does* know the structure, and he (?) *does* know what he's doing. It's just not the structure usually used in CSV files. The csv module, of course, still reads these rows just fine; they just need to be processed a bit

Re: Matplotlib w/ TK Backend.

2005-06-08 Thread Robert Kern
TKinter > backend? Any help would be appreciated. A. You will get better help on the matplotlib mailing list. B. Have you edited your .matplotlibrc to use the TkAgg backend? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams al

Re: Annoying behaviour of the != operator

2005-06-08 Thread Robert Kern
Out[7]:False In [8]:not (a != b) Out[8]:False -- 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: Annoying behaviour of the != operator

2005-06-08 Thread Robert Kern
hat (a != b) raise an error when __ne__ isn't provided, but such is life until 3.0. -- 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 Places Incorrect

2005-06-08 Thread Robert Kern
Tom Haddon wrote: > Hi Folks, > > When I run: > > print "%0.2f" % ((16160698368/1024/1024/1024),) > > I get 15.00 > > I should be getting 15.05. Can anyone tell me why I'm not? Integer division does not yield floats. http://docs.python.org/lib

Re: Annoying behaviour of the != operator

2005-06-10 Thread Robert Kern
t about objects that are not hashable? > > The purpose of arbitrary ordering would be to provide > an ordering for all objects, whatever they might be. How about id(), then? And so the circle is completed... -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass gro

Re: Python Developers Handbook

2005-06-10 Thread Robert Kern
it > and get back to something interesting, like Python. There is no moderator. We are all moderators. -- 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 Developers Handbook

2005-06-10 Thread Robert Kern
Andrew Dalke wrote: > Robert Kern wrote: > >>There is no moderator. We are all moderators. > > I am Spartacus! > > We are all Kosh. Well, if we're starting on the Vorlon quotes, this one seems germane: "The avalanche has already begun. It is too late for the

Re: using python from c/c++

2005-06-10 Thread Robert Kern
r.sourceforge.net -- 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: Abstract and concrete syntax

2005-06-11 Thread Robert Kern
ruct is Pythonic, absolutely and without equivocation for all people as Guido indented. ask-me-how-to-calculate-the-age-of-the-universe-ly y'rs, Acolyte Kern -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to

Re: What is different with Python ?

2005-06-11 Thread Robert Kern
n. In the same vein, I can also read and learn from others' code much more than I could from, say, Perl. -- 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: changing how instances are "created"

2005-06-12 Thread Robert Kern
eator > def createInstance(cls, *args, **kwargs): > anewinstance = cls.__new__(cls, *args, **kwargs) > anewinstance.__init__(*args, **kwargs) > > return anewinstance > createInstance = staticmethod(createInstance) You want a class

Re: changing how instances are "created"

2005-06-12 Thread Robert Kern
newseater wrote: > > Robert Kern wrote: > >>newseater wrote: >> >>>Hello. I need to be able to control how objects are created. Sometimes >>>when creating an object, i want to reuse another object instead. I've >>>searched for factory method i

Re: Learning more about "The Python Way"

2005-06-12 Thread Robert Kern
ntitled "Some rich fool is paying me to work fulltime on Python 3.0 for a year. What's on *your* wishlist?" -- 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: Learning more about "The Python Way"

2005-06-13 Thread Robert Kern
e, the book is still worth buying for the discussion about each recipe that will help the reader learn more deeply how the code fits into "The Python Way." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowe

program call graph

2005-06-13 Thread Robert Cimrman
not (pythfilter having some parsing problems). I would greatly appreciate your hints/suggestions. Thanks, Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Robert Kern
#x27;m just tossing this out. I don't really have much experience with the algorithm, but when searching for multiple targets, an Aho-Corasick automaton might be appropriate. http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ Good luck! -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Robert Kern
Robert Kern wrote: > I'm just tossing this out. I don't really have much experience with the > algorithm, but when searching for multiple targets, an Aho-Corasick > automaton might be appropriate. > > http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ More

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
capability? -- 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: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
mes: user 0.00 s, sys: 0.01 s, total: 0.01 s Wall time: 0.03 In [9]: img2.size Out[9]: (2400, 4800) -- 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: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Robert Kern > wrote: > >>PyPK wrote: >> >>>One reason why I don't want to use PIL is it seems very slow for tiff >>>images of very large sizes(2400x4800). So I am looking for a be

Re: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Robert Kern wrote: > Marc 'BlackJack' Rintsch wrote: >>It's fast enough to open the file and read the meta-data. The OP wants to >>decode the actual pixels. > > Okay. > > In [12]: %time d = img.getdata() > CPU times: user 0.31 s, sys: 1.43 s, total:

Re: add new modules?

2005-06-17 Thread Robert Kern
Macintosh obviously) on basically > freeBSD, os I'm doing UNIX type stuff at the console. If you are using the Apple-supplied Python 2.3.5, put the modules in /Library/Python/2.3/site-packages/ . If you are using Bob Ippolito's Python 2.4.1, then it's /Library/Frameworks/Python.

Re: call function in console without paranthesis

2007-05-31 Thread Robert Kern
27;, 'bar' --> f('Foo', 'bar') ('Foo', 'bar') In [9]: f 1, 2, 3 --> f(1, 2, 3) (1, 2, 3) In [13]: x = 1 In [14]: f x ---> f(x) (1,) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: Determinant of Large Matrix

2007-06-06 Thread Robert Kern
rix? Is there a python package that could > help me? If all of your matrices are going to be integers, doing the determinant-by-minors calculations yourself is probably easy enough to code and will retain complete precision. http://mathworld.wolfram.com/DeterminantExpansionbyMinors.html -- Ro

Re: questions about solving equations in scipy

2007-06-12 Thread Robert Kern
(unique) solution is within the constraint or it's not. Are you sure you don't want to find the minimum-error solution that obeys the constrain, instead? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Robert Kern
y and parts of the rest of the standard library may use them to implement their features. Implementing generic functions themselves don't require anyone to convince python-dev of anything. http://python.org/pypi/simplegeneric/0.6 http://peak.telecommunity.com/DevCenter/RulesReadme -- Robert Ker

Re: The Modernization of Emacs

2007-06-21 Thread Robert Uhl
d so forth). Granted, text-mode is friendlier than fundamental-mode. Still, as a pico replacement emacs works well enough--and as the user continue to works, he discovers more and more functionality, eventually having a 10,000-line .emacs... -- Robert Uhl <http://public.xdi.org/=ruhl>

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-21 Thread Robert Uhl
a half hours of wasted time. And you'd now be using an actual text editor, which is often helpful. -- Robert Uhl <http://public.xdi.org/=ruhl> The cover art on the O'Reilly tome isn't meant to anthropomorphize sendmail itself after all; it's actually a subliminal

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-21 Thread Robert Uhl
rching would interrupt one's flow of thought rather than being part of it. > Between Windows bugs and gratuitous misfeatures (e.g. DRM) and Unix > clunkiness, billions of dollars of potential productivity is lost > worldwide every *month*. You left out user refusal to learn... -- Robert

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-21 Thread Robert Uhl
S interface conventions--you've just forgotten them), but it is easy to use. A Windows or Mac OS text editor may have an easier learning curve, but it'll never be as easy to use. -- Robert Uhl <http://public.xdi.org/=ruhl> I read [.doc files] with 'rm.' All you lose is

try/except with multiple files

2007-06-21 Thread Robert Hicks
Is it good practice to do something like: try: f1 = file('file1') f2 = file('file2') except: # catch the exception Or do you do a try/except for each open? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: try/except with multiple files

2007-06-21 Thread Robert Hicks
might not work for you if the files aren't homogeneous (each > have similar contents). If the files have distinctly different > purposes, I would just wrap them each in their own try/except block. > > I rambled a bit there, but I hope it helps. > > Matt Helps a bunch...thank you very much. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: eggs considered harmful

2007-06-21 Thread Robert Kern
kages that are out there. There are a handful of packages that only distribute the eggs and not the source tarballs, but those are rare. -- Robert Kern "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 a

Re: Issues with nonfunctioning VTK under python 2.5

2007-06-21 Thread Robert Kern
Eric Carlson wrote: > Any suggestions would be greatly appreciated. Please bring these bug reports to [EMAIL PROTECTED] and possibly make a ticket on our Trac. https://mail.enthought.com/mailman/listinfo/enthought-dev https://svn.enthought.com/enthought Thanks. -- Robert Kern &quo

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Robert Brown
Stephen R Laniel <[EMAIL PROTECTED]> writes: > Granted, in a dynamic language we won't always (maybe "won't > often") have a situation where the types are known this well > at compile time. But sometimes we will. And it would be nice > to catch these before the program even runs. > > So my questio

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-21 Thread Robert Brown
Neil Cerutti <[EMAIL PROTECTED]> writes: > On 2007-06-21, Douglas Alan <[EMAIL PROTECTED]> wrote: >> A prime example of this is how CLOS, the Common Lisp Object System was >> implemented completely as a loadable library (with the help of many >> macros) into Common Lisp, which was not an OO languag

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Robert Uhl
forth. It's Mac OS and Windows which are inconsistent. Emacs has been around since they were mere glimmers in the eye of Jobs & Gates... -- Robert Uhl <http://public.xdi.org/=ruhl> Just because I'm not doing anything, doesn't mean I have nothing to do! --Ellen Winnie -- http://mail.python.org/mailman/listinfo/python-list

Re: Setuptools, build and install dependencies

2007-06-22 Thread Robert Kern
to be able to do it. No, generic setup.py scripts don't do anything of that kind. -- Robert Kern "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."

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Robert Uhl
ng the assumption that Mac OS in 1984 offered some textual capability (textual, since we're discussing text editing) which emacs did not. It didn't. -- Robert Uhl <http://public.xdi.org/=ruhl> A: Top posting Q: What's the most annoying thing about Usenet? -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Robert Uhl
w I learnt emacs. I was 13, and had only ever used Mac software up until that point. I had a fairly limited command set (basically, C-x C-f, C-x C-s & C-x C-c). > One person elsewhere in this thread even went so far as to suggest > that to avoid having a similar hurdle wit

Re: The Modernization of Emacs

2007-06-23 Thread Robert Uhl
tures when > fiddling about in the shell. shells have a lot of context if you use > them effectively. context that isn't easy to transport between the > shell and emacs -- and it isn't really easy to explain either. M-x shell, or M-x terminal -- Robert Uhl <http://publi

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-23 Thread Robert Uhl
x27;ve never actually run emacs, have you? -- Robert Uhl <http://public.xdi.org/=ruhl> The power of Satan is as nothing before the might of the Lord, so don't go getting any ideas. --I Abyssinians 20:20 -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-23 Thread Robert Uhl
'; the first item therein is 'Emacs tutorial'; the second is 'Emacs tutorial (choose language).' If you had ever actually run emacs you'd know this. Do you think that Mercedes are awful cars because their engines don't start when you turn the key in the igniti

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-23 Thread Robert Uhl
[EMAIL PROTECTED] writes: > > So now we're expected to go on a filesystem fishing expedition instead > of just hit F1? Interestingly enough, f1 _is_ bound to the help system in emacs. So's C-h. So's the 'help' key. -- Robert Uhl <http://public.xdi.org/=ruh

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-23 Thread Robert Uhl
e some memory of such a project existing > somewhere). Agreed. Stallman got sidetracked by Scheme, which IMHO was a dead-end. A Common Lisp emacs would be pretty sweet. There's a Climacs project, but they're just focused on providing an editor, not on providing a full-fl

Re: trouble installing numpy 1.0.2 and scipy.0.5.2

2007-06-23 Thread Robert Kern
e the exact error output. Similarly, for the scipy installation, please tell us exactly what steps you took and copy and paste the output. Thanks. -- Robert Kern "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 inte

Re: The Modernization of Emacs

2007-06-23 Thread Robert Uhl
ck? Check out nethack.el <http://www.nongnu.org/nethack-el/>. You can run nethack within emacs. This, of course, means that there _is_ a kitchen sink within emacs (when it's running nethack within itself)... -- Robert Uhl <http://public.xdi.org/=ruhl> I don't think the Jav

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Robert Brown
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Graham talks about 25% of the Viaweb code base being macros. Imagine how > productive his coders would have been if the language was not quite > so minimalistic, so that they could do what they wanted without the > _lack_ of syntax getting in the way.

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
Twisted <[EMAIL PROTECTED]> writes: > On Jun 23, 8:35 pm, Robert Uhl <[EMAIL PROTECTED]> wrote: >> Twisted <[EMAIL PROTECTED]> writes: >> >> > For an example of the latter, consider opening a file. Can't remember >> > the exact spelling and

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
e app > for unix systems (with the inevitable MS-DOS ports and others). No, as I've said over and over and over again, emacs is not what you think it is. It has a GUI; it has colours; it can display images; it can use the native widget set. It can even be configured to use native keybindin

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
or written for your > platform and get access to the real thing? Because it's nice having the same interface no matter what. Because GUIs come and GUIs go (remember CDE? OpenView?), but emacs will always be there. Because it's nice being able to fire up emacs and not care what platform one is running on. -- Robert Uhl <http://public.xdi.org/=ruhl> prepBut nI vrbLike adjHungarian! qWhat's artThe adjBig nProblem? -- Alec Flett -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
sition that they were, and I > quote, "broken and lame", assuming you mean the same stock Windoze > keybindings you meant with the cryptic term "CUA standards". Not really--they're broken and lame because they are less flexible and powerful. How 'bout you ac

Re: distutils/setuptools de-installation?

2007-06-25 Thread Robert Kern
, PyPgSQL among them, the above command isn't even > recognized. This _has_ to be a FAQ, doesn't it? Please help! distutils itself has no notion of uninstallation. You need to figure out what files the package installed and delete them yourself. -- Robert Kern "I have come to

Re: Looking for an interpreter that does not request internet access

2007-06-25 Thread Robert Kern
ter that does not access the internet > when it starts (or when it is running, unless I specifically write a > program that causes it to do so, so as a browser)? The regular interpreter works fine. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: eggs considered harmful

2007-06-26 Thread Robert Kern
mation systems vs numerical analysis systems vs web server systems. > > 6. Refresh process which does not need to fiddle with egg-ness, or > even know about Python. Everything is a tarball. And all of these are obviated by the fact that easy_install can find and build source tarballs, too.

Re: _hashlib portability issue

2007-06-26 Thread Robert Kern
fo ld` has not enlightened me, either. -- Robert Kern "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: p & br using ElementTree?

2007-06-26 Thread Robert Kern
e .tail attribute on the br element: In [1]: from xml.etree import ElementTree as ET In [4]: p = ET.Element('p') In [5]: p.text = 'Current date:' In [6]: br = ET.SubElement(p, 'br') In [7]: br.tail = '2000-01-01' In [8]: ET.dump(p) Current date:2000-01-0

Re: Rappresenting infinite

2007-06-28 Thread Robert Kern
is a generic inf and > add the wish that that is not equal to itself (inf == inf would yield > nan). No. You can make one that fits your requirements, though. > Ideally, it would not be of type float and work with gmpy mpq. > But I might have rare requirements... Possibly. -- Robert

Re: Rappresenting infinite

2007-06-29 Thread Robert Kern
[EMAIL PROTECTED] wrote: > On Thu, 28 Jun 2007 23:20:30 -0500 > Robert Kern <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: >>> Does it differ from the >>> built-in inf? >> What built-in inf? > > $ python > Python 2.4.4 (#2, Ap

Re: Rappresenting infinite

2007-07-02 Thread Robert Kern
on't work on Windows, for example. Fortunately, it doesn't matter all that much (at least for those who just need to create such values; parsing them from files is another matter) since infs and nans can be constructed in a cross-platform way (at least for IEEE-754 platforms where these v

Re: Ask for a password with OptParse

2007-07-03 Thread Robert Kern
ot print the user's input to the screen. -- Robert Kern "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

Questions about input lines (maximum length and continuation)

2007-07-03 Thread Robert Dodier
y way to allow symbols, operators, and numbers to be broken across lines? Thanks a lot for any information. I appreciate your help. Robert Dodier -- http://mail.python.org/mailman/listinfo/python-list

Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
Hi, I am interested in creating an expandable (dynamic) 2D dictionary. For example: myvar["cat"]["paw"] = "Some String" The above example assumes "myvar" is declared. In order for this to work, I have to know ahead of time the contents of the dictionary. For the above to work, my declaration mus

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
On Jul 6, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jul 2007 15:43:55 -0000, Robert Dailey <[EMAIL PROTECTED]> wrote: > >Hi, > > >I am interested in creating an expandable (dynamic) 2D dictionary. For > >example: > > >myvar

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
On Jul 6, 10:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Robert Dailey wrote: > > Hi, > > > I am interested in creating an expandable (dynamic) 2D dictionary. For > > example: > > > myvar["cat"]["paw"] = "Some

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
Thank you all very much for your valuable replies. I wasn't aware that tuples were valid keys in a dictionary object. This is actually the solution I was looking for. Thank you all once again. -- http://mail.python.org/mailman/listinfo/python-list

ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
I created a basic python file and made an attempt to execute it from the command line, however it gives me a weird error after the python file has been executed: Traceback (most recent call last): File "C:\Python25\lib\runpy.py", line 87, in run_module raise ImportError("No module named " +

Re: ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
Never mind, I found the problem. I was doing: python -m compile.py I really should have been doing: python compile.py The description of -m is confusing in the documentation, what does it really do? -- http://mail.python.org/mailman/listinfo/python-list

C++ Modules for python: How to?

2007-07-06 Thread Robert Dailey
Hi, I'm interested in making a C++ library of mine usable through python. Python does a similar thing with Expat (the non-validating XML parser). I notice that with Expat, python is importing a C++ header file into a PY file and the interface is available to python. I've read through the python do

Re: ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
On Jul 6, 4:04 pm, Bjoern Schliessmann wrote: > Robert Dailey wrote: > > The description of -m is confusing in the documentation, what does > > it really do? > > IMHO, it's quite clear. What's unclear with this description: > > -m module-nameSearches s

Re: C++ Modules for python: How to?

2007-07-06 Thread Robert Dailey
On Jul 6, 3:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Robert Dailey schrieb: > > > Hi, > > > I'm interested in making a C++ library of mine usable through python. > > Python does a similar thing with Expat (the non-validating XML

Distributing python apps

2007-07-09 Thread Robert Dailey
Hi, I'm creating a set of command-line tools using Python. These tools manage resources for a game I'm working on. However, many people that will be using these tools will not want to install Python on their machines. This would be a very tedious process (for first time users of my tools). Ideall

Re: Distributing python apps

2007-07-09 Thread Robert Dailey
Thanks a ton guys. You both gave me the exact answers I was looking for. -- http://mail.python.org/mailman/listinfo/python-list

PyXML not installing?

2007-07-09 Thread Robert Dailey
Hi, I downloaded the PyXML library and I'm attempting to install it by following the README file on Windows XP. I currently have Visual Studio 2005 installed. >From the command line I type: C:\PyXML-0.8.4>python setup.py build running build running build_py running build_ext error: Python was bu

How to create new files?

2007-07-12 Thread Robert Dailey
Hi, I'm trying to create a Python equivalent of the C++ "ifstream" class, with slight behavior changes. Basically, I want to have a "filestream" object that will allow you to overload the '<<' and '>>' operators to stream out and stream in data, respectively. So far this is what I have: class fi

Function parameter type safety?

2007-07-12 Thread Robert Dailey
Hi, Is there a way to force a specific parameter in a function to be a specific type? For example, say the first parameter in a function of mine is required to be a string. If the user passes in an integer, I want to notify them that they should pass in a string, not an integer. -- http://mail.p

Re: Function parameter type safety?

2007-07-13 Thread Robert Dailey
Good replies. I'm in the process of learning Python. I'm a native C++ programmer, so you can see how the question relates. There's a lot of cool things C++ allowed you to do with type-checking, such as function overloading. With templates + type checking, I can create a STD version of ifstream/ of

Re: How to create new files?

2007-07-13 Thread Robert Dailey
On Jul 13, 3:04 am, Bruno Desthuilliers wrote: > Robert Dailey a écrit : > > > Hi, > > > I'm trying to create a Python equivalent of the C++ "ifstream" class, > > with slight behavior changes. > > > Basically, I want to have a "filestream&

Re: Numpy array index handling

2007-07-13 Thread Robert Kern
ut < 0] = 10 * a[input < 0] In [7]: output[input > 0] = 20 * a[input > 0] If you are still having problems, please join us on numpy-discussion with the full traceback. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrib

Pass by reference or by value?

2007-07-13 Thread Robert Dailey
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the function is also modified. Sometimes I wish to work with "copies", in that when I pass in an integer v

Re: Pass by reference or by value?

2007-07-13 Thread Robert Dailey
On Jul 13, 2:10 pm, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I noticed in Python all function parameters seem to be passed by > reference. This means that when I modify the value of a variable of a > function, the value of the variable externally from the functi

Re: Numpy array index handling

2007-07-13 Thread Robert Kern
n reduce the typing burden somewhat like so: import numpy as N a = N.arange(10) That's a fairly common idiom in the numpy community. You can also import specific symbols if you know what you are going to use. If you're doing a lot of trig, for example: from numpy import sin, co

Re: Numpy array index handling

2007-07-13 Thread Robert Kern
n Enthought employee) haven't been updating the Enthought Edition. We are moving to a less monolithic approach with Python eggs. -- Robert Kern "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 thoug

Re: interactive graphical script builder

2007-07-13 Thread Robert Kern
per at Scripps (Sanner, lab). He has a prototype of this > type of thing for working with molecular models. I'm not sure how the > code is liscensed. It's called Vision, now, and it's only available for noncommercial, scientific research use. http://www.scripps.edu/%7Esann

Dict Help

2007-07-15 Thread Robert Rawlins
Hello Guys, I'm looking for some help expanding on a dictionary I've got and storing multiple values per key and the best way to do it. I'm guessing that I need to store a list inside the value of the dictionary, but I'm not quite sure how that can be achieved, and also how to check for values

The ** operator ambiguous?

2007-07-16 Thread Robert Dailey
I noticed that the ** operator is used as the power operator, however I've seen it used when passing variables into a function. For example, I was researching a way to combine dictionaries. I found that if you do this: a = {"t1":"a", "t2":"b"} b = {"t3":"c"} dict( a, **b ) This combines the two

Re: comparison with None

2007-04-18 Thread Robert Kern
comparisons is not always a good idea. > Better to: > from types import NoneType > > x = None > if type( x ) == NoneType: > # true > < code > > else: > # false; do something else. > < more code > The recommended idiom is to test for "

Re: matplotlib basic question

2007-04-20 Thread Robert Kern
Colin J. Williams wrote: > I'm not sure that scipy has been updated to Python 2.5 ? scipy certainly works with 2.5. Are you referring to something else perhaps? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible b

Re: matplotlib basic question

2007-04-20 Thread Robert Kern
Tommy Grav wrote: > On Apr 20, 2007, at 2:44 PM, Robert Kern wrote: >> Colin J. Williams wrote: >> >>> I'm not sure that scipy has been updated to Python 2.5 >> ? scipy certainly works with 2.5. Are you referring to something >> else perhaps? > >

Re: how to get a wrap aound slice of numpy array

2007-04-20 Thread Robert Kern
I know that x[0:2] would give [0,1], and > x[-1] give [4], is there a way that I can get [4,0,1]. I try x[-1:2], > but it returns an empty array. x[[-1, 0, 1]] -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our o

Re: No speedup on multi-processor machine?

2007-04-21 Thread Robert Kern
can be 'valid', 'same', or 'full' to specify size of the resulting sequence. -- Robert Kern "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 underly

Re: matplotlib basic question

2007-04-23 Thread Robert Kern
Pete Forman wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > > > Colin J. Williams wrote: >>> I'm not sure that scipy has been updated to Python 2.5 > > ? scipy certainly works with 2.5. Are you referring to something > > else perhaps? >

Re: Numpy problem: Arrays in a list of dictionaries

2007-04-23 Thread Robert Kern
ZMY wrote: > Dear Robert, > > So how should I do this? I tried > >>>>> d1 = {1: array([2, 3, 4]).copy(), 2: ''} >>>>> l1 = [] >>>>> for i in range(3): l1.append(d1.copy()) > > and it still doesn't work. Of cou

Re: noob questions

2007-04-24 Thread Robert Kern
ading all of them all of the time takes substantial amounts of time. Also, I don't recommend using either pkgload or "from scipy import *" in code. However, from the interactive prompt, feel free. That is precisely what these features were designed for. -- Robert Kern "I hav

Re: need help with ODE solver from scipy

2007-04-24 Thread Robert Kern
> Although, to be fair this is after the output from one iteration: > > array([0.01, 1. , 1. ]) > > So, clearly this isn't working right. Does anyone have any experience > using this function or anything they can contribute? I tried your example and it worked for me (af

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