Re: HIRING: PHP Developer

2006-03-26 Thread Skeets
flash is over rated. rethink that requirement. -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style Python icons

2006-03-26 Thread Robin Becker
Steven Bethard wrote: ... >> >> http://www.doxdesk.com/img/software/py/icons.zip > > I just wanted to say that I've been using these icons for almost a week > now and I love them! I'd like to reiterate EuGeNe's request that these > go into the Python 2.5 release if at all possible. > > S

vxWorks port?

2006-03-26 Thread Miki
Hello All, I saw some old posts about vxWorks port of Python. Is there someone who can give me pointers to more recent efforts of porting Python to wxWorks? Thanks, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: unix newbie questions

2006-03-26 Thread Joel Hedlund
> * I'm using the tcsh shell and have no problems with it, but bash seems > more popular - any reason to change? (I don't intend writing many shell > scripts) You can do this in bash: $ python myprog > stdout.txt 2> stderr.txt and have output to sys.stdout and sys.stderr go in separate files.

Re: Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Fuzzyman
Kent Johnson wrote: > Fuzzyman wrote: > > It has finally happened, the release of `Firedrop 0.2.0 > > > * `ConfigObj `_ is > > now used to edit all the config files. > > You should add this to the dependency list in the install page, it > tripped

Nevow LivePage tutorial

2006-03-26 Thread Mir Nazim
Hello, Can any one direct me to some tutorials for: 1. Nevow LivePage 2. Form handling in Nevow Any Help is greately appriciated. I have already googled for it but did not get any thing helpfull. Thankyou -- http://mail.python.org/mailman/listinfo/python-list

Re: Module documentation

2006-03-26 Thread Georg Brandl
Tony Burrows wrote: > Just getting to grips with Python, a great language BUT > With something like Java I can find the syntax of a method call with no > problems, how do I do the same with Python? > > For example, using MySQLdb or SGMLParser I can see what the available > methods are with dir, bu

Re: access mbx files?

2006-03-26 Thread Donn Cave
Quoth "David Isaac" <[EMAIL PROTECTED]>: | "Alan Isaac" <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] |> Should I be able to access mail messages in Mahogany mail's mbx |> format using the Python mailbox module? If so, can someone |> please post a working example? If not, can you pl

Re: Python has a new Logo

2006-03-26 Thread Randal L. Schwartz
> "adapt" == adapt her [EMAIL PROTECTED] com <[EMAIL PROTECTED]> writes: adapt> Yawn. Go start indenting, and stop using Perl. If Python has such a adapt> nice logo, why waste any more time with Perl? Chuck Norris can indent a Python program any way he wants, and it still works. -- Randal L

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Mon, 27 Mar 2006 00:11:04 +, Paul McGuire wrote: > The doc string is not correct. The fault is mine, I'm afraid. I had thought I was copying that from an intact original version, but I must have edited it. I don't remember doing it, but I must have. To check, I went to Sourceforge and do

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread bill pursell
[EMAIL PROTECTED] wrote: > Hi, > > I've been using C++ for a few years and have developed a few projects > in C++. And I'm familar with OO and template metaprogramming. > > There are some book like "Learning Perl". It is a little bit tedious > for me, because more material in that book seems obviou

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Why not combine the two: > > I guess because (at least in source code) you're doing a loop twice > :-). I don't know what a compiler would do. I think though that the > "for i in c if test:" construct is more readable and maybe can ev

Re: What's the best way to learn perl for a python programmer?

2006-03-26 Thread Serge Orlov
vj wrote: > I've been given a project which requires writing scripts that need to > be run on over 3000 servers. Only about 15% of them have python > installed on them. While all/most of them will have perl. I used to work for a company with hundreds of development workstations and build/test serv

Re: a problem to solve

2006-03-26 Thread [EMAIL PROTECTED]
Clemens Hepper wrote: > Hi, > > [EMAIL PROTECTED] wrote: > > That's one way to do it. I did it that way because I have the > > hex patterns memorized. > > You should be able to generate your numbers like this: > > number = int('001001000100100', 2) Well, that would be another way, wouldn't it?

Re: determine file type

2006-03-26 Thread Mark Gibson
> > > import os > def test_file(filename, maxread=1024): >if os.path.isdir(filename): > return 'directory' >afile = open(filename) # open as text >for achar in afile.read(maxread): > if ord(achar) > 127: >return 'binary' >return 'text' > > Pefect, thanks! --

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread bitshadow
[EMAIL PROTECTED] wrote: > >The book "Learning Python" worked for me (a long time C++ person). > > Me too. I programmed in nothing but C++ for years, but this book made > learning Python easy. there are tons of tutorials available on the web. if your familiar with C++ then the tutorial that comes

Re: wildcard exclusion in cartesian products

2006-03-26 Thread John Zenger
A quick fix: change your last two functions to: def generateNotMatching(A,n,P): for g in gen(A,n,P,[]): for x in g: yield x def gen(A,n,P,acc): if any(imap((lambda p: allStar(p) and notNullOrZero(p,n)), P)): yield [] else: if n==0:

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread [EMAIL PROTECTED]
>The book "Learning Python" worked for me (a long time C++ person). Me too. I programmed in nothing but C++ for years, but this book made learning Python easy. -- http://mail.python.org/mailman/listinfo/python-list

Menu For The Command Line?

2006-03-26 Thread Michael Sperlle
When I bring up the command line interface, it looks like: [EMAIL PROTECTED] Then I type in some command, and it works! But there are lots of commands to type in, and I find it more and more difficult to remember them. Is there any way to build a menu of frequently-used commands, so that when I

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread Jim Benson
On 26 Mar 2006, [EMAIL PROTECTED] wrote: > Hi, > > I've been using C++ for a few years and have developed a few projects > in C++. And I'm familar with OO and template metaprogramming. > > There are some book like "Learning Perl". It is a little bit tedious > for me, because more material in tha

How to learn python if I'm very familar with C++

2006-03-26 Thread [EMAIL PROTECTED]
Hi, I've been using C++ for a few years and have developed a few projects in C++. And I'm familar with OO and template metaprogramming. There are some book like "Learning Perl". It is a little bit tedious for me, because more material in that book seems obvious for me. I want some book describe t

Re: a problem to solve

2006-03-26 Thread Clemens Hepper
Hi, [EMAIL PROTECTED] wrote: > That's one way to do it. I did it that way because I have the > hex patterns memorized. You should be able to generate your numbers like this: number = int('001001000100100', 2) mfg - eth -- http://mail.python.org/mailman/listinfo/python-list

Re: Python float representation error?

2006-03-26 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? Why not start by reading the Python online tutorial? Specifically ? Alex -- http://m

Re: Bitwise OR?

2006-03-26 Thread Clemens Hepper
Okay... pythons build-in methods are quite fast. so is hex(). with about 64 kb memory i can write it with a 16 bit dictionary where the dictionary generation itself is not yet optimized: def genBitList(exp): next = lambda now: [x+'0' for x in now]+[x+'1' for x in now] result = [""] for x i

Re: access mbx files?

2006-03-26 Thread David Isaac
"Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Should I be able to access mail messages in Mahogany mail's mbx > format using the Python mailbox module? If so, can someone > please post a working example? If not, can you please > point me to documentation of the file for

Re: determine file type

2006-03-26 Thread James Stroud
Mark Gibson wrote: > Is there an equivalent to the unix 'file' command? > > [mark tmp]$ file min.txt > min.txt: ASCII text > [mark tmp]$ file trunk > trunk: directory > [mark tmp]$ file compliance.tgz > compliance.tgz: gzip compressed data, from Unix > > What I really want to do is determine if a

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: >> What's the original? > > def minimum(cmp, lst): > """minimum(cmp, lst) > > Returns the minimal element in non-empty list LST with elements > compared via CMP() which should return values with the same se

Re: PIL & image size reduction script

2006-03-26 Thread nikie
Philippe Martin wrote: > Hi, > > Thanks to the NG, I got the script hereunder working. > > 1) I am not certain that the call to convert does much (checking the doc) I think you only need it if your source image comes in a format that can't be stored into a jpeg file (e.g. 8-bit paletted). You'll n

determine file type

2006-03-26 Thread Mark Gibson
Is there an equivalent to the unix 'file' command? [mark tmp]$ file min.txt min.txt: ASCII text [mark tmp]$ file trunk trunk: directory [mark tmp]$ file compliance.tgz compliance.tgz: gzip compressed data, from Unix What I really want to do is determine if a file is 1) a directory, 2) a text fil

Re: New-style Python icons

2006-03-26 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Personally, I *like* the new website look, and I'm glad to see Python > having a proper logo at last! > > I've taken the opportunity to knock up some icons using it, finally > banishing the poor old standard-VGA-palette snake from my desktop. If > you like, you can grab

Re: Python float representation error?

2006-03-26 Thread nikie
> try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? That's perfectly normal - some numbers aren't exactly expressible as binary floating points, just like 1/3 isn't expressible as a decimal floating point number. Here's a good l

Re: maximum() efficency

2006-03-26 Thread Paul McGuire
"Steve R. Hastings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: > > What's the original? > > > > def minimum(cmp, lst): > """minimum(cmp, lst) > > Returns the minimal element in non-empty list LST with elements > comp

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
Actually, now that I think about it, the version using iter() has one advantage over your version: it will work correctly if passed either a list or an iterator. So, for versions of Python that have iterators, I'd use the iter() version, but for older versions of Python, I'd use your version. P.S

Re: interactive programme (add a new line in Tk)

2006-03-26 Thread James Stroud
nigel wrote: > somebody recently showed me how to create a new line using \n which was > great.The thing is when i am creating the programme the text i wish to add is > quite long.and it ends up stretching the width of several pages,which i think > looks quite messy.Would it be possible for som

Re: Python float representation error?

2006-03-26 Thread James Stroud
[EMAIL PROTECTED] wrote: > try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? > This comes from the imprecision in representing base-10 fractions as binary. Try "print [str(39.95)]". If you want to print a list, maybe: prin

Re: What's the best way to learn perl for a python programmer?

2006-03-26 Thread john_sips_tea
The online docs are very good. Just run "perldoc perl", and then go through the various tutorial pages (starting with "perldoc perlintro"). You can also read them online here: http://perldoc.perl.org/perl.html . Then go to http://www.perlmonks.org . They have many tutorial-style articles there, as

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: > What's the original? def minimum(cmp, lst): """minimum(cmp, lst) Returns the minimal element in non-empty list LST with elements compared via CMP() which should return values with the same semantics as Python's cmp(). If there

Re: [ANN] Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Kent Johnson
Fuzzyman wrote: > It has finally happened, the release of `Firedrop 0.2.0 > * `ConfigObj `_ is > now used to edit all the config files. You should add this to the dependency list in the install page, it tripped me up. Kent -- http://mail.pytho

