Re: Convertimg a Sequence of Images to an AVI File

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, W. eWatson wrote: > I'd like to simply take the large images out of the file and make an avi > file from them. What in Python will help me do that? Probably easier to just use FFmpeg from the command line. -- http://mail.python.org/mailman/listinfo/python-list

New FIT implementation in Python

2008-10-17 Thread Eddy Pronk
I've been working on a new FIT implementation in Python. Design goals/ideas : * A table is a list of lists. * Flow mode for DoFixtures part of design. * Eliminate need for _typeDict * uses a XML parser (minidom) * unit tests use wiki syntax instead of HTML. * most unit tests run without HTML depe

Re: Help with Iteration

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 10:44 pm, Chris McComas <[EMAIL PROTECTED]> wrote: > i have a python script that is computing ratings of sports teams. > > what i'm trying to do is setup an iteration for the rating so that the > python program recomputes the rating if any of the value difference is > > > 0.5. it's c

Re: Parsing a file with iterators

2008-10-17 Thread George Sakkis
On Oct 17, 12:45 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 17 Oct 2008 11:42:05 -0400, Luis Zarrabeitia wrote: > > I need to parse a file, text file. The format is something like that: > > > TYPE1 metadata > > data line 1 > > data line 2 > > ... > > data line N > > TYPE2 met

Some Problem about Moin

2008-10-17 Thread Kara
Hi,everyone.I'm a greenhand on Moin.I want to change my left-side of index like Python.org that if you click one link in left-Side, it will show sub-dirs under the link.So would you give me some "practise in action" or ideas? thanks -- http://mail.python.org/mailman/listinfo/python-list

ANN: pyparsing 1.5.1 released

2008-10-17 Thread Paul McGuire
I've just uploaded to SourceForge and PyPI the latest update to pyparsing, version 1.5.1. It has been a couple of months since 1.5.0 was released, and a number of bug-fixes and enhancements have accumulated in SVN, so time for a release! Here's what's new in Pyparsing 1.5.1: - Added __dir__() me

Help with Iteration

2008-10-17 Thread Chris McComas
i have a python script that is computing ratings of sports teams. what i'm trying to do is setup an iteration for the rating so that the python program recomputes the rating if any of the value difference is > 0.5. it's common for sports ratings to run such iterations... any tips, pointers on

Re: algorizm to merge nodes

