Re: HP open source printer drivers are in Python

2006-01-13 Thread Fredrik Lundh
Ben Finney wrote: > > I have a specific question, anybody is familiar? > > Only the omniscient, prescient or telepathic can be familiar with your > question before you ask it. so if I know that I'm not familiar with HP's printer drivers, I'm omniscient ? or is it telepathy that makes it possible

File Navigation using python

2006-01-13 Thread Danielsen Brian (IFR Contractor External)
Does anyone know how to do file navigation between drives? I know how to navigate up and down within a drive (for example the C:\ drive), but I don't know how to change drives. I'm looking for something like: os.chgdrv('d:\') Help Brian L. Danielsen

Re: Real-world use cases for map's None fill-in feature?

2006-01-13 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > > I see at least a few cases of > > map(None, field_names, values) > > but it's not clear what the expectation is for the size of the two lists. >... > Thanks for the additional datapoint. I'm most interested in the code > surrounding the few c

Re: atexit + threads = bug?

2006-01-13 Thread skip
David> What would be unreasonable about adding a David> join_nondaemonic_threads() David> call before the call to David> call_sys_exitfunc() David> near the beginning of Py_Finalize? David> Instead of _MainThread.__exitfunc having to rely on David> atexit.register

Re: flatten a level one list

2006-01-13 Thread Peter Otten
Michael Spencer wrote: > Peter Otten wrote: > >> If you require len(xdata) == len(ydata) there's an easy way to move the >> loop into C: >> >> def flatten7(): >> n = len(xdata) >> assert len(ydata) == n >> result = [None] * (2*n) >> result[::2] = xdata >> result[1::2] = ydata

Re: Help me in this please--is Python the answer?

2006-01-13 Thread Ray
bruno at modulix wrote: > Possibly - but if a programmer is not able to pick on Python in a matter > of days, then it's a bad programmer that won't be of any help whatever > the language. So in fact, choosing Python may help you get better > programmers !-) You have a point there! :) > You may a

Limiting the size of List and making it Homogeneous

2006-01-13 Thread ankit
Is it possible to limit the size of list in python. I want to make list of 5 elements. How can I achieve this thing in python. And one more thing can we declare list to store elements of same type as in c, C++ we can declare an array which can have 5 elements of type int. C, C++: int intarr[5]

Re: Spelling mistakes!

2006-01-13 Thread Antoon Pardon
Op 2006-01-12, [EMAIL PROTECTED] schreef <[EMAIL PROTECTED]>: > > Antoon> But now we are back to my first doubt. Sure unit test will be > Antoon> helpfull in finding out there is a bug. I doubt they are that > Antoon> helpfull in tracking the bug (at least this kind). > > This thread se

Re: How to get Windows system information?

2006-01-13 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > Does anybody know how to get the: > > Free hard disk space > Amount of CPU load > and Amount of RAM used > > on windows? I am making an artificial intelligence program that has > "moods" based on how much stress the system is under, based on these > param

Re: Limiting the size of List and making it Homogeneous

2006-01-13 Thread Erik Max Francis
ankit wrote: > Is it possible to limit the size of list in python. > I want to make list of 5 elements. How can I achieve this thing in > python. And one more thing can we declare list to store elements of > same type as in c, C++ we can declare an > array which can have 5 elements of type int. >

Re: Help me in this please--is Python the answer?

2006-01-13 Thread Fredrik Lundh
Adrian Holovaty wrote: > I would never use TurboGears or Ruby on Rails over Django for any > performance-intensive Web app. In my opinion, both frameworks make some > poor design decisions regarding the importance of performance. I hope you're aware that this sounds a lot like late 90's anti-dyna

Re: Help with super()

2006-01-13 Thread Steven Bethard
David Hirschfield wrote: > Here's an example that's giving me trouble, I know it won't work, but it > illustrates what I want to do: > > class A(object): >_v = [1,2,3] > def _getv(self): >if self.__class__ == A: >return self._v >return super(self.__class__,sel

Re: Help me in this please--is Python the answer?

2006-01-13 Thread Ray
Fredrik Lundh wrote: > I hope you're aware that this sounds a lot like late 90's anti-dynamic- > language propaganda... > > "I would never use Perl or Python over C++ for any performance- > "intensive Web app. In my opinion, both languages make some > poor design decisions regarding th

Re: flatten a level one list

