Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Andrew Berg
On 2013.03.17 19:58, Yves S. Garret wrote: > N00b question. But here is the code: > > http://bin.cakephp.org/view/709201806 > > In the first example, the first for-loop is run and then the list is assigned > to the tricky variable. But, what > happens in the second example? Does the loop aft

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Andrew Barnert
From: Mark Janssen Sent: Monday, March 18, 2013 4:41 PM > On Mon, Mar 18, 2013 at 2:51 PM, Andrew Barnert > wrote: >> Have you even looked at a message-passing language? >> >> A Smalltalk "message" is a selector and a sequence of arguments. > That&

Re: In defence of 80-char lines

2013-04-03 Thread Andrew Berg
While I agree that not having a line take up hundreds of characters is a good thing, 80 is really arbitrary in 2013 and having any self-imposed hard limit is silly. When you put a single 4- or 5-character word on a new line because you don't want to go over 80 (or 120 or whatever), the code is /les

Re: I hate you all

2013-04-05 Thread Andrew Berg
On 2013.04.05 17:04, [email protected] wrote: > Line 5 is the only line in the file that starts at col 9 (after a tab). Being > the only line in the file with that indent level, how can it be inconsistent ? The first indent level is done with spaces on the second line (for def) and then with

Re: I hate you all

2013-04-05 Thread Andrew Berg
On 2013.04.05 19:22, [email protected] wrote: > And now python forces me out of using any tab characters at all. I believe I > should still have a choice, python should at lest give an option to set tab > size, if the default of 8 is ambiguous now. Python (at least Python 3) has no concept o

Re: im.py: a python communications tool

2013-04-05 Thread Andrew Berg
On 2013.04.05 20:07, Roy Smith wrote: > I know this is off-topic, but I encourage people to NOT invent their own > licenses. Perhaps he meant this existing license: http://www.wtfpl.net/about/ -- CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1 -- http://mail.python.org/mailman/listinfo/python-

Re: Splitting of string at an interval

2013-04-08 Thread Andrew Berg
On 2013.04.08 21:38, Steven D'Aprano wrote: > In fact, I may make it a bare . so that not only will it be the shortest > program, but also the smallest program in terms of number of non-white > pixels. Until someone implements it in Whitespace. -- CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-16 Thread Andrew Berg
On 2013.04.16 11:02, Rodrick Brown wrote: > I came across this article which sums up some of the issues I have with > modern programming languages. I've never really looked at Javascript > for anything serious or Node itself but I found this article really > informational. I don't think the aut

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-16 Thread Andrew Berg
On 2013.04.16 12:14, rusi wrote: > However combine it with your other statement > >> Python's package management is suboptimal (though it is being worked on), > > and a different picture emerges, viz that *the ecosystem around the > language matters more than the language* It was a minor point,

[no subject]

2013-04-16 Thread Andrew Ndhlovu
-- Using Opera's mail client: http://www.opera.com/mail/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Andrew Berg
On 2013.04.19 12:17, lcrocker wrote: > Am I mistaken in my belief that tkinter is a non-optional part of the > Python language? I installed the "python3" package on Ubuntu, and > tkinter is not included--it's an optional package "python3-tk" that > has to be installed separately. I reported this as

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Andrew Berg
On 2013.04.19 12:42, lcrocker wrote: > I understand that for something like a server distribution, but Ubuntu > is a user-focused desktop distribution. It has a GUI, always. That is incorrect. http://www.ubuntu.com/server -- CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1 -- http://mail.python

Re: Include and lib files for Visual Studio?