Python float representation error?

2006-03-26 Thread [EMAIL PROTECTED]
try running this in python: print [39.95] the output i get is: [39.953] what's up with that? -- http://mail.python.org/mailman/listinfo/python-list

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Sun, 26 Mar 2006 20:34:28 +0200, Mitja Trampus wrote: > I would have done it in the same way, but probably without the iterators. > I.e., like this: > > def maximum(lst): > try: m = lst[0] > except (TypeError, IndexError): raise Exception "Non-sequence or empty > sequence given to

Re: py web-app-frameworks without a rdbms...

2006-03-26 Thread Michael Goettsche
On Wednesday 22 March 2006 02:06, [EMAIL PROTECTED] wrote: > Hi folks, > > Of TurboGers & Django WAF candidates, which one would be easier to use > in an environment where the data/content doesn't come an RDBMS, but > from other server-side apps... If these are not good candidates, could > you sugg

Re: Python multithreading problem

2006-03-26 Thread Serge Orlov
abhinav wrote: > //A CRAWLER IMPLEMENTATION > please run this prog. on the shell and under the control of debugger > when this prog. is run normally the prog. does not terminate .It > doesn't come out of the cond. if c<5: so this prog. continues > infinitely How do you know? Have you waited *infin

Re: "For" loop and list comprehension similarity