2008-10-17 Thread bearophileHUGS
JD: > Thanks, > This one really works. Note that you can save some RAM (almost half) creating a directed graph, because later the connectedComponents() manages the arcs as undirected anyway: >>> from graph import Graph >>> g = Graph() >>> data = [['a', 'b'], ['c', 'd'], ['e', 'f'], ['a', 'g'], ['

Re: algorizm to merge nodes

2008-10-17 Thread JD
It could be a very good "homework assignmet". This is for a real application. each item in the list represent two terminals of a resistor. All the resistors in the list are shorted, I need to figure out how many independent nets are there. JD On Oct 17, 4:16 pm, Paul McGuire <[EMAIL PROTECTED]>

Earn 1000$ to 10000$ in Every Month.

2008-10-17 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. Right side Of The Blog Awsurvey Banner will appear. click on the banner and get a free signup with 6$ bonus and you will get more surveys. once you have completed one survey you will get minimem 4$ and more left side of the blog

Re: algorizm to merge nodes

2008-10-17 Thread Gerard flanagan
JD wrote: Hi, I need help for a task looks very simple: I got a python list like: [['a', 'b'], ['c', 'd'], ['e', 'f'], ['a', 'g'], ['e', 'k'], ['c', 'u'], ['b', 'p']] Each item in the list need to be merged. For example, 'a', 'b' will be merged, 'c', 'd' will be merged. Also if the node in

Re: algorizm to merge nodes

2008-10-17 Thread Mensanator
On Oct 17, 4:34 pm, JD <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks, > > It works for this example, > > but if I add another item ['e', 'd']: > [['a', 'b'], \ >      ['c', 'd'], \ >      ['e', 'f'], \ >      ['a', 'g'], \ >      ['e', 'k'], \ >      ['c', 'u'], \ >      ['b', 'p'],\ >      ['e', 'd'

Re: bibtex parsing

2008-10-17 Thread Paul McGuire
On Oct 17, 6:43 pm, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On 10/17/2008 6:14 PM Paul McGuire apparently wrote: > > > Visit the pyparsing wiki for all sorts of applications.  Here is > > a BibTeX parser submitted by pyparsing wiki user ero-sennin: > >http://pyparsing.wikispaces.com/WhosUsingPypa

Re: Finding the instance reference of an object

2008-10-17 Thread MRAB
On Oct 17, 10:03 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 2:36 PM, Steve Holden wrote: > [big snip] > > I believe they are pretty much the same ass those of Icon, another > > non-standard interpreted language. > > They're also the same as RB, Java, .NET... I'm hoping somebody

Pan/Zoom with Matplotlib

2008-10-17 Thread Czenek
Hi, can I use somehow standard matplotlib's functions pan/zoom? I would like to zoom my created graph after double-clicking and move with it after keyboard (arrow) pressing (similar as Google Maps). And I want also to control how much it zooms and how far is the graph moved after pressing a key (or

Re: bibtex parsing

2008-10-17 Thread Alan G Isaac
On 10/17/2008 6:14 PM Paul McGuire apparently wrote: Visit the pyparsing wiki for all sorts of applications. Here is a BibTeX parser submitted by pyparsing wiki user ero-sennin: http://pyparsing.wikispaces.com/WhosUsingPyparsing#pybtex I don't know what the license is. GPL unfortunately. Thank

Re: Antigravity module needed.

2008-10-17 Thread Matt Nordhoff
Terry Reedy wrote: > If Python added an antigravity module to the stdlib, > what should it say or do? See > http://xkcd.com/353/ > (and let your mouse hover). It was added 2 days ago. :-P -- -- http://mail.python.org/mailm

Re: Finding the instance reference of an object

2008-10-17 Thread George Sakkis
On Oct 17, 5:19 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-10-17, Joe Strout <[EMAIL PROTECTED]> wrote: > > > And my real point is that this is exactly the same as in every > > other modern language. ^ > No, it isn't. In many other languages (C, Pascal, etc.)

Re: Python logging and ThreadingTCPServer

2008-10-17 Thread Vinay Sajip
On Oct 17, 5:48 pm, Daniel <[EMAIL PROTECTED]> wrote: > Hello, > > I building an application that consists of several sockets > components. I would like to useloggingin them, but I've noticed > some issues with the logs getting mangled. This mangling seems to > happen when different threads attem

Re: Convertimg a Sequence of Images to an AVI File

2008-10-17 Thread W. eWatson
W. eWatson wrote: I have a file of images shot at a frame rate of 1/30th of a second. They are 640 by 480 bytes followed immediately by up to 200 smaller images 128x128 pixels. The software I'm using will convert this into a mov file. I'd like to simply take the large images out of the file and

Re: 'Hidden Features of Python'

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 11:00 am, coldpizza <[EMAIL PROTECTED]> wrote: > Having read through the link below I finally managed to grasp some > concepts that I only read about in the docs but never got to really > understand. Maybe it will be helpful for people like myself who are > not yet fully comfortable with

Re: chomp?

2008-10-17 Thread Timothy Grant
On Fri, Oct 17, 2008 at 3:37 PM, Matt Herzog <[EMAIL PROTECTED]> wrote: > Hey Pythons. > > This script works fine except I would like it to NOT print everything on a > newline. > How can I tell print to chomp? > > Thanks. > > --- snip >

Re: Need advice on python importing

2008-10-17 Thread George Sakkis
On Oct 17, 12:19 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I started with a module with a bunch of classes that represent database > tables. A lot of these classes have methods that use other classes > inside, sort of like this: > > class C(object): > @classmethod > def

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { >     call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

chomp?

2008-10-17 Thread Matt Herzog
Hey Pythons. This script works fine except I would like it to NOT print everything on a newline. How can I tell print to chomp? Thanks. --- snip - #!/usr/bin/python import time import sys def getload(): f = open('/p

Re: Finding the instance reference of an object

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 4:03 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 2:36 PM, Steve Holden wrote: snip > And here, you're doing an assignment -- this is the only test of the   > three that tests whether the parameter is passed by reference or by   > value.  The result: it's by value. > >

Re: Parsing a file with iterators

2008-10-17 Thread James Harris
On 17 Oct, 16:42, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > I need to parse a file, text file. The format is something like that: > > TYPE1 metadata > data line 1 > data line 2 > ... > data line N > TYPE2 metadata > data line 1 > ... > TYPE3 metadata > ... > > And so on. The type and metadata d

Re: Need advice on python importing

2008-10-17 Thread Matthew Wilson
On Fri 17 Oct 2008 04:52:47 PM EDT, Steve Holden wrote: > Matthew Wilson wrote: >> I started with a module with a bunch of classes that represent database >> tables. A lot of these classes have methods that use other classes >> inside, sort of like this: >> >> class C(object): >> @cla

Re: algorizm to merge nodes

2008-10-17 Thread Paul McGuire
On Oct 17, 3:20 pm, JD <[EMAIL PROTECTED]> wrote: > Hi, > > I need help for a task looks very simple: > I smell "homework assignment". -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Antigravity module needed.

2008-10-17 Thread Terry Reedy
If Python added an antigravity module to the stdlib, what should it say or do? See http://xkcd.com/353/ (and let your mouse hover). -- http://mail.python.org/mailman/listinfo/python-list

Re: bibtex parsing

2008-10-17 Thread Paul McGuire
On Oct 17, 4:18 pm, Alan G Isaac <[EMAIL PROTECTED]> wrote: > Can anyone recommend a pure Python parser > of BibTeX files? Ideally MIT or BSD licensed? > > Online search some possibilities: http://svn.plone.org/svn/collective/bibliograph.parsing/trunk/bibliog... http://www.geocities.com/fiolj/bibte

Re: bibtex parsing

2008-10-17 Thread Robert Kern
Alan G Isaac wrote: Also, there was a rumor that PyParsing was to become part of the standard library, but I do not see it at http://docs.python.org/modindex.html False rumor? False rumor. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is ma

Re: algorizm to merge nodes

2008-10-17 Thread JD
Thanks, This one really works. JD On Oct 17, 3:17 pm, [EMAIL PROTECTED] wrote: > JD, you probably need the algorithm for connected components of an > undirected graph. > > For example you can do that with my graph > lib:http://sourceforge.net/projects/pynetwork/ > > from graph import Graph > g

a new brawser (avant) it is very very good

2008-10-17 Thread mina2020
Avant Browser allows users to browse multiple Web sites simultaneously and to block all unwanted pop-up pages and Flash ads automatically. The integrated cleaner helps users clear all traces and maintain privacy. The built-in Yahoo and Google search engines enable users to search for Web pages, ima

Re: Finding the instance reference of an object

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: And my real point is that this is exactly the same as in every other modern language. No, it isn't. In many other languages (C, Pascal, etc.), a "variable" is commonly thought of as a fixed location in memory into which one can put values. Th

Re: algorizm to merge nodes

2008-10-17 Thread JD
Hi, Thanks, It works for this example, but if I add another item ['e', 'd']: [['a', 'b'], \ ['c', 'd'], \ ['e', 'f'], \ ['a', 'g'], \ ['e', 'k'], \ ['c', 'u'], \ ['b', 'p'],\ ['e', 'd']] The result is set(['a', 'p', 'b', 'g']), set(['e', 'c', 'u', 'd']), set([

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-17 Thread Carl Banks
On Oct 17, 4:25 am, Damien Wyart <[EMAIL PROTECTED]> wrote: > * Carl Banks <[EMAIL PROTECTED]> in comp.lang.python: > > > The python-mode.el on Subversion (python-mode's Subversion on source > > forge, not the ancient version of python-mode in the Python > > repository) has a fix for this issue. It

Re: Finding the instance reference of an object

2008-10-17 Thread Grant Edwards
On 2008-10-17, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 2:36 PM, Steve Holden wrote: >> You problem seems to be that you ar still stuck with the >> notion of a name as a reference to a specific area of memory. >> Which it's not, excepting only if you want to consider the >> area

bibtex parsing

2008-10-17 Thread Alan G Isaac
Can anyone recommend a pure Python parser of BibTeX files? Ideally MIT or BSD licensed? Online search some possibilities: http://svn.plone.org/svn/collective/bibliograph.parsing/trunk/bibliograph/parsing/parsers/bibtex.py http://www.geocities.com/fiolj/bibtexparse.html http://www.cis.udel.edu/~sp

Re: algorizm to merge nodes

2008-10-17 Thread bearophileHUGS
JD, you probably need the algorithm for connected components of an undirected graph. For example you can do that with my graph lib: http://sourceforge.net/projects/pynetwork/ from graph import Graph g = Graph() data = [['a', 'b'], ['c', 'd'], ['e', 'f'], ['a', 'g'], ['e', 'k'], ['c', 'u'], ['b',

python-ldap reading an OU with more than 1000 objects

2008-10-17 Thread Erick Perez - Quadrian Enterprises, S.A.
Hi, I have a MS Windows AD domain, and have one OU with more tan 1000 users objects. When I try to read it, I hit the 1000 limit of AD while returning objects, so I'm asking for advice as to how to read them. Here is my actual code, it is not the cleanest as I am learning python. Suggestions are we

Re: algorizm to merge nodes

2008-10-17 Thread Mensanator
On Oct 17, 3:20 pm, JD <[EMAIL PROTECTED]> wrote: > Hi, > > I need help for a task looks very simple: > > I got a python list like: > > [['a', 'b'], ['c', 'd'], ['e', 'f'], ['a', 'g'], ['e', 'k'], ['c', > 'u'], ['b', 'p']] > > Each item in the list need to be merged. > > For example, 'a', 'b' will

Re: Finding the instance reference of an object

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 2:36 PM, Steve Holden wrote: No, a "by ref" parameter would mean that this: def foo(ByRef x): x = x + [42] a = [1,2,3] foo(a) ...would result in a = [1,2,3,42]. In [8]: def foo(x): ...: x += [42] ...: In [9]: a = [1, 2, 3] In [10]: foo(a) In [11]: a Out[11]:

Re: algorizm to merge nodes

2008-10-17 Thread JD
Hi, Thanks for the help, but the result is not quite right: [['a', 'b', 'g'], ['c', 'd', 'u'], ['b', 'p'], ['e', 'f', 'k']] the ['b', 'p'] is not merged. JD On Oct 17, 2:35 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > (Disclaimer: completely untested) > > from collections import defaultdic

Re: Python certification

2008-10-17 Thread Bruno Desthuilliers
srinivasan srinivas a écrit : Hi, I m planning to do certification in Python?? Is therr any good certification available in Python like Sun certification for java?? Yes, indeed : actively contribute to some major python project (or even better to the language itself or its stdlib), and become

Re: Need advice on python importing

2008-10-17 Thread Steve Holden
Matthew Wilson wrote: > I started with a module with a bunch of classes that represent database > tables. A lot of these classes have methods that use other classes > inside, sort of like this: > > class C(object): > @classmethod > def c1(cls, a): > return a > >

Re: Parsing a file with iterators

2008-10-17 Thread Paul McGuire
On Oct 17, 10:42 am, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > I need to parse a file, text file. The format is something like that: > > TYPE1 metadata > data line 1 > data line 2 > ... > data line N > TYPE2 metadata > data line 1 > ... > TYPE3 metadata > ... > > And so on. The type and metadat

Re: Finding the instance reference of an object

2008-10-17 Thread Steve Holden
Joe Strout wrote: > On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: [much blether] >>> Side question, for my own education: *does* Python have a "ByRef" >>> parameter mode? >>> >> As far as I'm concerned -- everything is "by ref" in Python... > > No, a "by ref" parameter would mean that

Re: algorizm to merge nodes

2008-10-17 Thread Chris Rebert
(Disclaimer: completely untested) from collections import defaultdict merged = defaultdict(list) for key, val in your_list_of_pairs: merged[key].append(val) result = [[key]+vals for key, vals in merged.items()] Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com On Fri,

Re: Python certification

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Ben Finney wrote: > srinivasan srinivas <[EMAIL PROTECTED]> writes: > >> I m planning to do certification in Python?? > > Why the question marks? Are you asking us whether this is true? Perhaps he's one of those people who end sentences with a rising inflection?

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Helmut Jarausch
Ross Ridge wrote: Helmut Jarausch <[EMAIL PROTECTED]> wrote: # but this ugly one (to be done for each output file) sys.stdout._encoding='latin1' Is this writable "_encoding" attribute, with a leading underscore (_), documented anywhere? Does it actually work? Would it happen to be supported

Re: Interface to Matlab

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Daniel wrote: > Have you looked at > http://www.scipy.org/ > and http://matplotlib.sourceforge.net/ > > They do an awful lot of what matlab does. This one I think rolls them all up into a package that does even more. > Also, I think tha

Re: 'Hidden Features of Python'

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Kurt Smith wrote: > For more fun with the Zen, see this thread: > > http://mail.python.org/pipermail/python-bugs-list/2008-July/055857.html For someone complaining about improperly-spaced punctuation, they can't spell "orthographical". :) -- Lawrence "Skitt's La

algorizm to merge nodes

2008-10-17 Thread JD
Hi, I need help for a task looks very simple: I got a python list like: [['a', 'b'], ['c', 'd'], ['e', 'f'], ['a', 'g'], ['e', 'k'], ['c', 'u'], ['b', 'p']] Each item in the list need to be merged. For example, 'a', 'b' will be merged, 'c', 'd' will be merged. Also if the node in the list sha

Re: default value in __init__

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Fri, 17 Oct 2008 23:04:52 +1300, Lawrence D'Oliveiro wrote: > >> The right solution, of course, is >> >> fns = [(lambda x : lambda : x)(x) for x in range(10)] > > Only if by "right solution" you mean "excessively verbose, confusing

Re: default value in __init__

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Aaron "Castironpi" Brady wrote: > The purpose of a parameter is something that the caller can supply, but > doesn't have to. It is not for internal-use-only items. Exactly! -- http://mail.python.org/mailman/listinfo/python-list

Re: xor: how come so slow?

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Sion Arrowsmith wrote: > Maybe it should be "fewer random data". Except these days we tend to think of "data" being, say, more like "flour" than "bees", so it's "less data", like "less flour", rather than like "fewer bees". :) > After all, each byte in the block i

PythonWin --> drwatson

2008-10-17 Thread Frank L. Thiel
I have installed PythonWin from the distribution. When I try to open it, the message "PyWin32 has encountered a problem ..." appears, and a drwatson error report is generated. Python 2.6 itself, from a cmd window or using IDLE, works without problem. I cannot find any reports of similar beh

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Joe Strout
Thanks for the answers. That clears things up quite a bit. What if your source file is set to utf-8? Do you then have a proper UTF-8 string, but the problem is that none of the standard Python library methods know how to properly interpret UTF-8? Well, the decode method knows how to decode t

Re: Finding the instance reference of an object

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 1:03 PM, Aaron Castironpi Brady wrote: I'm not fluent in Java so you'll have to be the judge. In Python: b= 0 f( b ) No matter what, b == 0. C doesn't guarantee this. It does, unless f's parameter has been declared a reference parameter. (In C++, you'd do this with '

Re: Finding the instance reference of an object

2008-10-17 Thread Benjamin Kaplan
On Fri, Oct 17, 2008 at 3:03 PM, Aaron Castironpi Brady < [EMAIL PROTECTED]> wrote: > On Oct 17, 10:56 am, Joe Strout <[EMAIL PROTECTED]> wrote: > > On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: > snip > > >But, it seems, you are the only one arguing that "the semantics are > > > all

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 11:32:36 -0600, Joe Strout wrote: > On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote: > >>> kw = 'генских' >>> >> What do you mean by "does not work"? And you are aware that the above >> snipped doesn't involve any unicode characters!? You have a byte >> string t

Re: properties access by name

2008-10-17 Thread Дмитрий Гордеев
Thanks! that works now! On Fri, Oct 17, 2008 at 9:11 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > Since rwproperty appears to use descriptors just like regular > property(), you'd do it the same way as for any normal attribute, > namely: > > #for reading > print foo.y > #is the same as > print ge

Re: Finding the instance reference of an object

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 10:56 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: snip > >    But, it seems, you are the only one arguing that "the semantics are > > all the same"... Doesn't that suggest that they aren't the same? > > No, it suggests to me that the

Re: Interface to Matlab

2008-10-17 Thread Robert Kern
Claire Mouton wrote: Hi, I would like to call Python functions from Matalab. How could I find an interface from Matlab to Python? http://mlabwrap.sourceforge.net/ -- 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

Re: Normalizing arguments

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 12:37 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > On Oct 17, 6:17 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > > Why do you want/need this magical g() function considering that, as > > you yourself point out, Python already performs this normalization for > > you? > > A caching idea

Re: Trying to install module, No module named scipy_distutils.core (but i have scipy)

2008-10-17 Thread Robert Kern
process wrote: trying to install PyKF-0.1 (Kalman Filters) http://pykf.sourceforge.net/ I have Numpy, Scipy, Matplotlib installed an have successfully installed other packages using them. $ setup.py Traceback (most recent call last): File "./setup.py", line 2, in from scipy_distutils.

Re: Log Exception with Backtrace

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 9:40 AM, Heston James - Cold Beans <[EMAIL PROTECTED]> wrote: > Afternoon Guys, > > I'm currently logging exceptions within my applications like so: > > try: > #do something > except Exception, error: > # Log the exception. > self.logger.error("Exception Occu

Re: default value in __init__

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 6:56 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 17 Oct 2008 23:04:52 +1300, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > > >> We already get people asking why code like this doesn't return 3: > > > fns = [ lambd

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { > call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { >     call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: properties access by name

2008-10-17 Thread Rob Williscroft
=?KOI8-R?B?7cnU0Q==?= wrote in news:f1a77a69-2997-4f53-9a46- [EMAIL PROTECTED] in comp.lang.python: > > class Film(object): > def __init__(self, title): > self.__title = title > > @getproperty > def title(self): > return self.__title > @setproperty > def title

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
I'm kind of an idiot, i just realized the problem. Sorry for wasting your time, and thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Normalizing arguments

2008-10-17 Thread Dan Ellis
On Oct 17, 6:17 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > Why do you want/need this magical g() function considering that, as > you yourself point out, Python already performs this normalization for > you? A caching idea I'm playing around with. @cache def some_query(arg1, arg2): # May

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Christian Heimes
Robocop wrote: I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The line in question is: for li

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
On Oct 17, 10:27 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > > I have a simple little script that reads in postscript code, appends > > it, then writes it to a new postscript file.  Everything worked fine a > > month ago, bu

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
On Oct 17, 10:27 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > > I have a simple little script that reads in postscript code, appends > > it, then writes it to a new postscript file.  Everything worked fine a > > month ago, bu

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote: kw = 'генских' What do you mean by "does not work"? And you are aware that the above snipped doesn't involve any unicode characters!? You have a byte string there -- type `str` not `unicode`. Just checking my understanding he

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Philip Semanchuk
On Oct 17, 2008, at 1:07 PM, Robocop wrote: I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > I have a simple little script that reads in postscript code, appends > it, then writes it to a new postscript file. Everything worked fine a > month ago, but after rearranging my directory tree a bit my script > fails to find t

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 13:07:38 -0400, gita ziabari wrote: > The following code does not work for unicode characters: > > keyword = dict() > kw = 'генских' > keyword.setdefault(key, []).append (kw) > > It works fine for inserting ASCII character. Any suggestion? What do you mean by "does not work"

Re: [ANN] Data Plotting Library DISLIN 9.4

2008-10-17 Thread M�ta-MCI (MVP)
Merci beaucoup. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Normalizing arguments

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 8:37 AM, Dan Ellis <[EMAIL PROTECTED]> wrote: > Given some function, f(a, b, c=3), what would be the best way to go > about writing a function, g(f, *args, **kwargs), that would return a > normalized tuple of arguments that f would receive when calling > f(*args, **kwargs)?

Re: properties access by name

2008-10-17 Thread Chris Rebert
Since rwproperty appears to use descriptors just like regular property(), you'd do it the same way as for any normal attribute, namely: #for reading print foo.y #is the same as print getattr(foo, "y") #for writing foo.x = 1 #is the same as setattr(foo, "x", 1) Cheers, Chris -- Follow the path

Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The line in question is: for line in fileinput.i

inserting Unicode character in dictionary - Python

2008-10-17 Thread gita ziabari
Hello All, The following code does not work for unicode characters: keyword = dict() kw = 'генских' keyword.setdefault(key, []).append (kw) It works fine for inserting ASCII character. Any suggestion? Thanks, Gita -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface to Matlab

2008-10-17 Thread Daniel
On Oct 17, 8:48 am, Claire Mouton <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to call Python functions from Matalab. > How could I find an interface from Matlab to Python? > > Cheers, > Claire Hey, Have you looked at http://www.scipy.org/ and http://matplotlib.sourceforge.net/ They do an a

Re: Normalizing arguments

2008-10-17 Thread Dan Ellis
On Oct 17, 5:13 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > You'd get a lot further a lot faster by looking at the documentation for > the inspect module instead. Yeah, I've looked at that already, but it only gives (in a nicer way) the information I already have from the function object and it

Re: 'Hidden Features of Python'

2008-10-17 Thread Kurt Smith
On Fri, Oct 17, 2008 at 11:48 AM, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 10:35 AM, coldpizza wrote: > >> If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR >> +click on 'this' should do the trick. >> In ipython you can do 'import this' and then type 'this??' O

Python logging and ThreadingTCPServer

2008-10-17 Thread Daniel
Hello, I building an application that consists of several sockets components. I would like to use logging in them, but I've noticed some issues with the logs getting mangled. This mangling seems to happen when different threads attempt to access the same log file. For example, if a client and a

Re: Parsing a file with iterators

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 11:42:05 -0400, Luis Zarrabeitia wrote: > I need to parse a file, text file. The format is something like that: > > TYPE1 metadata > data line 1 > data line 2 > ... > data line N > TYPE2 metadata > data line 1 > ... > TYPE3 metadata > ... > […] > because when the parser iterat

Re: 'Hidden Features of Python'

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 10:35 AM, coldpizza wrote: If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR +click on 'this' should do the trick. In ipython you can do 'import this' and then type 'this??' Or if you are *not* lazy, you could try locating the file in the Python tree. Oh!

Log Exception with Backtrace

2008-10-17 Thread Heston James - Cold Beans
Afternoon Guys, I'm currently logging exceptions within my applications like so: try: #do something except Exception, error: # Log the exception. self.logger.error("Exception Occurred: (%s)" % str(error)) This is quite fine, however, sometimes I get very vague error

Spring Python 0.7.1 has been released

2008-10-17 Thread Goldfish
Spring Python, the python version of the Spring Framework, has just released version 0.7.1. This patch includes integration with S3, Spring's new service used to distribute binaries. Key Features of Spring Python include: * Inversion Of Control - The idea is to decouple two classes at the inte

properties access by name

2008-10-17 Thread Митя
I use rwproperty (http://pypi.python.org/pypi/rwproperty/1.0) and so I have properties in my class. Also I have a list of names of properties wich I am to set. How can I access my properties by name in such way that when I want to set a property, setter will be called, and and when I want to read i

Re: 'Hidden Features of Python'

2008-10-17 Thread coldpizza
If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR +click on 'this' should do the trick. In ipython you can do 'import this' and then type 'this??' Or if you are *not* lazy, you could try locating the file in the Python tree. > import this > # btw look at this module's source :)

Re: Parsing a file with iterators

2008-10-17 Thread Eddie Corns
Luis Zarrabeitia <[EMAIL PROTECTED]> writes: >I need to parse a file, text file. The format is something like that: >TYPE1 metadata >data line 1 >data line 2 >... >data line N >TYPE2 metadata >data line 1 >... >TYPE3 metadata >... >And so on. The type and metadata determine how to parse the fol

Need advice on python importing

2008-10-17 Thread Matthew Wilson
I started with a module with a bunch of classes that represent database tables. A lot of these classes have methods that use other classes inside, sort of like this: class C(object): @classmethod def c1(cls, a): return a class D(object): def d1(self, a

Re: 'Hidden Features of Python'

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 10:00 AM, coldpizza wrote: http://stackoverflow.com/questions/101268/hidden-features-of-python Thanks, there are a lot of useful nuggets there. However, can anybody explain the "Main messages" one? It doesn't include any explanatory text at all, just a code snippet:

Re: Normalizing arguments

2008-10-17 Thread Steve Holden
Dan Ellis wrote: > Given some function, f(a, b, c=3), what would be the best way to go > about writing a function, g(f, *args, **kwargs), that would return a > normalized tuple of arguments that f would receive when calling > f(*args, **kwargs)? By normalized, I mean that the result would always >

  1   2   >