Re: ctypes pointer to pointer

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 22:58, Podi wrote: I have a C function in the dll does the following: DLL_API int dll_foo(char **data, size_t *size) { strcpy(*data, "hello"); *size = strlen(*data); return 0; } So I would call the function as such, char data[8]; size_t size; int status =

RE: Starting Win32 Service

2006-09-27 Thread Tim Golden
[placid] | > Now i was trying to use service.ChangeStartMode but each | time i pass in | > an argument i get the error; | > | > #TypeError: __call__() takes exactly 1 argument (2 given) | > | > but; | > | > >>> print service.ChangeStartMode | > (ReturnValue)> | > | > ChangeStartMode needs an argu

Re: does anybody earn a living programming in python?

2006-09-27 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> Wrote: > On Tue, 26 Sep 2006 22:00:55 +1000, Anthony Baxter wrote: > > > This seems to be a very, very silly original post. I know of plenty of > > people who make a living programming Python. It's been the vast > > majority of the programming (for money) I

Re: XSLT speed comparisons

2006-09-27 Thread Damian
Ross Ridge wrote: > Hmm... it seems that you don't have MSXML 4.0 installed on your > machine. I missed the fact that you're using ASP.NET, so your ASP code > probably is probably using the .NET XML implementation instead of > MSXML. In that case, another alternative might be to use IronPython >

Re: XSLT speed comparisons

2006-09-27 Thread Fredrik Lundh
Ross Ridge wrote: >> The problem is, the Python version is (at a guess) about three times >> slower than the ASP one. > > It could just be that 4suite is slower than MSXML. If so, you can use > MSXML in Python if you want. or use lxml: http://codespeak.net/lxml/ (does anyone have any lx

Re: Auto color selection PIL

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 20:43, Leif K-Brooks wrote: > I'm trying to plot some points in an image. Each point has an > associating type and I'd like to have different colors (preferrably of > high contrast) for different types. The number of types in the data > file is unknown a priori. Is ther

Re: Difference between two dates in seconds

2006-09-27 Thread Fredrik Lundh
Steven D'Aprano wrote: > Arguably a better solution would be to do this: > > seconds = td.days * 24*60*60 + td.seconds if you're targeting an audience that cannot figure out what the expression does based on the names of the result and the names of the attributes, chances are that 24*60*60 won

Be Paid to Attend PyCon 2007!

2006-09-27 Thread Jeff Rush
PyCon 2007, to be held in Dallas at the same location as in 2006, is coming up and we need instructors to fill Tutorial Day on Feb 22. Last year we had tutorials for: Python 102 Internet Programming with Python Getting Started with wxPython Text & Data Processing Plone Rapid Boot

Re: A critique of cgi.escape

2006-09-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Stuart Bishop wrote: > People also use that function to escape non-HTML too - if they are using > it as documented, and it produces the correct results for them, great. > Note that the documentation doesn't say that input has to be HTML, nor > that output must be us

Re: Computer Language Popularity Trend

2006-09-27 Thread Tagore Smith
Stefan Scholl wrote: > In comp.lang.lisp Jon Ribbens <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > >>> http://xahlee.org/lang_traf/index.html > >> > >> Careful there with the sweeping generalizations and quick judgments > >> about languages :) > > > > I j

Re: XSLT speed comparisons

2006-09-27 Thread Damian
Ross Ridge wrote: > Hmm... it seems that you don't have MSXML 4.0 installed on your > machine. I missed the fact that you're using ASP.NET, so your ASP code > probably is probably using the .NET XML implementation instead of > MSXML. In that case, another alternative might be to use IronPython >

Re: Difference between two dates in seconds

2006-09-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Wed, 27 Sep 2006 20:16:52 +0200, Fredrik Lundh wrote: > >> Claes at work wrote: >> >>> Please tell me there is a simpler way than subtracting two datetimes >>> to get a timedelta and then compute >>> >>> days * number of seconds per da

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Fredrik Lundh
Roy Smith wrote: > Things like decorators and metaclasses certainly add power, but they add > complexity too. never used them. does that make me an amateur? -- http://mail.python.org/mailman/listinfo/python-list