2006-03-26 Thread John Zenger
Rather than a list comprehension, it would be faster and more memory-efficient to use a generator comprehension. Just change the square brackets to parentheses: for j in (i*2 for i in c if ): print j Grant Edwards wrote: > On 2006-03-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrot

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
> Why not combine the two: I guess because (at least in source code) you're doing a loop twice :-). I don't know what a compiler would do. I think though that the "for i in c if test:" construct is more readable and maybe can even be better optimized. Thanks! Sergey. -- http://mail.python.org/m

PyPy is now able to compile efficient extension modules!

2006-03-26 Thread Luis M. González
"PyPy is now able to compile efficient extension modules!". This was recently announced by Christian Tismer on Pypy's mailing list. To learn more: http://codespeak.net/pipermail/pypy-dev/2006q1/002911.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise OR?

2006-03-26 Thread Clemens Hepper
Adam DePrince wrote: >> BTW: Is there something like a sizeof() method for int numbers? > > import struct > help( strict.calcsize ) Mh, that doesn't do what i want. I'd like to have something like: def size(number): return sizeof(number) > Why one bit at a time? Good question... Here my new

work at home

2006-03-26 Thread magaznan
Collecter rapidement les informations nécessaires pour travailler de chez soi avec son ordinateur et de ce fait amasser rapidement des rentrées d'argents plus qu'honorables To collect the necessary information quickly for to work of at

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Ron Adam <[EMAIL PROTECTED]> wrote: > >> A "Current" key word would fix this. Or possibly "This" which would be >> short for "This object". > > I think "This" would cause huge confusion, since in other popular > language the keyword "this" means (a pointer/reference to) "t