2006-01-13 Thread Peter Otten
[EMAIL PROTECTED] wrote: >> Creating a list via list/map/filter just for the side effect is not only >> bad taste, >> >> ~ $ python -m timeit -s'a = zip([range(1000)]*2)' 'lst=[];ext=lst.extend' >> 'for i in a: ext(i)' >> 100 loops, best of 3: 1.23 usec per loop >> ~ $ python -m timeit -s'a =

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread gene tani
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? > Although the statement: > ++j > works but does nothing "+=1" and "-=1" inflate your KLOC by .001, but they always work as expected with integers, it's when you do augmented assignments

Re: Template language with XPath support for source code generation?

2006-01-13 Thread Stefan Behnel
bruno at modulix wrote: > Stefan Behnel wrote: >> I need to generate source code (mainly Java) from a domain specific XML >> language, preferably from within a Python environment (since that's where the >> XML is generated). >> >> I tried using XSLT, but I found that I need a template system that s

Re: Limiting the size of List and making it Homogeneous

2006-01-13 Thread gene tani
gene tani wrote: > ankit wrote: > > Is it possible to limit the size of list in python. > > I want to make list of 5 elements. How can I achieve this thing in > > python. And one more thing can we declare list to store elements of > > same type as in c, C++ we can declare an > > array which can ha

Re: Newcomer question wrt variable scope/namespaces

2006-01-13 Thread gene tani
Florian Daniel Otel wrote: > Hello all, > > > Attached are 3 small python scripts that illustrate my "problem". The > first one uses string tuples and behaves as expected. The other two > use dictionaries and (resp.) lists and illustrate my "problem" > > TIA for any pointers, > > Florian > > P.S.

Re: flatten a level one list

2006-01-13 Thread Peter Otten
[EMAIL PROTECTED] wrote: > David Murmann wrote: >> > # New attempts: >> > from itertools import imap >> > def flatten4(x, y): >> > '''D Murman''' >> > l = [] >> > list(imap(l.extend, izip(x, y))) >> > return l >> well, i would really like to take credit for these, but they're >>

Changing fill in tkinter

2006-01-13 Thread venk
Hi, I would like to know how to change the fill of things we put in a tkinter's canvas. for example, if i create a rectangle and i would want to change the fill of the rectangle once it is clicked... can we do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten a level one list

2006-01-13 Thread bonono
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > David Murmann wrote: > > >> > # New attempts: > >> > from itertools import imap > >> > def flatten4(x, y): > >> > '''D Murman''' > >> > l = [] > >> > list(imap(l.extend, izip(x, y))) > >> > return l > > >> well, i would really lik

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson writes: > >>[EMAIL PROTECTED] wrote: >> >>>The reason is that I am still trying to figure out >>>what a value is myself. Do all objects have values? >> >>Yes. > > > Can you justify this, other than by quoting the manual whose problems > caused this question to be

Re: Options enabled under optimization

2006-01-13 Thread Fredrik Lundh
"Naveen H.S." <[EMAIL PROTECTED]> wrote: > I had mailed yesterday about the following topic to know the flags or > options that are enabled when -O,-O2,-O3,-Os options are enabled. > As mentioned below I was given this mail id to contact. Unfortunately, you seem to have missed the relevant portio

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> The reason is that I am still trying to figure out >> what a value is myself. Do all objects have values? > Yes. Can you justify this, other than by quoting the manual whose problems caused this question to be raised in the fir

Re: flatten a level one list

2006-01-13 Thread bonono
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > David Murmann wrote: > > >> > # New attempts: > >> > from itertools import imap > >> > def flatten4(x, y): > >> > '''D Murman''' > >> > l = [] > >> > list(imap(l.extend, izip(x, y))) > >> > return l > > >> well, i would really lik

Re: Restart process with SIGHUP

2006-01-13 Thread LukasMeyerUK
Got it working now. It was a silly character pid instead of an int.. int(pid) fixed it. Thanks anyway! regards, Lukas -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-13 Thread Antoon Pardon
Op 2006-01-12, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: [ BIG CUT ] I'm going to drop this part. I disagree with you and think I can show some of your argument invalid. Hoever I also doubt somethi

Re: how do "real" python programmers work?

2006-01-13 Thread Alan J. Salmoni
Hi Brian, I'm sure I don't qualify as an "experienced Python programmer", but I write lots of code usually for statistical analysis (via numarray) or for GUI work. The way I work is to use an editor and Idle for interactive testing of small routines. My choice of editor is SciTE. I'll have diffe

Re: Limiting the size of List and making it Homogeneous

2006-01-13 Thread gene tani
ankit wrote: > Is it possible to limit the size of list in python. > I want to make list of 5 elements. How can I achieve this thing in > python. And one more thing can we declare list to store elements of > same type as in c, C++ we can declare an > array which can have 5 elements of type int. >

Re: how do "real" python programmers work?

2006-01-13 Thread bruno at modulix
Barbier de Reuille Pierre wrote: > On 12 Jan 2006 12:20:50 -0800 > "bblais" <[EMAIL PROTECTED]> wrote: > > >>Hello, >> (snip) > > > Well, I think it will depend on your project ... > If you're developing GUI application, you will have trouble using the > python shell. At least you will need a s

Re: Converting a string to an array?

2006-01-13 Thread Paul Rubin
Tim Chase <[EMAIL PROTECTED]> writes: > The closest hack I could come up with was > > import random > s = "abcdefg" > a = [] > a.extend(s) > random.shuffle(a) > s = "".join(a) You could use import random s = list("abcdefg") random.shuff

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Duncan Booth
Bengt Richter wrote: > You are right, but OTOH the OP speaks of a "flagging" the dict as > modified. If she made e.g., "modified" a property of the dict > subclass, then retrieving the the "modified" "flag" could dynamically > check current state repr vs some prior state repr. Then the question >

Re: Reading from input file.

2006-01-13 Thread Sheldon
Sorry Mike, after seeing so many "experts" beat up others for not being as "smart" as they are, I intrepreted your words incorrectly - my apologies. I am not in the least bit against impproving my programming. I liked what you did and thanks for the pointers. Sheldon -- http://mail.python.org/ma

Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Krish
Thanks Jon Much I will implement your method for the time being. I am sure there is some method which doesn't copy the data but uses the existing data. I mean essentially we should build a PyArrayObject with the data intact and other parameters filled. If someone sheds some light, would be awesom

Re: decode unicode string using 'unicode_escape' codecs

2006-01-13 Thread Steven Bethard
aurora wrote: > I have some unicode string with some characters encode using python > notation like '\n' for LF. I need to convert that to the actual LF > character. There is a 'unicode_escape' codec that seems to suit my purpose. > encoded = u'A\\nA' decoded = encoded.decode('unicod

Re: Changing fill in tkinter

2006-01-13 Thread Eric Brunel
On 13 Jan 2006 01:43:42 -0800, venk <[EMAIL PROTECTED]> wrote: > Hi, > I would like to know how to change the fill of things we put in a > tkinter's canvas. for example, if i create a rectangle and i would want > to change the fill of the rectangle once it is clicked... can we do > that? Not

Re: different versions for 2.3.4 documentation

2006-01-13 Thread Manlio Perillo
Martin v. Löwis ha scritto: > Manlio Perillo wrote: > >>I'm only a bit curious, but why documentation from >>http://www.python.org/ftp/python/2.3.4/Python-2.3.4.tar.bz2 >>and >>http://www.python.org/ftp/python/doc/2.3.4/latex-2.3.4.tar.bz2 >>differ? > > > It appears that the latex-* set really c

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Sybren Stuvel
Mike Meyer enlightened us with: >> I think type 'object' has only one value, so that's it. > > In that case, they should all be equal, right? > object() == object() > False You compare instances of the type 'object'. They both have one value: >>> object() >>> object() So the claim "type '

Re: Newbie with some doubts.

2006-01-13 Thread Peter Maas
Claudio Grondi schrieb: >> Im newbie to Python (I found it three weeks ago) , in fact Im newbie to >> programming. I'm being reading and training with the language, but I >> still wondering about what Classes are used to. Could you please give >> me some examples?? [...] > I don't know any really g

Adding an extension class using C++

2006-01-13 Thread shlychkov
I'm building a C++ program that encapsulates Python inside and has a few extension classes with member variables and member functions. So far almost everything is successful, I'm able to run scripts through the utility, I can instantiate instances of my extension classes, I can read/write member va

Re: how do "real" python programmers work?

2006-01-13 Thread Barbier de Reuille Pierre
On 12 Jan 2006 12:20:50 -0800 "bblais" <[EMAIL PROTECTED]> wrote: > Hello, > > Let me start by saying that I am coming from a background using Matlab > (or Octave), and C++. I am going to outline the basic nuts-and-bolts > of how I work in these languages, and ask for some help to find out > how

Re: flatten a level one list

2006-01-13 Thread Robin Becker
Peter Otten wrote: .. > - You are padding twice -- once with None, and then with the real thing. > > def interleave2(*args, **kw): > dopad = "pad" in kw > pad = kw.get("pad") > count = len(args) > lengths = map(len, args) > maxlen = max(lengths) > if not dopad and

Re: Accessing Windows file metadata?

2006-01-13 Thread John Rhoads
Probably somebody more deeply into this will soon give you a better answer, but I'll try to give a better-than-nothing answer. The Properties metadata that you see in the shell can come from several places. The oldest, commonest source is from Microsoft Office files. These have a compound struc

Re: Freezing

2006-01-13 Thread bearophileHUGS
Raymond Hettinger: >I'm curious whether you've had an actual use for dictionaries as keys.< I've never had this need (probably because it's an unsupported thing to do too). >Likewise, how about frozensets? Have you had occasion to use them as keys? >They were created to support sets of sets,

Re: Changing fill in tkinter

2006-01-13 Thread venk
yes, it was a stupid mistake from my part in not pondering over the api fully. forgive me. anyways, ii was just looking for item configure. (I was spending all my time searching google rather than reading the api sincerely. duh...) -- http://mail.python.org/mailman/listinfo/python-list

Newcomer question wrt variable scope/namespaces

2006-01-13 Thread Florian Daniel Otel
Hello all, As the subject says, I am a newcomer to Python and I have a newcomer question wrt namespaces and variable scope. Obviously, I might be missing smth obvious, so TIA for the patience and/or pointers to relevant resources My problem: I just discovered (by mistake) that attempting to assig

Re: Help with super()

2006-01-13 Thread David Hirschfield
Yes, indeed that does work. I tried using __mro__ based on some code that showed how super() works in pure-python, but I got lost. I think this makes that clear...tho' I hate squishing around in instance innards like this... Thanks a bunch, I'm sure I'll have more questions, -Dave Paul McNett w

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Fredrik Lundh
Sybren Stuvel wrote: > Mike Meyer enlightened us with: > >> I think type 'object' has only one value, so that's it. > > > > In that case, they should all be equal, right? > > > object() == object() > > False > > You compare instances of the type 'object'. They both have one value: > > >>> obj

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-13 Thread Paul Boddie
Steve Holden wrote: > Michael Galvin wrote: > > To see an example of what I am trying to accomplish, look at this page > > on my personal website: > > > > http://mysite.verizon.net/michaelgalvin/jan06call.html > > > > I now realize my attachement could not be posted on this usenet group. > > > I su

Retrieve a GIF's palette entries using Python Imaging Library (PIL)

2006-01-13 Thread Stuart
I am using the Python Imaging Library (PIL) to process GIF images. I need to be able to retrieve the RGB values for each color palette entry. I see that the 'Image' class has a 'palette' attribute which returns an object of type 'ImagePalette'. However, the documentation is a bit lacking regar

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Roy Smith
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? Short answer: Because Guido didn't like them. Longer answer: Because they encourage people to write cryptic one-liners. There really isn't anything you can't write with them that you c

How to get Windows system information?

2006-01-13 Thread dpickles
Does anybody know how to get the: Free hard disk space Amount of CPU load and Amount of RAM used on windows? I am making an artificial intelligence program that has "moods" based on how much stress the system is under, based on these parameters. I think it could possibly be done vi

Re: Unicode style in win32/PythonWin

2006-01-13 Thread Robert
Thomas Heller schrieb: > "Robert" <[EMAIL PROTECTED]> writes: > > > Neil Hodgson wrote: > >> Robert: > >> > >> > After "is_platform_unicode = ", scintilla displays some unicode > >> > as you showed. but the win32-functions (e.g. MessageBox) still do not > >> > pass through wide unicode. > >> > >>

Re: Remote Function Call

2006-01-13 Thread Frithiof Andreas Jensen
"Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have two machines. A python program on machine 1 needs to make a > python call to a method in machine 2. What is the most efficient / fast Some Custom Mechanism: Pyro or SPREAD f.ex. > / programmer friendly way to do

Converting a string to an array?

2006-01-13 Thread Tim Chase
While working on a Jumble-esque program, I was trying to get a string into a character array. Unfortunately, it seems to choke on the following import random s = "abcefg" random.shuffle(s) returning File "/usr/lib/python2.3/random.py", line 250, in shuffle x[i]

Re: how do "real" python programmers work?

2006-01-13 Thread Ben Finney
Scott David Daniels <[EMAIL PROTECTED]> writes: > bblais wrote: >> How do experienced python programmers usually do it? Is there a >> "usually" about it, or is it up to personal taste? Are there any >> convenient ways of doing these things? > There are a lot of us who use a test-first process: >

Re: string to datetime parser?

2006-01-13 Thread beza1e1
A good solution may be to specify a language to determine the order. The default would be (something like) "en-US" and thus early October in the example. -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-13 Thread Mike Meyer
"bblais" <[EMAIL PROTECTED]> writes: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier.

Re: Converting a string to an array?

2006-01-13 Thread Bryan Olson
Tim Chase wrote: > While working on a Jumble-esque program, I was trying to get a string > into a character array. Unfortunately, it seems to choke on the following > > import random > s = "abcefg" > random.shuffle(s) > > returning > > File "/usr/lib/python2.3/random.py", line 25

Re: gracefully handling broken pipes (was Re: Converting a string toan array?)

2006-01-13 Thread Fredrik Lundh
Tim Chase wrote: > > >>> import random > > >>> s = "abcdefg" > > >>> data = list(s) > > >>> random.shuffle(data) > > >>> "".join(data) > > 'bfegacd' > > > > fit you better? > > Excellent! Thanks. I kept trying to find something like an > array() function. Too many languages, too little dep

Re: how do "real" python programmers work?

2006-01-13 Thread Scott David Daniels
bblais wrote: > How do experienced python programmers usually do it? Is there a > "usually" about it, or is it up to personal taste? Are there any > convenient ways of doing these things? There are a lot of us who use a test-first process: Write a unit test, watch it fail, fix the code til th

Re: Help with super()

2006-01-13 Thread Paul McNett
David Hirschfield wrote: > So, the larger question is how to do anything that resembles what I > want, which is to have a chain of subclasses with a single attribute > that each subclass can define as it wishes to, but with the ability to > get the combined value from all the ancestors down to t

Re: another docs problem - imp

2006-01-13 Thread rurpy
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > > > > from the find_module documentation: > > > > > > find_module( name[, path]) > > > > > > Try to find the module _name_ on the search path _path_. > > > If _path_ is a list

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? > Although the statement: > ++j > works but does nothing The reason is pretty complex, but here it is: Python is not C. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Christian Tismer
Just to add a word that I forgot: Adhering to the subject line, the intent is to track modifications of a dict. By definition, modification of a member of a dict without replacing the value is not considered a dict change. I'd stick with the shallow approach. Asking to track mutation of an elemen

Re: another docs problem - imp

2006-01-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > The first sentence says that the _path_ argument is a search path. > > It does not say that it can be a string; that's something you made > > up all by yourself. > > Correct it does not say it's a string. But your implication that > one can therefore conclude that it

Re: Limiting the size of List and making it Homogeneous

2006-01-13 Thread bearophileHUGS
The array module allows you to specify a single type of elements. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: atexit + threads = bug?

2006-01-13 Thread David Rushby
[Tim Peters] > [David Rushby] >> They say, "Functions thus registered are automatically executed upon >> normal interpreter termination." It seems like sophistry to argue that >> "normal interpreter termination" has occurred when there are still >> threads other than the main thread running. > > W

Re: how do "real" python programmers work?

2006-01-13 Thread Travis E. Oliphant
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python sh

Re: How to remove subset from a file efficiently?

2006-01-13 Thread Christopher Weimann
On 01/12/2006-09:04AM, fynali wrote: > > - PSP320.dat (quite a large list of mobile numbers), > - CBR319.dat (a subset of the above, a list of barred bumbers) > fgrep -x -v -f CBR319.dat PSP320.dat > PSP-CBR.dat -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-13 Thread Tom Anderson
On Thu, 12 Jan 2006, bblais wrote: > In Matlab, I do much the same thing, except there is no compile phase. I > have the editor on one window, the Matlab interactive shell in the > other. I often make a bunch of small scripts for exploration of a > problem, before writing any larger apps. I g

gracefully handling broken pipes (was Re: Converting a string to an array?)

2006-01-13 Thread Tim Chase
> >>> import random > >>> s = "abcdefg" > >>> data = list(s) > >>> random.shuffle(data) > >>> "".join(data) > 'bfegacd' > > fit you better? Excellent! Thanks. I kept trying to find something like an array() function. Too many languages, too little depth. The program was just a short scr

Re: How to remove subset from a file efficiently?

2006-01-13 Thread fynali
The code it down to 5 lines! #!/usr/bin/python barred = set(open('/home/sajid/python/wip/CBR319.dat')) postpaid_file = open('/home/sajid/python/wip/PSP320.dat') outfile = open('/home/sajid/python/wip/PSP-CBR.dat', 'w') outfile.writelines(number for number in postpaid

Re: How to remove subset from a file efficiently?

2006-01-13 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>>looks like premature non-optimization to me... >>> >> >>It might be quicker to establish a dict whose keys are the barred >>numbers and use that, rather than a list, to determine whether the input >>numbers should make it through. > > > what do

Remote Function Call

2006-01-13 Thread Mike
Hi, I have two machines. A python program on machine 1 needs to make a python call to a method in machine 2. What is the most efficient / fast / programmer friendly way to do it? - XML-RPC? - Http Call? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-13 Thread Juho Schultz
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python s

Re: how do "real" python programmers work?

2006-01-13 Thread Michele Simionato
As many others, I use emacs for programming and ipython for interactive experiments. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-13 Thread bruno at modulix
bblais wrote: > Hello, > (snip) > > In C++, I open up an editor in one window, a Unix shell in another. (snip) > In Matlab, I do much the same thing, except there is no compile phase. (snip) > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and fro

Re: Remote Function Call

2006-01-13 Thread david mugnai
On Thu, 12 Jan 2006 18:29:50 -0800, Mike wrote: > Sounds like what I need. Thanks Irmen. I heard google uses python with please look carefully at this page: http://pyro.sourceforge.net/manual/9-security.html particulary: http://pyro.sourceforge.net/manual/9-security.html#pickle another option is

Re: [OT] how do "real" python programmers work?

2006-01-13 Thread bruno at modulix
Mike Meyer wrote: (snip) > Maybe > some of the people who IDEs (instead of - well, we need a term for > development environment built out of Unix tools) "Extegrated Development environment" ?-) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p