Re: does anybody earn a living programming in python?

2006-09-27 Thread Stuart Bishop
walterbyrd wrote: > My research of this subject was very limited, just looked at the major > job boards, and compared demand for python developers to demand for > other languages, such as java, c++, visual basic, or php. An > unscientific test, I realize. But, it's not easy to get good data on > s

Re: Computer Language Popularity Trend

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 13:51, [EMAIL PROTECTED] wrote: > You can also get a rough measure ot the popularity of web scripting > languages from an analysis of the URLs. The last time I did this was in > 2003, and as I recall, these were the results: > PHP 30% and increasing > Perl 28% and falling

Re: AN Intorduction to Tkinter

2006-09-27 Thread jmdeschamps
... > > If anybody has some really good sites with examples of Tkinter programs > and stuff, please share :) ... You should really pay attention to people's reply to your questions if you want help ;-) In this case meaning, that you should show what type of problem you are getting. Since the exa

Re: Python CTypes translation of (pv != NULL)

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 13:35, [EMAIL PROTECTED] wrote: > > http://starship.python.net/crew/theller/ctypes/tutorial.html > ... > direct discussion only of how to construct null pointers, > no discussion of how to test for them ... > ... > could be read to mean try ... == ... is ... False ... None

Re: Python CTypes translation of (pv != NULL)

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 13:40, [EMAIL PROTECTED] wrote: > That means that NULL pointers are considered False in a boolean > expression (and you could assume that non-NULL pointers are True, as > any other object in general), I see this now that you show the clueless newbie me, yes thank you. Exc

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-27 Thread Stuart Bishop
Frank Millman wrote: > I used to use 'select lastval()', but I hit a problem. If I insert a > row into table A, I want the id of the row inserted. If it is a complex > insert, which triggers inserts into various other tables, some of which > may also be auto-incrementing, lastval() returns the id

Re: Fwd: Recursive Tree in Python

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 13:35, Fred Kitoogo wrote: I wish to create a recursive tree and test in Python for combining classifiers, below are the two Algorithms (Training & Testing):- Can somebody please help? Sure. See Gabriel Ge

Re: Extra Newby question - Trying to create md5 File Listing

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 11:50, James Johnston wrote: fl = file(fileconfig,'r') fileData = fl.read() for f1 in glob.glob(fileData): filelist = f1 Here, filelist is overwritten each time with another file name; the last one survives. A few lines later you iterate thru filelist - in fact, you

Re: a query on sorting

2006-09-27 Thread Paul Rubin
Gabriel Genellina <[EMAIL PROTECTED]> writes: > > >>> sorted((x[1], x[0]) for x in enumerate(a)) > >[(1, 7), (2, 4), (2, 8), (3, 2), (4, 1), (5, 3), (6, 5), (7, 6), (9, 0)] > > Why forcing to use enumerate if it doesn't fit? And a generator won't > help here since you have to access all the item

Re: IDLE - Customizing output format

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 09:29, Ilias Lazaridis wrote: import sys def f(obj): if obj: print '::: ' + repr(obj) sys.displayhook = f Have you tried that? You have to filter out None, not *any* False value. > And notice that this replaces the output of *evaluated* expressions, > not a

Re: Battlefield Weapon Popularity Trend

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 07:30, Mirco Wahab wrote: >> When the Samurai of medieval Japan were confronted >> with new 'battlefield language', e.g. early Shotguns, >> they resisted because one could push any peasant > > shouldn't this be "they [the Samurai] did not resist"? The "resisted" believing

Re: A critique of cgi.escape

2006-09-27 Thread Stuart Bishop
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >>> I'm sorry, that's not good enough. How, precisely, would it break >>> "existing code"? Can you come up with an example, or even an >>> explanation of how it *could* break existing code? >> Is that so hard to see? If cgi.es