interactive programme (add a new line in Tk)

2006-03-26 Thread nigel
somebody recently showed me how to create a new line using \n which was great.The thing is when i am creating the programme the text i wish to add is quite long.and it ends up stretching the width of several pages,which i think looks quite messy.Would it be possible for some one to show me how

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Ben Finney
[EMAIL PROTECTED] writes: > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > > for i in c if : > print i*2 > > ...because it's similar to the list comprehension construct: > > [i*2 for i

Re: New development windows, IronPython or PythonWin

2006-03-26 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > IronPython is currently nowhere near production quality. I would not > recommend it. I know at least one firm developing production quality software using IronPython, so your statement 'nowhere near' is a bit off. They're pretty close to a full Python 2.4 implementatio

Re: What's The Best Editor for python

2006-03-26 Thread Charles Krug
On 2006-03-26, Andrew Gwozdziewycz <[EMAIL PROTECTED]> wrote: > If you want something that won't get in your way, you should really > use /bin/ed. It's probably simpler to use then searching the archives. > /bin/ed will also run in cygwin for windows. > >>> Can one of you say to me what's the bes

regimes

2006-03-26 Thread magaznan
Collecter rapidement les informations nécessaires pour travailler de chez soi avec son ordinateur et de ce fait amasser rapidement des rentrées d'argents plus qu'honorables To collect the necessary information quickly for to work of at

Re: MVC in Python for web app dev

2006-03-26 Thread Robert Hicks
http://www.myghty.org/ That one is excellent. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard exclusion in cartesian products

2006-03-26 Thread [EMAIL PROTECTED]
Michael, Yes! That is precisely what I had in mind! Thanks, Walter Kehowski -- http://mail.python.org/mailman/listinfo/python-list

Re: Python types

2006-03-26 Thread Salvatore
Thank's Bruno. -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard exclusion in cartesian products

2006-03-26 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > The python code below is adapted from a Haskell program written by > Tomasz > Wielonka on the comp.lang.functional group. It's more verbose than his > since I wanted to make sure I got it right. > > http://groups.google.com/group/comp.lang.functional/browse_frm/thread...

Re: Accessing func_name from inside a function

2006-03-26 Thread Eyal Lotem
Steven D'Aprano wrote: > On Sun, 26 Mar 2006 10:19:36 +1000, Ben Finney wrote: > >> "James Thiele" <[EMAIL PROTECTED]> writes: >> >>> I'd like to access the name of a function from inside the function. >> >> A function, like most other objects in Python, can have any number of >> names bound to