Re: flatten a level one list

2006-01-13 Thread Nick Craig-Wood
Alex Martelli <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > Except if you are trying to sum arrays of strings... > > > > >>> sum(["a","b","c"], "") > > Traceback (most recent call last): > > File "", line 1, in ? > > TypeError: sum() can't sum strings [use

Conditionals stored as text to translate to real compares

2006-01-13 Thread Randall Parker
I want to know if there is some way to translate fragments of text into operators (e.g. <, >, <>, ==, etc) to use in conditional expressions. I've got a data structure which is a list of lists. A single list might look like: MyInnerList = ["MyVar",">",7] or MySecondInnerList = ["MyOtherVar","<=",

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Dave Hansen <[EMAIL PROTECTED]> wrote: > >And, FWIW, I don't think I could convince my wife (or myself) to move >to CullyFORNya for any amount of money, whether there was a massage >therapist on duty or not... Google also has technical offices in the New York area.

Looking for a particular http proxy...

2006-01-13 Thread Fred Pacquier
Hello, I would be grateful if someone could point me to an existing and working http proxy implementation that satisfies the following requirements : - as small and simple as possible, ideally no dependencies outside python - easy to customize (for controlling outgoing http headers for instance)

Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Travis E. Oliphant
Krish wrote: > Hello People > > I hope I am On Topic. Anyways, here is my problem. Any insights would > be really appreciated. Posting to the [EMAIL PROTECTED] list would help generate more responses, I think. > > I have wrapped a C IO module using SWIG -> Python Module. Suppose the > name of