2013-04-20 Thread Andrew Berg
On 2013.04.20 15:59, [email protected] wrote: > I am looking for the Python include and lib files for windows. I have a c++ > project that I am importing into Visual Studio 2010 (express) and it links > python. I need the include and lib files for windows. Where can I get them? > I'd like to use p

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Andrew Berg
On 2013.04.21 22:57, Steven D'Aprano wrote: > It's only easy to install a package on Ubuntu if you know that you have > to, and can somehow work out the name of the package. I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this kind of information in a description message or

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Andrew Berg
On 2013.04.21 23:34, rusi wrote: > On Apr 22, 9:24 am, Andrew Berg wrote: >> On 2013.04.21 22:57, Steven D'Aprano wrote:> It's only easy to install a >> package on Ubuntu if you know that you have >> > to, and can somehow work out the name of the package.

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Andrew Berg
On 2013.04.22 02:17, Steven D'Aprano wrote: > I think that if you are worrying about the overhead of the tkinter > bindings for Python, you're guilty of premature optimization. The tkinter > package in Python 3.3 is trivially small, under 2 MB. > > Besides, how far do we go? Do we expect people

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Andrew Berg
On 2013.04.22 19:22, Steven D'Aprano wrote: > It's only when I actually try to do something that requires an X display > that it will fail. I won't show the entire traceback, because it is long > and not particularly enlightening, but the final error message explains > exactly why it isn't worki

Re: Ubuntu package "python3" does not include tkinter

2013-04-23 Thread Andrew Berg
On 2013.04.23 00:49, Steven D'Aprano wrote: > Obviously you cannot display an X window without > X, well duh, but merely importing tkinter doesn't require an X display. Importing it doesn't. Doing anything useful with it, however, does. Would you consider the engine an optional part of a car? Af

Re: TCP reassembly

2013-04-25 Thread Andrew Berg
On 2013.04.25 18:35, Hasil Sharma wrote: > Hi everyone , > How to reassemble the TCP data packets into objects viz. html , css , js > image files etc . I have no idea how to implement it using python , please > help ? TCP packets don't need to be reassembled. If your application receives TCP pa

Re: How do I encode and decode this data to write to a file?

2013-04-29 Thread Andrew Berg
On 2013.04.29 04:47, [email protected] wrote: > If I understand correctly the encode() is saying that it can't > understand the data in the html because there's a character 0xc3 in it. > I *think* this means that the é is encoded in UTF-8 already in the > incoming data stream (should be as my system is

Re: Python not starting

2013-05-05 Thread Andrew Berg
On 2013.05.05 13:55, Steven D'Aprano wrote: > (you might need to use /S on Windows instead, I'm not sure.) That is only a convention among Microsoft's CLI utilities. Very few others follow it (even for programs written specifically for Windows), and it is certainly not a necessity on Windows. --

Re: threading IOError

2005-12-13 Thread Andrew MacIntyre
used to identify the exception (incorrectly). The invalid page fault may well be because a garbage pointer is handed to a routine, possibly as a consequence of the mishandled error return. - Andrew I MacIntyre

Re: in Python

2005-12-15 Thread Andrew Koenig
"Andy Leszczynski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can do elegantly in Python: > > if condition: >a=1 > else: >a=2 I believe that before long Python will support a=1 if condition else 2 -- http://mail.python.org/mailman/listinfo/python-list

Re: "Humane" programmer interfaces

2005-12-29 Thread Andrew Durdin
ace, these special cases only add unneeded complexity. Non est ponenda pluritas sine necessitate -- William of Ockham. Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido working on Pypy?

2005-12-29 Thread Andrew Durdin
tion? > Luis Or deny it: http://zephyrfalcon.org/weblog2/arch_e10_00870.html#e872 Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-29 Thread Andrew Durdin
On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: > I just found a 125 character solution. It's actually faster and more > readable than the 133 character solution (though it's still obscure.) Having spent a good deal of time and effort, and not getting below 144 characters, I am now very ea

Re: "Humane" programmer interfaces

2006-01-02 Thread Andrew Durdin
eneral interface, these special cases only add unneeded complexity." If the general interface is either not simple or not obvious for a task, then a special interface is likely more suitable. Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex anomaly

2006-01-02 Thread Andrew Durdin
.match() are so different, but that's the cause of what you're seeing. You need to do: reCompiled = re.compile(reStr, re.I) reCompiled.match(against).groups() to get the behaviour you want. Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex anomaly

2006-01-03 Thread Andrew Durdin
e flags need to be specified when the regex is compiled, as they affect the compiled representation (finite state automaton I expect) of the regex. If the flags were given in pattern.match(), then there'd be no performance benefit gained from precompiling the regex. Andrew -- http://mail.pyth

Augmented generators?

2006-01-10 Thread Andrew Koenig
Can anyone think of an easy technique for creating an object that acts like a generator but has additional methods? For example, it might be nice to be able to iterate through an associative container without having to index it for each element. Right now, I can say i = iter(d) and then r