Re: Accessing func_name from inside a function

2006-03-26 Thread Alex Martelli
James Thiele <[EMAIL PROTECTED]> wrote: > I'd like to access the name of a function from inside the function. My > first idea didn't work. > > >>> def foo(): > ... print func_name > ... > >>> foo() > Traceback (most recent call last): > File "", line 1, in ? > File "", line 2, in foo > Na

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Grant Edwards
On 2006-03-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi All, > > I apologize if this was brought up before, I couldn't find any "prior > art" :-). > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > >

Re: Accessing func_name from inside a function

2006-03-26 Thread Alex Martelli
Ron Adam <[EMAIL PROTECTED]> wrote: > A "Current" key word would fix this. Or possibly "This" which would be > short for "This object". I think "This" would cause huge confusion, since in other popular language the keyword "this" means (a pointer/reference to) "the instance variable on which the

Re: maximum() efficency

2006-03-26 Thread Paul McGuire
"Steve R. Hastings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. > > If

Re: image reduction script

2006-03-26 Thread Philippe Martin
Kamilche wrote: > Be sure and use mode = P instead of RGB, like you have in your other > code. P is for palettized images. Don't palettize if you're storing as > JPG, only if you're storing as PNG or some other format that can handle > 256 color images. My problem is this: 1) If I use a save to

Re: Accessing func_name from inside a function

2006-03-26 Thread Bruno Desthuilliers
James Thiele a écrit : > I'd like to access the name of a function from inside the function. My > first idea didn't work. > > def foo(): > > ... print func_name > ... > foo() > > Traceback (most recent call last): > File "", line 1, in ? > File "", line 2, in foo > NameError: g

Re: wired md5 hashing problem

2006-03-26 Thread Paul Rubin
Matthias Güntert <[EMAIL PROTECTED]> writes: > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. Try editing as follows: change > f = open(fname, "rb") > while 1: > block = f.read(1024*1024) >

Python multithreading problem

2006-03-26 Thread abhinav
//A CRAWLER IMPLEMENTATION please run this prog. on the shell and under the control of debugger when this prog. is run normally the prog. does not terminate .It doesn't come out of the cond. if c<5: so this prog. continues infinitely but if this prog is run under the control of debugger the prog te

Re: Python types

2006-03-26 Thread Bruno Desthuilliers
Salvatore a écrit : > Thank's everybody :-) > > > Here is a type définition I've found on the net which I agree with : > > Attribute of a variable which determines the set of the values this > variabe can take and the > operations we can apply on it. Then - as already pointed by Alex - there is

wildcard exclusion in cartesian products

2006-03-26 Thread [EMAIL PROTECTED]
The python code below is adapted from a Haskell program written by Tomasz Wielonka on the comp.lang.functional group. It's more verbose than his since I wanted to make sure I got it right. http://groups.google.com/group/comp.lang.functional/browse_frm/thread... Does anyone know how to turn it int

Advice for Python and Web Server/Services?

2006-03-26 Thread Ron Davis
I have recently discovered Python and like it quite a bit. I would like to use it on a new project I am starting. The project will gather data from several web services and present the collected data to browser users through a web server. So basically I need a full-time web server and a separat

Re: image reduction script

2006-03-26 Thread Kamilche
Be sure and use mode = P instead of RGB, like you have in your other code. P is for palettized images. Don't palettize if you're storing as JPG, only if you're storing as PNG or some other format that can handle 256 color images. -- http://mail.python.org/mailman/listinfo/python-list

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Thank you for replying, Mitja! That *is* a nice alternative. Do you think it's a good idea to ask on comp.python.devel if they would be interested in a PEP about this (provided there is none)? Cheers, Sergey. -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Fuzzyman
It has finally happened, the release of `Firedrop 0.2.0 `_. The impatient can download the new release here : `Firedrop 0.2.0 (1.3mb) `_ .. note:: The first

Re: New development windows, IronPython or PythonWin