Re: how do "real" python programmers work?

2006-01-13 Thread Fuzzyman
bblais wrote: [snip..] > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the

Re: Ann: Tkinter drag and drop module

2006-01-13 Thread tim
The module can be used with both standard Tkinter and Tix, and makes it quite easy to e.g. drop a bunch of files from a file manager onto any Tkinter widget. It comes with a basic reference manual and a small demo app. It can be found at . Any feedback is much appreciated. Best regards M

Re: Real-world use cases for map's None fill-in feature?

2006-01-13 Thread rurpy
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] > > > > How well correlated in the use of map()-with-fill with the > > > > (need for) the use of zip/izip-with-fill? > > [raymond] > > > Close to 100%. A non-iterator version of izip_longest() is exactly > > > equivalent to map(Non

Re: New Python.org website ?

2006-01-13 Thread Fuzzyman
Tim Parkin wrote: [snip..] > Hi Fuzzyman, > > Thanks for the feedback and volunteering to contribue... The list of > already built sections is not really up to date but I have added a few > tickets to the trac on some sections of content that need working on. If Great - can you provide a URL plea

Re: Creating shortcuts?

2006-01-13 Thread Roger Upole
On Windows, Pywin32 allows you to create and manipulate shortcuts. See \win32comext\shell\test\link.py for a small class that wraps the required interfaces. hth Roger "Ron Griswold" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi Folks, Is it possible to create a short

Re: Help with super()

2006-01-13 Thread Mike Meyer
David Hirschfield <[EMAIL PROTECTED]> writes: > I'm having trouble with the new descriptor-based mechanisms like > super() and property() stemming, most likely, from my lack of > knowledge about how they work. > > Here's an example that's giving me trouble, I know it won't work, but > it illustrate

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Christian Tismer
Steve Holden wrote: > Christian Tismer wrote: >> Just to add a word that I forgot: >> >> Adhering to the subject line, the intent is to track modifications >> of a dict. >> By definition, modification of a member of a dict without replacing >> the value is not considered a dict change. >> > Well, I

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Thanks to everyone who posted comments or put some thought into this > problem. > > I should have been more specific with what I want to do, from your > comments the general case of this problem, while I hate to say > impossible, is way more trouble than it's worth. > >

Re: Help with super()

2006-01-13 Thread David Hirschfield
I tried that and super(B,self), but neither works. Using super(A,self) in the _getv(self) method doesn't work, since the super() of A is "object" and that doesn't have the v property at all. Not sure why you say that using self.__class__ is wrong as the first argument to super(), it should be th

Re: how do "real" python programmers work?

2006-01-13 Thread Carl Friedrich Bolz
Scott David Daniels wrote: > bblais wrote: > >>How do experienced python programmers usually do it? Is there a >>"usually" about it, or is it up to personal taste? Are there any >>convenient ways of doing these things? > > There are a lot of us who use a test-first process: > Write a unit t

Re: Unicode & Pythonwin / win32 / console?

2006-01-13 Thread Martin v. Löwis
Robert wrote: > * Webbrowsers for example have to display defective HTML as good as > possible, unknown unicode chars as "?" and so on... Users got very > angry in the beginning of browsers when 'strict' programmers displayed > their exception error boxes ... Right. If you would develop a webbrows

Re: another docs problem - imp

2006-01-13 Thread Kent Johnson
Steve Holden wrote: > Clearly. So get your sleeves rolled up and provide a fix. Then you too > will get your name in the Python documentation contributors' list. Is there such a list? I have contributed many doc patches and if such glory is mine I would like to know it! Kent -- http://mail.pyt

Re: another docs problem - imp

2006-01-13 Thread Steve Holden
Kent Johnson wrote: > Steve Holden wrote: > >>Clearly. So get your sleeves rolled up and provide a fix. Then you too >>will get your name in the Python documentation contributors' list. > > > Is there such a list? I have contributed many doc patches and if such > glory is mine I would like to

Re: how do "real" python programmers work?

2006-01-13 Thread Roy Smith
Mike Meyer <[EMAIL PROTECTED]> wrote: > we need a term for development environment built out of Unix tools We already have one. The term is "emacs". -- http://mail.python.org/mailman/listinfo/python-list

ldap .passwd method, need help

2006-01-13 Thread Sells, Fred
I've got the python-ldap version 2.0.11 with python 2.4 under Linux I've got the ldap stuff working for groups, but now I'm trying to use it to change a user password. I get a return of 2 and no error messages but it does not change ldap. I've tried it with uid = 'joeblow' and with oldpw=whateve

  1   2   3   >