Re: OT: excellent book on information theory

2006-01-16 Thread Andrew Swallow
in the H.P. books where > the dialog seemed "wrong": the kids were using American rather > than British English. I thought it rather jarring. > In a bid for a US Government contract I had to rewrite British documents to use the official American terms and words. Bill to be pa

pythonic way of making a config module

2006-01-18 Thread andrew . fabbro
I'm working on an app that will be deployed on several different servers. In each case, I'll want to change some config info (database name, paths, etc.) In perl, I would have done something like this: Package Config; $dbname = "somename"; etc. And then use'd the module and referenced

math symbols not displaying

2006-07-14 Thread Andrew Dabrowski
I'm working on a simple Python program, with Tkinter, and I need to display the math symbols for set union and intersection, in unicode \N{N-ARY UNION} and \N{N-ARY INTERSECTION}. Everything was displaying correctly (when I ran the program) until I changed my OS distribution from SuSE to Ubuntu

Re: _mssql on Python 2.5 Beta 2

2006-07-24 Thread Andrew MacIntyre
oneously assumes that free() can be used to release any block of memory, regardless of which API family was used to allocate the memory. This code needs to be fixed. -- ----- Andrew I MacIntyre "These

stuff 2

2006-07-24 Thread Andrew Coffman
http://www.ferg.org/papers/debugging_in_python.html python and vmware (interface) using super(): super(class, instance).method() class MyConfig(ConfigParser, object): def add_section(self, section) super(MyConfig, self).add_section(section) effing the ineffable: http://maverickphi

Re: How do I pass a list to a __init__ value/definition?

2006-07-25 Thread Andrew Koenig
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > class MultipleRegression: >def __init__(self, dbh, regressors, fund): >self.dbh = dbh >self.regressors = regressors > > and I want to be able to enter regressors as a list like > MultipleRegression(dbh, [1,2,3,4], 5

Re: Windows vs. Linux

2006-08-04 Thread andrew clarke
On Tue, Aug 01, 2006 at 05:31:01PM +0200, Sybren Stuvel wrote: > James Stroud enlightened us with: > > its better to use: > > > >os.path.join('my', 'favorite', 'dir') > > > > than > > > >"\\".join(['my', 'favorite', 'dir']) > > > > because the latter will bonk on linux. > > Ehm... replace

Re: Windows vs. Linux

2006-08-04 Thread andrew clarke
On Fri, Aug 04, 2006 at 02:01:58PM +0200, Sybren Stuvel wrote: > > OS/2 (and eComStation) also uses the backslash as the path > > separator. > > You mean OS/2 is still in actual use? 'fraid so. :-) -- http://mail.python.org/mailman/listinfo/python-list

Linting python code...

2006-10-10 Thread Andrew Markebo
Alalalala lint.. alalalala lint... Ehm :-) Are there any python-code linter out there - or the code is so easy to write that it always is so perfekt? :-) /Andy -- Don't walk in front of me, I might be unable to follow you. Don't walk after me, I might be unable to lead you. Just w

Re: Converting MSWord Docs to PDF

2006-10-10 Thread Andrew McLean
Steve Holden wrote: > If that *isn't* satisfactory then a modest investment in Adobe > Acrobat/Distiller plus the use of Python's scripting facilities to > direct the conversion would be preferable to spending a huge amount of > time writing a hand-crafted solution. An alternative to Adobe Dist

Re: Standard Forth versus Python: a case study

2006-10-12 Thread Andrew Haley
In comp.lang.forth Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> fun median { >> var x = 0. >> while( *p++) { >> if( (*p) > x) x = *p. >> } >> return x. >> } > I

Re: Starting out.

2006-10-12 Thread Andrew Poelstra
t;A Byte of Python". It was okay, although not very refined last I checked. From there you just need to work on some random projects, and you'll become more proficient. (OT: Try to type 'proficient' with one hand on a US keyboard. :-)) -- Andrew Poelstra <http://www.wpsof

Re: Starting out.

2006-10-13 Thread Andrew Poelstra
ou may be thinking of Perl, which has a very similar syntax to PHP. In all the languages I've seen, Python is in a class of its own. -- Andrew Poelstra <http://www.wpsoftware.net/projects/> -- http://mail.python.org/mailman/listinfo/python-list