2006-03-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Dan wrote: > >> I realise its in beta. But long term, do you think that the win32com, >>win32gui etc... will have no support because everyone jumps on the >>Microsoft bandwagon? Aren't the windows support extensions supported >>primarily by one guy, Mark Hammond? As a

Re: MVC in Python for web app dev

2006-03-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Thanks Rune. I've already checked out Django and TG and have found both > the projects to be a little misguided. I think the one great thing they > have over Rails is the use of SQLObject Then you haven't really checked Django - it doesn't use SQLObject. > Having sa

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Personally, I'd rather have a 3.0 keyword referring to "the current > object" (module for module toplevel code, class for classbody toplevel > code, function for code within a function) -- say for the sake of > argument the keyword is 'current'; this would allow current.__na

Re: String To Dict Problem

2006-03-26 Thread Kamilche
Ah, finally, that's exactly what I need! Thanks bunches. I was attempting to modify your first code to fit my needs, but mine was much longer, and not yet working, a sure clue that yours is a better solution. :-D -- http://mail.python.org/mailman/listinfo/python-list

Re: object references

2006-03-26 Thread Bruno Desthuilliers
DrConti a écrit : > Dear Python developer community, > I'm quite new to Python, so perhaps my question is well known and the > answer too. > > I need a variable alias ( what in other languages you would call "a > pointer" (c) or "a reference" (perl)) Well, that's the only kind of "variable"[1] i

Re: SSH, remote login, and command output

2006-03-26 Thread Tim Parkin
Tim Parkin wrote: > Spire 01 wrote: > >>Greetings! >> ... >>Thanks a million! >>Spire > > > > I wrote a small tool to implement cron like functionality over ssh using > twisted (with public/private keys). This was written to scratch a small > itch but also to learn how twisted works with conch

Re: Cookbook for beginners?

2006-03-26 Thread Rune Strand
Aahz wrote: > If you were going to name three or five essential recipes from the > Python Cookbook suitable for beginners, what would you pick? > > Yes, this is for _Python for Dummies_, so idioms that aren't in the > Cookbook are also fine. If it's for _beginners_ / _dummies_, I would expect thi

Re: object references

2006-03-26 Thread Mitja Trampus
DrConti wrote: > class ObjectClass: > """ Test primary Key assignment """ > > if __name__ == "__main__": > ObjectClassInstantiated=ObjectClass() > ObjectClassInstantiated.AnAttribute='First PK Elem' > ObjectClassInstantiated.AnotherOne='Second PK Elem' > ObjectClassIn

Re: String To Dict Problem

2006-03-26 Thread Michael Spencer
Kamilche wrote: > Thanks! It's interesting, and nearly what I want, but not quite there. > > When I run my sample code through it, I get a syntax error because it's > not a valid expression. If I were to put a 'dict(' in front and a ')' > at the end, THEN it nearly works - but it gives me an > 'Un

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Mitja Trampus
[EMAIL PROTECTED] wrote: > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > > for i in c if : > print i*2 Maybe there's been a PEP, don't really know... Currently, the only sensible alternati

Re: Module documentation

2006-03-26 Thread Bruno Desthuilliers
Tony Burrows a écrit : > Just getting to grips with Python, a great language BUT > With something like Java I can find the syntax of a method call with no > problems, how do I do the same with Python? > > For example, using MySQLdb or SGMLParser I can see what the available > methods are with dir,

Re: maximum() efficency