How to update my web automatically by python?

2006-09-27 Thread sunboy30860
How to update my web automatically by python? I have one twiki web page https://twiki.cern.ch/twiki/bin/view/Atlas/CSC11DQ2ReplicateToCERNCAF In this page,the dates often need to be updated.Every time after I produce the dates ,I plaster the date to the web manual.The dates is produced by a python

Re: a query on sorting

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 08:51, Steve Holden wrote: If you want the indexes as well you need to become a bit tricky. Remember that enumerate() will produced two-element tuples with the index value associated with the list value. >>> [x for x in enumerate(a)] [(0, 9), (1, 4), (2, 3), (3, 5), (4,

Re: Starting Win32 Service

2006-09-27 Thread placid
placid wrote: > Tim Golden wrote: > > [placid] > > | Using Tim Golden's wmi module you can get the service names > > | > > | import wmi > > | c = wmi.WMI () > > | stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") > > | if stopped_services: > > | for s in stopped_services: >

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, efrat wrote: > 1. What exactly is a Python list? If one writes a[n], then is the > complexity Theta(n)? If this is O(1), then why was the name "list" > chosen? Why not? It has all the methods one expect from an abstract data type "list". It's not the O() behavior but t

Re: Computer Language Popularity Trend

2006-09-27 Thread semiopen
John Bailo wrote: > Xah Lee wrote: > > Computer Language Popularity Trend > > > > This page gives a visual report of computer languages's popularity, as > > indicated by their traffic level in newsgroups. > > The only problem being that in the last five years, there are now a > multiplicity of opt

ctypes pointer to pointer

2006-09-27 Thread Podi
Hi, I have a C function in the dll does the following: DLL_API int dll_foo(char **data, size_t *size) { strcpy(*data, "hello"); *size = strlen(*data); return 0; } So I would call the function as such, char data[8]; size_t size; int status = dll_foo(&data, &size); I have tried th

Re: Starting Win32 Service

2006-09-27 Thread placid
Tim Golden wrote: > [placid] > | Using Tim Golden's wmi module you can get the service names > | > | import wmi > | c = wmi.WMI () > | stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") > | if stopped_services: > | for s in stopped_services: > | print s.Caption, "service

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Paul Rubin
Roy Smith <[EMAIL PROTECTED]> writes: > The problem is, if the complex features are there, people will use them. > On any large project, there will always be some people who revel in using > every obscure feature of a language. That forces everybody else on the > team (and all future members o

Re: XSLT speed comparisons

2006-09-27 Thread Ross Ridge
Damian wrote: > The errors can be seen at http://python.pointy.co.nz/test (I'm leaving > the existing, slower version running at the moment for the rest of the > site). Hmm... it seems that you don't have MSXML 4.0 installed on your machine. I missed the fact that you're using ASP.NET, so your AS

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > Things like decorators and metaclasses certainly add power, but they add > > complexity too. It's no longer a simple language. > > > Well, I think a simple language is a language that makes the simple > thi

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread George Sakkis
efrat wrote: > 1. What exactly is a Python list? If one writes a[n], then is the > complexity Theta(n)? If this is O(1), then why was the name "list" > chosen? If this is indeed Theta(n), then what alternative should be > used? (array does not seem suited for teaching purposes.) Indexing for pyth

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread bearophileHUGS
efrat: >1. What exactly is a Python list? A dynamic array that can grow geometrically on the right. >If one writes a[n], then is the complexity Theta(n)? If this is O(1),< It is O(1). >then why was the name "list" chosen? I'd too love to know why the wrong "list" name was chosen for them, i

Re: License / Registration key enabled software

2006-09-27 Thread Ben Finney
Mike Playle <[EMAIL PROTECTED]> writes: > License keys exist to make it easier for honest users to remain > honest. What doubletalk. If usage restrictions were in *any* way what end users wanted, they'd choose software that has it over software that does not. Usage restrictions serve *no* want o

Re: optparse

2006-09-27 Thread Thorsten Kampe
Don't top-post or other people will laugh at you and call you names... * rick (Wed, 27 Sep 2006 11:40:40 -0400) >OK, using that convention, how would I create help for , , etc. Not possible. Use argparse. Thorsten -- http://mail.python.org/mailman/listinfo/python-list

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it: 1. What exactly is a Python list? If one writes a[n], then is the complexity Theta(n)? If

Re: OT: productivity and long computing delays

2006-09-27 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Two hours is a long time! Maybe it takes a programmer 10 minutes to get > his mind focused on a new project, but that still leaves 110 productive > minutes. I think many programmers in corporate environments would > regard 2-hour blocks as luxuries. I have wondered the s

Re: concat next line with previous

2006-09-27 Thread Ben Finney
tobiah <[EMAIL PROTECTED]> writes: > assuming that the 'lines' have newlines at the end, No need to assume; tell the string what you want. ' '.join(line1.rstrip('\n'), line2) -- \ "Nothing is so common as to imitate one's enemies, and to use | `\their weapons." -- Voltair

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Carl J. Van Arsdall
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Michele Simionato" <[EMAIL PROTECTED]> wrote: > > >> John Salerno wrote: >> >>> But what if you are an expert Python program and have zero clue about >>> other languages? >>> >> Python is not a trivial language (think of generato

Re: Ordered dicts

2006-09-27 Thread bearophileHUGS
Steve Holden: I forgot a detail: in the Python version of Odict I use element deletion is O(n). You need a second dict to improve that (or a duble linked list of hashing operations, see below). > FYI there was a *long* discussion around the need for Speed sprint about > implementing ordered dicts

Re: optparse

2006-09-27 Thread Steven Bethard
rick wrote: > Consider the following piece of code: > > parser = optparse.OptionParser(usage="usage: %prog > [options]", add_help_option=False) > parser.add_option("-d", type="string", action="store", dest="DELIM", > default="|", help="single character delimiter in quotes (default: |)") > (opt

Re: does anybody earn a living programming in python?

2006-09-27 Thread Ben Finney
"Dan Bishop" <[EMAIL PROTECTED]> writes: > It's so frustrating seeing all those job postings that require a > "mimimum 10 years experience". I think it shows a huge gulf of communication between the person writing the job requirements and the person who actually asked for the position to be fille

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Michele Simionato" <[EMAIL PROTECTED]> wrote: > John Salerno wrote: > > But what if you are an expert Python program and have zero clue about > > other languages? > > Python is not a trivial language (think of generators, decorators, > metaclasses, etc) This is,

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Ben Finney
"Michele Simionato" <[EMAIL PROTECTED]> writes: > John Salerno wrote: > > But what if you are an expert Python program and have zero clue about > > other languages? > > Well I want to play devil's advocate here, and I think that if you > know Python you can earn your living. Heck, there are people

Re: Auto color selection PIL

2006-09-27 Thread Leif K-Brooks
Xiaolei wrote: > I'm trying to plot some points in an image. Each point has an > associating type and I'd like to have different colors (preferrably of > high contrast) for different types. The number of types in the data > file is unknown a priori. Is there a way to do this at runtime? If you

Re: XSLT speed comparisons

2006-09-27 Thread Damian
Ross Ridge wrote: > It could just be that 4suite is slower than MSXML. If so, you can use > MSXML in Python if you want. You'll need to install the Python for > Windows extensions. Something like this: Thanks for that Ross. That would make sense, I'd read somewhere that the 4suite code was a li

Re: Difference between two dates in seconds

2006-09-27 Thread Robert Kern
Steven D'Aprano wrote: > On Wed, 27 Sep 2006 20:16:52 +0200, Fredrik Lundh wrote: > >> Claes at work wrote: >> >>> Please tell me there is a simpler way than subtracting two datetimes >>> to get a timedelta and then compute >>> >>> days * number of seconds per day + seconds >>> >>> from it myself?

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it: 1. What exactly is a Python list? If one writes a[n], then is the complexity Theta(n)? If

Re: generator with subfunction calling yield

2006-09-27 Thread Matimus
The issue is that nn() does not return an iterable object. _nn() returns an iterable object but nothing is done with it. Either of the following should work though: def nn(): def _nn(): print 'inside' yield 1 print 'before' for i in _nn(): yield i print 'aft

Re: Difference between two dates in seconds

2006-09-27 Thread Rob Williscroft
Steven D'Aprano wrote in news:[EMAIL PROTECTED] in comp.lang.python: > On Wed, 27 Sep 2006 20:16:52 +0200, Fredrik Lundh wrote: > >> Claes at work wrote: >> >>> Please tell me there is a simpler way than subtracting two datetimes >>> to get a timedelta and then compute >>> >>> days * number of

Re: generator with subfunction calling yield

2006-09-27 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Any insight? >From the docs: The yield statement is only used when defining a generator function, and is only used in the body of the generator function. Using a yield statement in a function definition is sufficient to cause that defin

New fast PHP like scripting language

2006-09-27 Thread ai
We are looking for hard core web developers that are interested in checking out a new PHP like scripting engine. The scripting language is called LSP, which means Lua Server Pages. Lua is a very fast and easily learned scripting language. Please sign up for our new group and start developing ad

Re: OT: productivity and long computing delays

2006-09-27 Thread beliavsky
Paul Rubin wrote: > I'm doing something where I frequently but unpredictably (i.e. I can't > plan for it in advance) hit a snag that requires me to rebuild a large > project. The rebuild takes a couple hours. During that time, I'm > twiddling my thumbs and/or posting here, i.e. not getting anythi

Re: Difference between two dates in seconds

2006-09-27 Thread Steven D'Aprano
On Wed, 27 Sep 2006 20:16:52 +0200, Fredrik Lundh wrote: > Claes at work wrote: > >> Please tell me there is a simpler way than subtracting two datetimes >> to get a timedelta and then compute >> >> days * number of seconds per day + seconds >> >> from it myself?? > > why would you have to do

Re: generator with subfunction calling yield

2006-09-27 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi, > > I might understand why this does not work, but I am not convinced it > should not - following: > > def nnn(): > print 'inside' > yield 1 > > def nn(): > def _nn(): > print 'inside' > yield 1 > > print 'before' > _nn() >

Re: windev vs python SOS

2006-09-27 Thread John Henry
I don't know what windev is but presonally, I found Python to be incredibly productive. BTW: I recommend that you look into PythonCard. It sits on top of wxpython and I found it to be a very productive GUI tool. stéphane bard wrote: > hello, my boss ask me to prefer windev to python. > I have to

Re: optparse docs

2006-09-27 Thread Matthew Woodcraft
tobiah <[EMAIL PROTECTED]> wrote: > In > http://docs.python.org/lib/optparse-terminology.html > > The GNU project introduced "-" followed by a series of hyphen-separated > words, e.g. "-file" or "-dry-run". These are the only two option > syntaxes provided by optparse. [...] > So my ques

generator with subfunction calling yield

2006-09-27 Thread andy . leszczynski
Hi, I might understand why this does not work, but I am not convinced it should not - following: def nnn(): print 'inside' yield 1 def nn(): def _nn(): print 'inside' yield 1 print 'before' _nn() print 'after' for i in nnn(): print i for i in nn():

Re: How to get ip setting, dynamic ip or static ip?

2006-09-27 Thread Roger Upole
This means the unicode object contains characters that can't be represented in the default encoding. Try encoding it in another character set, something like adapter.Properties_['Caption'].Value.encode('mbcs') (you may need to use a different codec) Roger "kode4u" <[EMAIL PROTECTED]> wro

Re: AN Intorduction to Tkinter

2006-09-27 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > Mikael Olofsson wrote: > > > You probably mean > > > > http://www.pythonware.com/library/tkinter/introduction/ > > > > which is copyrighted 1999. There is also > > > > http://effbot.org/tkinterbook/ > > > > which I think is the most recent version of it. It states th

Re: XSLT speed comparisons

2006-09-27 Thread Ross Ridge
Damian wrote: > two websites, one in ASP.NET v2 and one in Python 2.5 (using 4suite for > XML/XSLT) > both on the same box (Windows Server 2003) > both using the same XML, XSLT, CSS > > The problem is, the Python version is (at a guess) about three times > slower than the ASP one. It could just be

Re: pythonol

2006-09-27 Thread John Machin
John Martin wrote: > 'pythonol' is a program for learning spanish. I think it's a really great > program. Unfortunately it ceased to work when I moved to SuSE 10 and 10.1 . > The author makes it clear on her website that she has devoted all the time > she's prepared to and won't maintain it. I thi

RE: productivity and long computing delays

2006-09-27 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > Anyone got any suggestions? How do you deal with this? It could be > mitigated with a faster computer (I'm using a 1.2 ghz Pentium M) but > the overall task isn't large enough to justify going out and buying > one. Anyway, I did the same build on a 2 ghz Athlon 64 and was >

Re: sqlite3 error

2006-09-27 Thread John Machin
John Salerno wrote: > CREATE TABLE Researchers ( > researcherID varchar(9) PRIMARY KEY NOT NULL, > birthYear int(4) DEFAULT NULL, > birthMonth int(2) DEFAULT NULL, > birthDay int(2) DEFAULT NULL, > birthCountry varchar(50) DEFAULT NULL, > birthState char(2) DEFAULT NU

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > > * C > > > > * A static functional language (ML, Haskell, etc) > > > > * Lisp or scheme Scheme > > > > * A static class-oriented language (Java, C++, etc) > > > > * A dynamic OO language (Python, ruby, smalltalk, etc) > > >

Re: How to read() twice from file-like objects (and get some data)?

2006-09-27 Thread [EMAIL PROTECTED]
Exactly what I needed! import StringIO from StringIO ... content=response.read() forms=ParseFile(StringIO(content), response.geturl()) ... Thank you all! -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto color selection PIL

2006-09-27 Thread Leif K-Brooks
Xiaolei wrote: > I'm trying to plot some points in an image. Each point has an > associating type and I'd like to have different colors (preferrably of > high contrast) for different types. The number of types in the data > file is unknown a priori. Is there a way to do this at runtime? How abo

Re: pythonol

2006-09-27 Thread George Sakkis
John Martin wrote: > 'pythonol' is a program for learning spanish. I think it's a really great > program. Unfortunately it ceased to work when I moved to SuSE 10 and 10.1 . > The author makes it clear on her website that she has devoted all the time > she's prepared to and won't maintain it. I thi

Re: Splitting device addresses into parts

2006-09-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Fabian Steiner wrote: > I often have to deal with strings like "PCI:2:3.0" or "PCI:3.4:0" and > need the single numbers as tuple (2, 3, 0) or (3, 4, 0). Is there any > simple way to achieve this? So far I am using regular expressions but I > would like to avoid them

Re: QuoteSQL

2006-09-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >> I'm assuming you mean, how would you get from a Python expression to a >> MySQL clause that looks like >> >> name like "%%%" >> >> (wildcard % followed by literal backslash \\ follo

Re: Survival of the fittest

2006-09-27 Thread baalbek
James Stroud wrote: > baalbek wrote: >> Why? The language is just so well designed (I miss some of Ruby's >> features, but then, nothing is perfect) > > Out of curiosity, what are these features that ruby has that python > lacks. Code blocks (closures), that are more advanced than Python's Lam

Re: Survival of the fittest

2006-09-27 Thread baalbek
Thomas Bartkus wrote: > Okay. How did your stated "policy" leave you still wasting 20-30% of your > programming efforts on other languages? > > We would be curious to know about those things you can do in C++ > but can't do in Python. > (Doubting) Thomas Bartkus Nothing to do with what C++ can

XSLT speed comparisons

2006-09-27 Thread Damian
Hi, I'm from an ASP.NET background an am considering making the switch to Python. I decided to develop my next project in tandem to test the waters and everything is working well, loving the language, etc. What I've got is: two websites, one in ASP.NET v2 and one in Python 2.5 (using 4suite for XM

Re: How to read() twice from file-like objects (and get some data)?

2006-09-27 Thread John J. Lee
Georg Brandl <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > Hello all, please correct me, if I do... > > from ClientForm import ParseResponse > > from urllib2 import urlopen > > ... > > response=urlopen(url) > > forms=ParseResponse(response) > > I won't be able to > > print response.re

Re: OT: productivity and long computing delays

2006-09-27 Thread tobiah
> about RSI). My workday is getting chopped up in a manner sort of like > memory fragmentation in a program, where you end up with a lot of > disjoint free regions that are individually too small to use. One way to look at this, is that the work environment is always fragmented. Emails, phone ca

Re: Computer Language Popularity Trend

2006-09-27 Thread James Stroud
Sherm Pendley wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > >>Xah Lee wrote: >> >>>Computer Language Popularity Trend >>> >> >>Careful there with the sweeping generalizations and quick judgments > > > Such things are all Xah does. Look at the distribution list for this > message

Re: OT: productivity and long computing delays

2006-09-27 Thread Paddy
Paul Rubin wrote: > I'm doing something where I frequently but unpredictably (i.e. I can't > plan for it in advance) hit a snag that requires me to rebuild a large > project. The rebuild takes a couple hours. During that time, I'm > twiddling my thumbs and/or posting here, i.e. not getting anyth

Re: OT: productivity and long computing delays

2006-09-27 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Paul> Anyway, I did the same build on a 2 ghz Athlon 64 and was > Paul> surprised that the speedup was only 35% or so. I'd have to get a > Paul> multiprocessor box to obtain really substantial gains. > > Maybe your build process is i/o bound. If you're usi

Auto color selection PIL

2006-09-27 Thread Xiaolei
Hi, I'm trying to plot some points in an image. Each point has an associating type and I'd like to have different colors (preferrably of high contrast) for different types. The number of types in the data file is unknown a priori. Is there a way to do this at runtime? The "solution" I have so

Re: Extra Newby question - Trying to create md5 File Listing

2006-09-27 Thread Jim
Thanks Dennis, I'm feeling very stupid. You're right about the config file containing drive/path/filenames (eg. c:\python24\*.exe or whatever). I want to output a text file that contains records like c:\python24\pythonw.exe[tab]md5 value, ... next file record. The following snippet works but I d

Re: OT: productivity and long computing delays

2006-09-27 Thread skip
Paul> Anyway, I did the same build on a 2 ghz Athlon 64 and was Paul> surprised that the speedup was only 35% or so. I'd have to get a Paul> multiprocessor box to obtain really substantial gains. Maybe your build process is i/o bound. If you're using GNU make and have the make depen

Re: OT: productivity and long computing delays

2006-09-27 Thread Larry Bates
Paul Rubin wrote: > I'm doing something where I frequently but unpredictably (i.e. I can't > plan for it in advance) hit a snag that requires me to rebuild a large > project. The rebuild takes a couple hours. During that time, I'm > twiddling my thumbs and/or posting here, i.e. not getting anythi

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > * C > > > * A static functional language (ML, Haskell, etc) > > > * Lisp or scheme Scheme > > > * A static class-oriented language (Java, C++, etc) > > > * A dynamic OO language (Python, ruby, smalltalk, etc) > > > > > > and at least a brief loo

Re: Talking to marketing people about Python

2006-09-27 Thread John J. Lee
"Carl Banks" <[EMAIL PROTECTED]> writes: [...] > Still don't know whether labeling something as written in Python is > intended to be a "badge of honor" or "advance warning". :-) I'm always surprised when people name *applications* with 'Py' in the name, unless they're squarely aimed at the geek

Re: Talking to marketing people about Python

2006-09-27 Thread John J. Lee
Roy Smith <[EMAIL PROTECTED]> writes: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it

Re: does anybody earn a living programming in python?

2006-09-27 Thread Paul Boddie
Dan Bishop wrote: > > Are you hiring? :-) No, just complaining. ;-) > It's so frustrating seeing all those job postings that require a > "mimimum 10 years experience". I've seen adverts with phrasing that could have been interpreted as having meant "minimum 10 years .NET experience", and that wa

OT: productivity and long computing delays

2006-09-27 Thread Paul Rubin
I'm doing something where I frequently but unpredictably (i.e. I can't plan for it in advance) hit a snag that requires me to rebuild a large project. The rebuild takes a couple hours. During that time, I'm twiddling my thumbs and/or posting here, i.e. not getting anything useful done. But the d

Re: How do I submit fixes for urllib2 & urlparse?

2006-09-27 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: [...] > Keep it up and you may get commit privileges eventually! No good deed goes unpunished :-) John -- http://mail.python.org/mailman/listinfo/python-list