ZODB and Python 2.5

2006-10-20 Thread Andrew McLean
I'm going to have to delay upgrading to Python 2.5 until all the libraries I use support it. One key library for me is ZODB. I've Googled and can't find any information on the developers' plans. Does anyone have any information that might help? - Andrew -- http://mai

Re: ZODB and Python 2.5

2006-10-21 Thread Andrew McLean
Robert Kern wrote: > I would suggest, in order: > > 1) Look on the relevant mailing list for people talking about using ZODB > with Python 2.5. Been there, didn't find anything. Except that recently released versions of Zope (2.9.5 and 2.10.0) aren't compatible with Python 2.5. [Being pedantic

Re: multythreading app memory consumption

2006-10-24 Thread Andrew MacIntyre
1MB or 8MB depending on threading library and/or distro FreeBSD: 64kB -- ----- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: PO Box 370

Re: return tuple from C to python (extending python)

2006-10-24 Thread Andrew Poelstra
On Tue, 2006-10-24 at 15:24 -0700, Kiran wrote: > Hi all, I want to make python call some C functions, process them and > return them. Try comp.lang.python -- Andrew Poelstra <http://www.wpsoftware.net/projects/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Andrew MacIntyre
he config file. -- ----- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: PO Box 370 [EMAIL PROTECTED] (alt) |Belconn

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-10 Thread Andrew MacIntyre
Robin Becker wrote: > Robin Becker wrote: >> Andrew MacIntyre wrote: >>> Robin Becker wrote: >>> >>>> I think it uses sysv semaphores and although freeBSD 6 has them >>>> perhaps there's something I need to do to allow them to work. >&

Python-2.5.exe?

2006-11-15 Thread Andrew Burton
alled so as not to touch the registry, to make them portable? -- Andrew Burton [EMAIL PROTECTED] http://utilitarian.us - A Guide to Esoteric Technology in Paragon City http://jarodrussell.livejournal.com/ - Take a guess. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: what are you using python language for?

2006-06-08 Thread Andrew Robert
I use python and the pymqi module to work with IBM WebSphere MQSeries and IBM WebSphere Message broker. -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ question

2006-06-09 Thread Andrew Robert
If I remember correctly, this behavior depends on how the class is created (classic mode versus modern). Modern class foo(object): pass Classic ( pre python 2.2 I believe ) class foo(): pass The modern method of specifying object in the class def

Re: .py and running in Windows:

2006-06-13 Thread Andrew Gwozdziewycz
change the default .py extension to open in an editor rather > than execute it if I open it? > > Thanks: > Michael Yanowitz > > -- > http://mail.python.org/mailman/listinfo/python-list --- Andrew Gwozdziewycz [EMAIL PROTECTED] http://23excuses.com | http://ihadagreatview.o

Re: Making a Label that looks the same as a button.

2006-06-13 Thread Andrew Gwozdziewycz
border thicker. > > How do I get the Label object to look just like the Button object? > > -- > http://mail.python.org/mailman/listinfo/python-list --- Andrew Gwozdziewycz [EMAIL PROTECTED] http://23excuses.com | http://ihadagreatview.org | http://and.rovir.us -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question

2006-06-19 Thread Andrew Robert
Saint Malo wrote: > I am new to programming, and I've chosen python to start with. I wrote > a simple program that asks several questions and assings each one of > them a variable via raw_input command. I then combined all the > variables into one like this a = b + c + d. After this I wrote these

Albatross 1.35 released

2006-06-20 Thread Andrew McNamara
was not being passed through to the input registry within the NameRecorderMixin. * If a client closed it's connection to the session server while the server had data pending for the client, a subsequent del_write_file would generate an exception, killing the session server. -- Andrew McN

Running a Python App from a Web Page

2006-06-20 Thread Andrew Burkhardt
I have created an Tkinter GUI application with Python and I want to host this on a web page that is provided by my internet provider (mediacom).  Whats the easiest and best method to convert my python code in order for it can be ran from a web page? -- http://mail.python.org/mailman/listi

Question regarding commit/backout of a message using the pymqi module

2006-06-21 Thread Andrew Robert
Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries an drops it to the local file system. Transmission of the file works as designed but it has a flaw. If th

Life + Python = Golly

2006-06-25 Thread Andrew Trevorrow
mments or suggestions are most welcome. Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Andrew McDonagh
Joachim Durchholz wrote: > Chris Smith schrieb: >> Joachim Durchholz <[EMAIL PROTECTED]> wrote: >>> Sorry, I have to insist that it's not me who's stretching terms here. >>> >>> All textbook definitions that I have seen define a type as the >>> set/operations/axioms triple I mentioned above. >>> N

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Andrew McDonagh
Chris Smith wrote: > Andrew McDonagh <[EMAIL PROTECTED]> wrote: >> I haven't read all of this thread, I wonder, is the problem to do with >> Class being mistaken for Type? (which is usually the issue) > > Hi Andrew! Hi Chris > > Not much of this thread ha

Looking for Python code to obsfucate mailto links on web site

2006-06-25 Thread Andrew McLean
I'm looking at putting some e-mail contact addresses on a web site, and wanted to make it difficult for spammers to harvest them. I found some Python code that I can call within my application. http://www.zapyon.de/spam-me-not/ It works exactly as expected. However, I am concerned that the tech

Re: 'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread Andrew McNamara
newlines can appear quoted inside a field: using universal newlines, these "quoted newlines" would be damaged (because it's unaware of the quoting conventions). If your data file contains no quoted newlines (they're rare, but if you need them, you need them), then opening th

Re: Looking for Python code to obsfucate mailto links on web site

2006-06-27 Thread Andrew McLean
Dan Sommers wrote: > On Sun, 25 Jun 2006 21:10:31 +0100, > Andrew McLean <[EMAIL PROTECTED]> wrote: > >> I'm looking at putting some e-mail contact addresses on a web site, >> and wanted to make it difficult for spammers to harvest them. > > [ ... ] > &g

A Solution using Tasks Re: [Stackless] Suggestion for a Solution ? Re: Blocking Problem with Stackless Python and Twisted

2006-06-28 Thread Andrew Francis
pingCall(pump) l.start(some_time_period) reactor.listenTCP(port, MyHttpFactory()) reactor.run() While Twisted waits for a connection, the call to pump() allows other tasklets that are waiting, a chance to run. Once I know all the ins-and-outs, I will write this up in the Wiki including an example. T

Solution for XML-RPC over a proxy

2006-07-06 Thread Andrew R
cript is a replacement/update to the earlier work. It is runnable as a test or usable as a module. Tests pass from behind and away from a proxy, on win32 and Linux i686, with Python 2.4.1. Comments welcome. Regards Andrew --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 #!/bin/env py

Re: Conway's Life Implementation

2006-08-27 Thread Andrew Trevorrow
ly's GUI is written in wxWidgets (C++, not wxPython) but we do use Python as our scripting language: http://golly.sourceforge.net/Help/scripting.html Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Middle matching - any Python library functions (besides re)?

2006-08-28 Thread Andrew Robert
Simon Forman wrote: > Paul Rubin wrote: >> "EP" <[EMAIL PROTECTED]> writes: >>> Given that I am looking for matches of all files against all other >>> files (of similar length) is there a better bet than using re.search? >>> The initial application concerns files in the 1,000's, and I could use >>>

Re: Middle matching - any Python library functions (besides re)?

2006-08-28 Thread Andrew Robert
Simon Forman wrote: > Andrew Robert wrote: >> Simon Forman wrote: >>> Paul Rubin wrote: >>>> "EP" <[EMAIL PROTECTED]> writes: >>>>> Given that I am looking for matches of all files against all other >>>>> files (of s

Re: Python editor

2006-08-29 Thread Andrew Robert
[EMAIL PROTECTED] wrote: > John Salerno wrote: >> Is it possible to get vim-python for Windows, or is that just a Linux build? > > > It builds for windows. > When installed, you may also want to consider the python add-on located at http://www.vim.org/scripts/script.php?script_id=790 Enhanced

SWIG wrapper/Python2.5c1 problem

2006-08-29 Thread andrew . gregory
r for callbacks */ char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); <-- error occurs here. This must be caused by a change in Python.h, as there were no problems with Python 2.3 or 2.4. SWIG version 1.3.29. Used -c++ and -shadow options. Can anyone reproduce this? Andrew. --

Re: Linear regression in 3 dimensions

2006-09-08 Thread Andrew McLean
Bernhard, Levenberg-Marquardt is a good solution when you want to solve a general non-linear least-squares problem. As Robert said, the OPs problem is linear and Robert's solution exploits that. Using LM here is unnecessary and I suspect a fair bit less efficient (i.e. slower). - A

Algorithm Question

2006-09-10 Thread Andrew McLean
still satisfying the constraint 2. replacing two elements by a common sub-string if that reduced T Anyway. It occurred to me that this might be a known problem. Any pointers gratefully received. - Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Ghostscript interface

2006-09-10 Thread Andrew MacIntyre
it is trivial to implement one with ctypes (included with 2.5). -- ----- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: PO Box 370 [EMAIL PRO

Re: Algorithm Question

2006-09-11 Thread Andrew McLean
Carl Banks wrote: > Andrew McLean wrote: >> I have a list of strings, A. I want to find a set of strings B such that >> for any "a in A" there exists "b in B" such that b is a sub-string of a. > > B=A? > >> But I also want to minimise T = sum_j

Re: Algorithm Question

2006-09-14 Thread Andrew McLean
eep two things small, the problem isn't very well defined. The current approach works, I was just musing whether there was a faster approach, so don't think about it too hard. - Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-14 Thread Andrew McLean
Roy Smith wrote: > > As I remember, you didn't need the whitespace either. IIRC, your example > above could have been written as: > > PROGRAMKWDS > REALREAL,WRITE > WRITE=1.0 > REAL=2.0 > WRITE(*,*)WRITE,REAL > END > It's stranger than that. FORTRAN 77 is in

Unexpected behaviour of csv module

2006-09-24 Thread Andrew McLean
as to why it is considered desirable behaviour. - Andrew import csv filename = "test_data.csv" # Generate a test file - note the spaces before the newlines fout = open(filename, "wb") fout.write('"Field1","Field2","Field3" \n') fout.write('

Re: Unexpected behaviour of csv module

2006-09-25 Thread Andrew McLean
John Machin wrote: > A better workaround IMHO is to strip each *field* after it is received > from the csv reader. In fact, it is very rare that leading or trailing > space in CSV fields is of any significance at all. Multiple spaces > ditto. Just do this all the time: > > row = [' '.join(x.split(

Re: Unexpected behaviour of csv module

2006-09-26 Thread Andrew McLean
John Machin wrote: > You can fix that. The beauty of open source is that you can grab it > (Windows: c:\python2?\lib\csv.py (typically)) and hack it about till it > suits your needs. Go fer it! Unfortunately the bits I should change are in _csv.c and, as I'm not very proficient at C, that wouldn'

Re: merits of Lisp vs Python

2006-12-11 Thread Andrew Reilly
r the lisp name for floating points is (imprecise?) -- something that not many (if any) processor instruction sets can manage. So that's still type-dependent dispatch, which isn't going to get us to the speeds that we actually see reported unless there's extra stuff going

Re: merits of Lisp vs Python

2006-12-14 Thread Andrew Reilly
n and what-not at run-time, based on a big table of your algebra rules? It's for output to a human, isn't it? It's not as though it needs to be particularly fast? Maybe I'm just not digging the example sufficiently. That's likely: I've yet to write my first lisp pr

Re: merits of Lisp vs Python

2006-12-14 Thread Andrew Reilly
On Thu, 14 Dec 2006 04:06:26 -0500, Ken Tilton wrote: > Ken Tilton wrote: >> Andrew Reilly wrote: >>> However, in this particular instance, I'm inclined to wonder why >>> meta-programming is the right answer, rather than just doing all of the >>> interpola

How to build Boost.Python

2006-01-23 Thread Andrew Ayre
Hi, I can't seem to get the library built, and any help is greatly appreciated. Here is the info: Windows XP Borland C++ Builder 5 Latest Boost source code (downloaded at the weekend) Windows binary bjam 3.1.11 Command line: bjam "-sTOOLS=borland" "--with-python-root=C:\Python" "--with-python" i

Executing script with embedded python

2006-01-25 Thread Andrew Ayre
Hi, I have a script that I want to execute from C. I don't want to call any functions, just execute the script. Below is a code snippet. The problem is that PyObject_CallObject always returns NULL. Is this the correct return value for simply executing a script, as there is no function return value

Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre
"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The problem is that PyObject_CallObject always returns NULL. Is this the > > correct return value for simply executing a script, as there is no function > > return value involved? > > The documentation for PyObject_

Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre
"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The problem is that PyObject_CallObject always returns NULL. Is this the > > correct return value for simply executing a script, as there is no function > > return value involved? > > The documentation for PyObject_

Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre
"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The problem is that PyObject_CallObject always returns NULL. Is this the > > correct return value for simply executing a script, as there is no function > > return value involved? > > The documentation for PyObject_

Re: would it be feasable to write python DJing software

2006-02-03 Thread Andrew Gwozdziewycz
x27;re development time will be fast, and you will probably see some good results. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid.org -- http://mail.python.org/mailman/listinfo/python-list

Natural Language Date Processing.

2006-02-07 Thread Andrew Gwozdziewycz
k the standard date, datetime and time modules and also mx.Date* modules. Am I overlooking something here or does it not exist? Anyone know of an implementation? Also, I realize that this is perhaps very English specific so I apologize to any non-native English speakers. --- Andrew Gwozdziewycz [EM

Re: Natural Language Date Processing.

2006-02-07 Thread Andrew Gwozdziewycz
source of the php function and it manually parses it (i assume according to the GNU date rules). However, i'd prefer not to have to port the function to python if someone else has already done so, or has a more pythonic implementation. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http:

Re: Is Python good for web crawlers?

2006-02-07 Thread Andrew Gwozdziewycz
ic webcrawler as a google desktop plugin called Kongulo (http://sourceforge.net/projects/goog-kongulo/) which is written in python. I would think python would be perfect for this sort of application. Your bottleneck is always going to be downloading the page. -- Andrew Gwozdziewycz <[EMAIL

Re: Natural Language Date Processing.

2006-02-07 Thread Andrew Gwozdziewycz
ther or not it'll perform well is another story... Thanks for the help. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to get PIL to load jpeg images

2006-02-08 Thread Andrew Gwozdziewycz
n remember when compiling the PIL on my mac having to create a symbolic link to libjpeg.so.6 or something. It was bizarre but worked fine afterwards. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted book opinions?

2006-02-09 Thread Andrew Gwozdziewycz
leaves off. I thought the O'Reilly book was pretty decent at describing how to setup a web application. It's not entirely complete, but I was able to piece together an application with a somewhat complex web application on top of it. Twisted made it quite easy. -- Andrew Gwozdziewycz <[EMAI

Re: trapping errors in function call syntax

2006-02-13 Thread Andrew Gwozdziewycz
t; def func(dummy=None, a=1, b=2, c=3): > ... if dummy is not None: > ... raise TypeError("invalid call") > ... print a, b, c > > (but this is easier to trick). > > hope this helps! > > > > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid.org -- http://mail.python.org/mailman/listinfo/python-list

Re: web crawler in python or C?

2006-02-16 Thread Andrew Gwozdziewycz
numerous posts about spiders. One interesting fact is that google itself starting with their spiders in python. http://www-db.stanford.edu/~backrub/google.html I'm _sure_ it'll work for you. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid

Re: ANN: FreeImagePy 1.2.2

2006-02-16 Thread Andrew Gwozdziewycz
reeImage :-( . both freeimagepy and freeimage are released under the GPL, PIL is not. -- Andrew Gwozdziewycz <[EMAIL PROTECTED]> http://ihadagreatview.org http://plasticandroid.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Job advert: Your help needed

2006-02-17 Thread Andrew Koenig
"Paul Boots" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul Boots > [EMAIL PROTECTED] > +354 664 1748 Iceland? really?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-02 Thread Andrew MacIntyre
Oracle for Python 2.1, but you would have to check that the code doesn't require Python 2.2 or later features. The MingW gcc package should work with Python 2.1 (which was built with VC6 as I recall). I've been bugging ESRI about upgrading, and I'm sure others have too.

<    5   6   7   8   9   10   11   12   13   14   >