2006-03-26 Thread Mitja Trampus
Steve R. Hastings wrote: > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. But you forgot to shuw us the original... [snip several im

Re: Cookbook for beginners?

2006-03-26 Thread Bruno Desthuilliers
Aahz a écrit : > If you were going to name three or five essential recipes from the > Python Cookbook suitable for beginners, what would you pick? > > Yes, this is for _Python for Dummies_, so idioms that aren't in the > Cookbook are also fine. 1/ tuple- and dict-based dispatch, ie: x = (result_

Re: String To Dict Problem

2006-03-26 Thread Kamilche
Thanks! It's interesting, and nearly what I want, but not quite there. When I run my sample code through it, I get a syntax error because it's not a valid expression. If I were to put a 'dict(' in front and a ')' at the end, THEN it nearly works - but it gives me an 'Unsafe_Source_Error: Line 1.

Re: SSH, remote login, and command output

2006-03-26 Thread Tim Parkin
Spire 01 wrote: > Greetings! > > I'm working on a Python program for a small LAN of Linux systems running > Gentoo, and I need a little help figuring out what I need to do it. So > what I'd like to do is, from any given computer, log on to every other > computer, run a certain command (which norm

"For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Hi All, I apologize if this was brought up before, I couldn't find any "prior art" :-). On more than one occasion, I found myself wanting to use a "conditional loop" like this (with "Invalid syntax" error, of course): for i in c if : print i*2 ...because it's similar to t

PIL & image size reduction script

2006-03-26 Thread Philippe Martin
Hi, Thanks to the NG, I got the script hereunder working. 1) I am not certain that the call to convert does much (checking the doc) 2) Can this be improved as far as the final image size in (X,Y) ? For instance, passing a large .jpg with a target byte size of 7000, I get final (X,Y) results aro

Re: image reduction script

2006-03-26 Thread Philippe Martin
Kamilche, I am posting the code in another thread but am not certain that convert does anything to the picture color depth ... still searching in the doc. Philippe Kamilche wrote: > > To reduce the color depth of an image in PIL: > im = im.convert(mode="P", palette=Image.ADAPTIV

Re: String To Dict Problem

2006-03-26 Thread Michael Spencer
Kamilche wrote: > Hi everyone. I'm trying to convert a string that looks like this: > > gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more > text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS', > None), ('FPS2', 'something')] > > to a dict that looks like this

Re: is mysqlsb compatible with MySQL 5.0?

2006-03-26 Thread John Salerno
Dennis Lee Bieber wrote: > Check the Windows services control for MySQL and try from it... How do I do that? > > You might (since it sounds like this is a first attempt) need to > uninstall everything -- and make sure you delete the mysql database (in > case you have a garbaged root

Re: Cookbook for beginners?

2006-03-26 Thread Rene Pijlman
Aahz: >If you were going to name three or five essential recipes from the >Python Cookbook suitable for beginners, what would you pick? >Yes, this is for _Python for Dummies_, so idioms that aren't in the >Cookbook are also fine. Constants Static methods / Class methods Bunch TaskQueue (Queue f

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. What's the original? Are you sure max can't solve it with

Re: wired md5 hashing problem

2006-03-26 Thread Matthias Güntert
On Sun, 2006-03-26 at 11:48 -0500, Adam DePrince wrote: > > What do you get when you type > > md5sum backup.tar.bz2? it is working. Don't know what went wrong. But now I have another question: How am I able to execute an external program, like mysqldump? I had a look into the mysql module it

Re: pondering about the essence of types in python

2006-03-26 Thread Steven Bethard
gangesmaster wrote: > i dont think it's possible, to create proxy classes, but even if i did, > calling remote methods with a `self` that is not an instance of the > remote class would blow up. I don't understand you here. Why can't you just do something like: >>> class RemoteClass(object): ...

String To Dict Problem

2006-03-26 Thread Kamilche
Hi everyone. I'm trying to convert a string that looks like this: gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS', None), ('FPS2', 'something')] to a dict that looks like this: {'signals': [('FPS', None),

maximum() efficency

2006-03-26 Thread Steve R. Hastings
I was looking at a Python function to find the maximum from a list. The original was more complicated; I simplified it. The built-in max() function can replace the simplified example, but not the original. def maximum(lst): maxval = lst[0] for i in xrange(1, len(lst)): v = lst[i] i

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
On Sun, 2006-03-26 at 16:56 +0200, Matthias Güntert wrote: > Hello list-members > > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. > > # do md5 fingerprinting > if config.get("global", "crc") == "md5": > m = md

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
What do you get when you type md5sum backup.tar.bz2? - Adam On Sun, 2006-03-26 at 16:56 +0200, Matthias Güntert wrote: > Hello list-members > > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. > > # do md5 fingerprinting

  1   2   >