Re: Battlefield Weapon Popularity Trend

2006-09-27 Thread Mirco Wahab
Thus spoke Chris Mattern (on 2006-09-27 19:09): > In article <[EMAIL PROTECTED]>, Mirco Wahab wrote: >> >>When the Samurai of medieval Japan were confronted >>with new 'battlefield language', e.g. early Shotguns, > > "early Shotguns" :D. Your mastery of the history of > firearms overwhelms me. Y

Re: identifying new not inherited methods

2006-09-27 Thread malkarouri
George Sakkis wrote: [...] > You're looking at it backwards; there's no particular reason this > should be a method of class A since it can be used for any arbitrary > object with no extra overhead. Now, if you intend to use it only for > instances of A and its subclasses, the only difference would

Re: How to read() twice from file-like objects (and get some data)?

2006-09-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Hello all, please correct me, if I do... > > from ClientForm import ParseResponse > from urllib2 import urlopen > ... > response=urlopen(url) > forms=ParseResponse(response) > > I won't be able to > > print response.read() > > in order to see HTML source anymore. In

Re: How do I submit fixes for urllib2 & urlparse?

2006-09-27 Thread John J. Lee
Neville CD <[EMAIL PROTECTED]> writes: > Basically I encountered some smallish problems with a couple of modules > and figure I can fix the problems. > > I did find http://sourceforge.net/projects/python, should I report my > problem report there and then assign them to myself to fix (and creat

Re: How to read() twice from file-like objects (and get some data)?

2006-09-27 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Hello all, please correct me, if I do... > > from ClientForm import ParseResponse > from urllib2 import urlopen > ... > response=urlopen(url) > forms=ParseResponse(response) > > I won't be able to > > print response.read() > > in order to see HTML source anymore. In o

Re: Computer Language Popularity Trend

2006-09-27 Thread Ari Johnson
[EMAIL PROTECTED] writes: > I don't think you can use any measure as an accurate yardstick, but > rather as an impressionistic canvas. Exactly. You can't measure "popularity" without defining the term. Xah Lee appears to define popularity based on the number of posts made in a given language's U

How to read() twice from file-like objects (and get some data)?

2006-09-27 Thread [EMAIL PROTECTED]
Hello all, please correct me, if I do... from ClientForm import ParseResponse from urllib2 import urlopen ... response=urlopen(url) forms=ParseResponse(response) I won't be able to print response.read() in order to see HTML source anymore. In other words I will see only an empty string. Suggest

Re: does anybody earn a living programming in python?

2006-09-27 Thread John J. Lee
Yes. John -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >