Re: Python supports LSP, does it?

2005-08-10 Thread Andy Leszczynski
Mike Meyer wrote: [...] > The wikipedia was really abusing the phrase LSP. I've corrected the > wikipedia. > http://mail.python.org/mailman/listinfo/python-list

Adobe COM with Python

2005-08-19 Thread Andy W
I'm wanting to automate Adove Acrobat Reader using Com thru Python and win32com, but i can't find any documentation for the Adobe stuff? Has anyone done anything with Acrobat COM ? I've searched Google groups and the web but am unable to find anything. Thanks Andy -- http://

Re: Adobe COM with Python

2005-08-19 Thread Andy W
nstall the SDK as well ? I'm new to this COM stuff as you can guess. Benjamin Niemann wrote: > Andy W wrote: > > >>I'm wanting to automate Adove Acrobat Reader using Com thru Python and >>win32com, but i can't find any documentation for the Adobe stuf

Re: Adobe COM with Python

2005-08-19 Thread Andy W
I wanting to print the PDF to a printer which is set to print to file, so efectively i end up with a ps file. so 1 pdf becomes 1 ps file Tim Golden wrote: > [Andy W] > > | What i want to do is use, python COM to fireup Adobe and > | print the pdf > | file to a printer. > &

Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
unlike that standard installation where everything is scattered across /usr /bin/ /.../doc. That way I can easily tar it and distribute to whatever machine I want. How can I achieve that? Please help, Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
Jeremy Jones wrote: > Andy Leszczynski wrote: > > Download the source, untar, cd to the new directory, run: > > ./configure --prefix=/opt/mypython > make > make install Is there any way to pass the prefix to the "make install"? Why "make" depends on tha

Re: Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
Robert Kern wrote: > Andy Leszczynski wrote: > >>Jeremy Jones wrote: >> >> >>>Andy Leszczynski wrote: >>> >>>Download the source, untar, cd to the new directory, run: >>> >>>./configure --prefix=/opt/mypython >>>make

Re: Manging multiple Python installation

2005-09-13 Thread Andy Leszczynski
Jeremy Jones wrote: > I guess I'm still having a hard time understanding "what does it > matter?". I was under impression that configure embeds the prefix in the build itself. I was concerned to have to preform the configure/make every time I change the destination path. It turns out that the

RFC 1521 and missing binary Content-Transfer-Encoding in email module

2005-09-15 Thread Andy Leszczynski
Why email/Encoders.py is missing binary encoding. It should be there according to RFC 1521: encoding := "Content-Transfer-Encoding" ":" mechanism mechanism := "7bit" ; case-insensitive / "quoted-printable" / "base64" / "8bit"

Re: Performance Issues of MySQL with Python

2005-02-10 Thread Andy Dustman
There aren't any "issues", but there are a few things to keep in mind. First of all, prior to 4.1, MySQL does no parameter binding, which means that the parameters must be inserted into your SQL statements as literals. MySQLdb will do this for you automatically, but keep in mind that you will be c

Re: Performance Issues of MySQL with Python

2005-02-11 Thread Andy Dustman
Well, it does more than that. It converts each column from a string (because MySQL returns all columns as strings) into the appropriate Python type. Then you were converting all the Python types back into strings. So it's no mystery that using the command line client is faster, since it would take

Re: MYSQL - how to install ?

2005-02-17 Thread Andy Dustman
For those of you who care, the latest stable version of MySQLdb is 1.2.0. Currently there is not a WIndows installer, however. I do not have the toolchain to build it, either; I depend on people to donate installers. If you have Python from the python.org packages and MySQL from the mysql.com pac

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Andy Dustman
I did some timings of ''.join( ) vs. ''.join( ) and found that generator expressions were slightly slower, so I looked at the source code to find out why. It turns out that the very first thing string_join(self, orig) does is: seq = PySequence_Fast(orig, ""); thus iterating over your ge

Re: MYSQL - how to install ?

2005-02-17 Thread Andy Dustman
There's a Windows package for MySQL-4.1.9 and Python-2.4 on SourceForge now, thanks to Michal Zylinski. https://sourceforge.net/project/showfiles.php?group_id=22307&package_id=15775&release_id=303257 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Andy Dustman
Looking at the code, it seems that if it finds a unicode object on the first pass (the sizing pass), it punts and returns PyUnicode_Join(self, seq), which is the sequence from above and not necessarily the original object (orig), and starts over. In the worst-case scenario, you have a long sequence

wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and Events/Process. Type in "python -u demo.py" and wait. There is a splash screen but nothing more. Why? Regards,A. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Andy Leszczynski wrote: Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and Events/Process. Type in "python -u demo.py" and wait. There is a splash screen but nothing more. Why? Regards,A. Forgot to add that it happnes on Win2K. -- http://mail.python.org/mailman/listi

wxPython 2.5 - bug in wx.Execute

2005-02-19 Thread Andy Leszczynski
Demo by opening Process and Events/Process. Then after typing in "python -u demo.py" nothing happens. Please help, it really blocks me. The temporary work around is to use "cmd /e python -u demo.py", but I lose the unbuffered -u effect. Thanks, Andy -- http://mail.python.

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-20 Thread Andy Dustman
Did you build your own MySQL, or did you use a pre-built version? And what version? It's not clear if you're using 4.0 or 4.1. If mysql_config is returning the wrong flags, then that's a bug with MySQL. You should be able to work around this by doing this in setup.py before the call to setup(): e

rounding problem

2005-02-23 Thread Andy Leszczynski
It is on Windows, Linux, Python 2.3: [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a=1.1 >>> a 1.1001 >>> Is it normal? Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: pyGoogle is fun and easy to use, and thinks Python is the best programming language

2005-02-24 Thread Andy Robinson
Regrettably, inserting "Visual Basic" into the list produces a different winner. I think you want some very subtle hard coding which limits it to on-space-delimited languages :-( - Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-25 Thread Andy Dustman
What happens when you try to connect? Be sure to check /etc/hosts.allow and .deny on the server, if your server is compiled with TCP wrapper support. -- http://mail.python.org/mailman/listinfo/python-list

[Twisted] potential bug in the reactor's handling events loop

2005-03-01 Thread Andy Leszczynski
"5",`eventType` Of course it is quick work around, not a permanent fix, but it really helps. Please advice, Andy -- http://mail.python.org/mailman/listinfo/python-list

What e-mail list provides the best support for Twisted?

2005-03-02 Thread Andy Leszczynski
Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-09 Thread Andy Leszczynski
for each new connection new, but the main loop seems to be frozen until the prevoius handling ends. What could go wrong? Thanks, Andy * * * import os import time import BaseHTTPServer import SocketServer import threading import sys class SimpleHTTPRequestHandler

BaseHTTPServer.BaseHTTPRequestHandler and HTTP chunking

2005-03-09 Thread Andy Leszczynski
Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking? Thanks, Andy -- http://mail.python.org/mailman/listinfo/python-list

looking for case insesitive dictionary

2005-03-09 Thread Andy Leszczynski
so e.g. x={} x['a']=1 x['A']=2 print x['a'] #prints 2 Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-11 Thread Andy Leszczynski
Sorry for questioning Python :-) - it turned out that this is a problem with Mozilla. For some reason it holds up with opening second connection to given host until the previous one is completed. Interestingly enough, IE works better with Python multi threaded server in that regard. Thx, A. --

Re: Thank you. New question concerning text encoding

2005-03-13 Thread Andy Dustman
The default character set used by MySQL for the connection is latin1. If you control the server, you can configure this in the system my.cnf. Otherwise, it is possible to set it in a local configuration file and use the read_default_file option to connect to set it. http://dev.mysql.com/doc/mysql/

Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-13 Thread Andy Leszczynski
Steve Holden wrote: Andy Leszczynski wrote: Sorry for questioning Python :-) - it turned out that this is a problem with Mozilla. For some reason it holds up with opening second connection to given host until the previous one is completed. Interestingly enough, IE works better with Python multi

Re: Can't seem to insert rows into a MySQL table

2005-03-15 Thread Andy Dustman
Anthra Norell wrote: > Very true! > I could verify that cursor.execute () seems to understand "... %s ...", > ..."string"... where print () doesn't.. I didn't know that. > I could also verify that gumfish's ineffective insertion command works fine > for me. (Python 2.4, mysql-3.23.38). So it looks

ANN: ReportLab Toolkit - Release 1.20

2004-11-30 Thread Andy Robinson
details are here: http://www.reportlab.org/relnotes.html Best Regards, Andy Robinson CEO/Chief Architect ReportLab Europe Ltd tel +44-20-8544-8049 -- http://mail.python.org/mailman/listinfo/python-list

Re: help using sockets, and OOP?

2004-12-06 Thread Andy Gross
On Dec 6, 2004, at 12:04 PM, Dfenestr8 wrote: Ok, so are there other types of sockets that aren't "blocking" ? Yes, sockets can be either blocking or non-blocking. An I/O operation on a 'blocking' socket will not return until the operation is complete. If you try to read more bytes than are cur

Re: xmlrpclib or twisted?

2004-12-06 Thread Andy Gross
If you're not concerned about interoperability with other languages and are already using Twisted, I'd go with PB. Especially if you are using complicated datatypes that have to be serialized and sent over the wire - PB has a nice Cacheable type that doesn't serialize the whole object. XMLRPC

Re: better regular expression?

2004-12-06 Thread Andy Gross
Check out the 'urlparse' module, in the standard library, unless for some reason you *have* to use regular expressions. /arg On Dec 6, 2004, at 7:46 PM, Vivek wrote: Hi, I am trying to construct a regular expression using the re module that matches for 1. my hostname 2. absolute from the root UR

Re: Help with super()

2004-12-07 Thread Andy Gross
Florian, See: http://www.python.org/doc/newstyle.html /arg On Dec 7, 2004, at 5:38 AM, Florian Lindner wrote: Steven Bethard schrieb: Christopher J. Bottaro wrote: Why don't this code work? import PRI class Poscdnld_PYIO(PRI.BasicBatch): def __init__(self, *argv): super(Poscdnld_PYIO, s

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
You'll want to use the "compiler" package. compiler.parseFile will return an AST that you can inspect (which is not really 'reflection', btw). /arg On Dec 7, 2004, at 10:56 PM, Caleb Hattingh wrote: Hi You could just parse the model file. Off the top of my head *** f = open('ModuleYouWantToExa

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
walk(ast, SimpleVisitor(), verbose=True) --- [EMAIL PROTECTED]:~$ ./test.py Function aFunction at 2 takes ['anArg'] with code Stmt([Return(Add((Name('anArg'), Const(1]) HTH, /arg On Dec 7, 2004, at 11:14 PM, Caleb Hattingh wrote: Andy thx for that. I had a file called '

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
On Dec 7, 2004, at 4:20 PM, Steven Bethard wrote: If you have source control over this file, you could write it with the more standard idiom... I should have mentioned this first. If you're just trying to avoid existing top-level code from being executed, use the if __name__ == "__main__" idiom

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
So, in Smalltalk, the way you find out about what's in the system is reflection...you ask the classes what methods they implement (if looking for 'implementors'), you ask the methods for the source and can string search the code (if looking for senders). There's no real way to get the source cod

Re: [SPAM] Re: Import a module without executing it?

2004-12-08 Thread Andy Gross
On Dec 8, 2004, at 5:44 AM, Kent Johnson wrote: Andy, this is a nice example. It prompted me to look at the docs for compiler.visitor. The docs are, um, pretty bad. I'm going to attempt to clean them up a little. Would you mind if I include this example? Be my guest! /arg --

UK Python Conference - 20-23 April 2005 - Call for papers

2004-12-09 Thread Andy Robinson
includes myself, Dr. Tim Couper and Dr. John Lee. General discussion about the event should be directed to the python-uk list ([EMAIL PROTECTED]) ReportLab Europe Ltd. is managing parts of the event infrastructure and will be providing some staff time to provide a guaranteed point of contact.

Re: lies about OOP

2004-12-16 Thread Andy Salnikov
t to code in Python (or other high level > languages) easy of use and compact code? > > Therefore should Python code be less buggy and cheaper to develop and > maintain. Are there any papers on that? > Compact is not a synonim for less complex. It just means that you can express a

Re: DBAPI Paramstyle

2005-03-28 Thread Andy Dustman
Tim Roberts wrote: > In theory, using a paramstyle allows the query to be sent to the SQL > database backend and compiled like a program. Then, successive uses of the > same query can be done by sending just the parameters, instead of sending > the entire query string to be parsed and compiled aga

Re: Python & MySQL

2005-04-07 Thread Andy Dustman
[EMAIL PROTECTED] wrote: > Okay, > > I had the brilliant idea right after posting to google the newsgroups > on this. > > db = MySQLdb.connect(user=database_user,passwd=database_password) > > db.autocommit(True) <--- One little line! You would be better off executing db.commit() periodically (at

Tutorial at Python-UK, Oxford, 19 May - handful of places left

2005-04-08 Thread Andy Robinson
to attend should directly contact the organisers, Archer Yates Associates, whose details are on the bottom left corner of the page. Best Regards Andy Robinson UK Python Conference program chair -- http://mail.python.org/mailman/listinfo/python-list

Re: database in python ?

2005-04-11 Thread Andy Dustman
Pierre-Frédéric Caillaud wrote: > > MySQL is an excellent option is very well documented. It is also a > > defacto standard for OpenSource databases. > > MySQL sucks for anything but very very basic stuff as it supports no > transactions, Transactions available since 3.23.17 (June 2000) >

Re: database in python ?

2005-04-12 Thread Andy Dustman
Buck Nuggets wrote: > 1. mysql doesn't support transactions - one of its io layers (innodb) > does. If you're hoping to get your application hosted you will find > that most mysql installations don't support innodb. And due to the > bugs in mysql, when you attempt to create a transaction-safe t

Re: database in python ?

2005-04-14 Thread Andy Dustman
Steve Holden wrote: > I don't know about the whole picture, but I know form evidence on this > group that there are PostgreSQL driver modules (the name "psycopg" comes > to mind, but this may be false memory) that appear to take diabolical > liberties with DBAPI-2.0, whereas my experience with My

Re: database in python ?

2005-04-14 Thread Andy Dustman
Mage wrote: > Andy Dustman wrote: > > > > >Transactions available since 3.23.17 (June 2000) > > > > > Transactions only supported on slow database types like innodb. > > If you ever tried it you cannot say that mysql supports transactions. No. > Last time

Re: Determine ip address

2005-04-15 Thread Andy Jeffries
external_ip = os.popen("/sbin/ifconfig eth0|/bin/grep inet|/bin/awk '{print $2}' | sed -e s/.*://", "r").read().strip() Cheers, Andy -- http://mail.python.org/mailman/listinfo/python-list

How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
How remove directories with the content in the platform independent way? Is the API for that? Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
James Stroud wrote: Look at the os and os.path modules. http://docs.python.org/lib/module-os.html http://docs.python.org/lib/module-os.path.html On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski: How remove directories with the content in the platform independent way? Is the API for

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
Andy Leszczynski wrote: James Stroud wrote: Look at the os and os.path modules. http://docs.python.org/lib/module-os.html http://docs.python.org/lib/module-os.path.html On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski: How remove directories with the content in the platform

Re: How remove directories with the content in the platform independent way?

2005-04-28 Thread Andy Leszczynski
Jason Mobarak wrote: There's also the shutil module, which is platform independant. http://docs.python.org/lib/module-shutil.html ...see the rmtree function Thanks, this is what I was looking for. A. -- http://mail.python.org/mailman/listinfo/python-list

Getting a list of classes in the current module/auto introspection

2005-04-28 Thread Andy Leszczynski
ke to be able to get references (or names) of all of them but excluding stuff from moduleA and module B. Is there any pythonic/elegant way to do that? Thanks, Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: "mysql.h: No such file or directory" when building MySQL-python

2005-04-28 Thread Andy Dustman
[EMAIL PROTECTED] wrote: > I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ... > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386 > -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c > _mysql.c -o build/temp.linux-i686-2.3/_mysql.o -I'/usr/include/mysql'

Re: datetime question

2013-11-12 Thread Andy Lawton
Firstly , I should clarify I have no idea how to program python, I joined this mailing list in anticipation of learning soon. And thought I'd have a go playing around with your code and code given to you (worst possible place to start, I'm sure) But from the answers already given to you, this seem

Python Packaging and being a good testing citizen

2015-12-18 Thread Andy Loughran
One thing has been bugging me, and that is that pyserial works differently on python2 to python3 due to accepting/rejecting strings in place of the new bytes datatype. I'm not sure how best to test this, so I'm looking for advice: https://www.andyloughran.co.uk/2015/12/16/python-test

optparse question (python 2.6)

2013-08-26 Thread Andy Kannberg
ments ) . There are about 7 options that can be selected. However, I can't seem to figure out how to force that only one option is allowed when the script is invoked. In other words: How to restrict the script to accept only one of the available options ? cheers, Andy -- http://mail.python.o

Re: New VPS Provider needed

2013-08-27 Thread Andy Kannberg
Niko, No offense, but I have to agree with David. This list is about Python, not about webprogramming nor hosting. If you are in need of a mailing group for such, again, Google or any other search engine can help you with that. best regards, Andy 2013/8/27 Νικόλαος > Στις 27/8/2013 2:18

Re: optparse question (python 2.6)

2013-09-02 Thread Andy Kannberg
x27; , nargs=2) File "/usr/lib64/python2.6/optparse.py", line 1012, in add_option option = self.option_class(*args, **kwargs) File "/usr/lib64/python2.6/optparse.py", line 577, in __init__ checker(self) File "/usr/lib64/python2.6/optparse.py", line 706, in _c

Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4)

2015-08-26 Thread Andy Kubiak
> > I wish I could, problem is, if the mail recipient is within the company, > no legal boilerplate is added making the joke fall flat. > What if you could send all your mail to another address on a server you control, or can at least run programs on? Could you configure all your outgoing mail to

How to exit from embedded IPython shell?

2014-09-09 Thread Andy Zhang
Hi, I am embedding IPython inside a c application, by running PYTHONSTARTUP file which is: import IPython IPython.embed() Then the application interact with user input via stdin. After the user is done, she would type EOF. The program should exit, but keep all the python objects in memory, and

Dynamically creating properties?

2011-10-27 Thread Andy Dingley
I have some XML, with a variable and somewhat unknown structure. I'd like to encapsulate this in a Python class and expose the text of the elements within as properties. How can I dynamically generate properties (or methods) and add them to my class? I can easily produce a dictionary of the requi

attaching to running python program with the debugger?

2005-12-13 Thread Andy Leszczynski
Hi, I have a program which somewhere gets into infinite look and take 100% of CPU. How can attach to it with the debugger to find out where it takes place? A. -- http://mail.python.org/mailman/listinfo/python-list

?: in Python

2005-12-14 Thread Andy Leszczynski
How can do elegantly in Python: if condition: a=1 else: a=2 like in C: a=condition?1:2 -- http://mail.python.org/mailman/listinfo/python-list

Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Lawrence Oluyede wrote: > Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: > >>How can do elegantly in Python: >> >>if condition: >>a=1 >>else: >>a=2 >> >>like in C: >> >>a=condition?1:2 >> >

Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Steven D'Aprano wrote: > On Wed, 14 Dec 2005 14:09:10 -0500, Andy Leszczynski wrote: > > >>How can do elegantly in Python: >> >>if condition: >>a=1 >>else: >>a=2 >> >>like in C: >> >>a=condition?1:2 > > &g

Re: ?: in Python

2005-12-17 Thread Andy Leszczynski
Steven D'Aprano wrote: > On Wed, 14 Dec 2005 20:17:28 -0500, Andy Leszczynski wrote: > > >>I can tell you what is not elegant in the if else: approach. It is >>logically a one operation while you are forced to use varaible "a" >>twice. Fundamental f

Changing a shell's current directory with python

2005-12-18 Thread Andy B.
I've got a python utility that I want to change my shell's current directory based on criteria it finds. I've scoured google and the python cookbook and can't seem to figure out if this is even possible. So far, all my attempts have changed the current python session only. Am I going to have to

Re: Changing a shell's current directory with python

2005-12-18 Thread Andy B.
Many thanks for the sanity check. Just wanted to check with the gurus before heading down another path. -A On 12/18/05, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 18 Dec 2005 15:53:11 -0800, "Andy B." <[EMAIL PROTECTED]> > declaimed the following in comp

adding vectors

2005-12-19 Thread Andy Leszczynski
Hi, Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)? How to elegantly achieve (3,"abcdef",10.5) as a result of addition ... Andy -- http://mail.python.org/mailman/listinfo/python-list

HP open source printer drivers are in Python

2006-01-12 Thread Andy Leszczynski
I have a specific question, anybody is familiar? A. -- http://mail.python.org/mailman/listinfo/python-list

Re: HP open source printer drivers are in Python

2006-01-17 Thread Andy Leszczynski
Andy Leszczynski wrote: > I have a specific question, anybody is familiar? Just wanted to report, that problem is solved :-). But seriously, sorry for enigmatic question. I have had a very weird problem with HPLIP 0.97. Wanted to check out if there is someone familiar with the design of HP

Re: range() is not the best way to check range?

2006-07-18 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > it seems that range() can be really slow: > if i in range (0, 1): RTFM on range() You're completely mis-using it here, using it with an if ... in ... test. The purpose of range() in Python is as loop control, not comparisons! It's not a SQL BETWEEN statement

Re: write()

2006-07-30 Thread Andy Salnikov
rely on magic file names like '/tmp/workfile'. So instead of open() you should do: import os f = os.tmpfile() This should work fine of both Windows and UNIX systems. Andy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-07-31 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > Is Windows > an okay enviornment in which to program under Python, or do you > recommend that I run a dual-boot of Linux or maybe a VMWare install to > program under Python? Python is one of the best languages I've found for platform-independence - significantly better

Re: Windows vs. Linux

2006-08-01 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > Python and Ubuntu rock...go fot it. That's nice. I've just burned myself a new Ubuntu f*ck-a-duck release CD intending to rebuild a flakey old Deadrat box with it. Once it's done I'd like to be running Python with some USB to Dallas one-wire hardware on it, re-plugged

Newbie - How to iterate list or scalar ?

2006-08-08 Thread Andy Dingley
I seem to be writing the following fragment an awful lot, and I'm sure it's not the best and Pythonic way to do things. Any advice on better coding style? pluginVersionNeeded is a parameter passed into a method and it can either be a simple scalar variable, or it can be a list of the same variable

Re: do people really complain about significant whitespace?

2006-08-08 Thread Andy Dingley
Thomas Guettler wrote: > I like python, but sometimes i don't like that python allows > spaces and tabs. It would be easier if you had less choice and > must use four spaces. That's the nice thing about Python. It doesn't care about indentation distance, it just wants "some" and "consistent". I

Re: Newbie - How to iterate list or scalar ?

2006-08-08 Thread Andy Dingley
Bruno Desthuilliers wrote: > there's really no reason to > assume it should be a list - any iterable could - and IMHO should - be > accepted... expect of course for strings (royal PITA case, duh). > 2/ test for pluginVersionsNeeded.__iter__ (an attribute of most > iterables except strings...):

Re: loop until keypress (Windows XP)

2006-08-09 Thread Andy Terrel
If you did want a linux version you could just make people send a KeyboardInterupt. try: print "Press ^C to stop" loop except KeyboardInterrupt: some stop action or just pass -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you get the name of a dictionary?

2006-08-18 Thread Andy Terrel
jojoba wrote: > Hello! > > Does anyone know how to find the name of a python data type. > > Conside a dictionary: > > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? > > thanks to anyone who has time to answer this nube questi

Re: how do you get the name of a dictionary?

2006-08-18 Thread Andy Terrel
can think of plenty of reasons it would fail, but it really depends on the app. Fredrik Lundh wrote: > Andy Terrel wrote: > > > for i in dir(): > > if eval(i) == Banana: > > print i > > (sound of head hitting desk) > > -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you get the name of a dictionary?

2006-08-18 Thread Andy Terrel
Georg Brandl wrote: > Andy Terrel wrote: > > Why bang your head? > > Because there's no chance that the original request is sane. > > If you want your objects to know their name, give them a name as an attribute. > This is true but sometimes it is just

Re: find, replace and save string in ascii file

2006-08-23 Thread Andy Terrel
Take your code, pretend it is in file: $ NAME='ALFA' CODE='x' $ a python functions could be: def change(filename): fp = open(filename, 'r') lines = fp.readlines() fp.close() for i in range(len(lines)): if lines[i].find('NA

Re: Python bindings for picasaweb ...

2006-08-23 Thread Andy Terrel
sweet. I'll definitely be trying to use this. [EMAIL PROTECTED] wrote: > Just a post to announce some python bindings for picasaweb (photo's > service of google). > ---> PycasaWeb (GPL), http://manatlan.infogami.com/pycasaweb > I think it may be usefull for linux users, because it's one of the o

Re: Where is Python in the scheme of things?

2006-10-05 Thread Andy Dingley
gord wrote: > As a complete novice in the study of Python, I am asking myself where this > language is superior or better suited than others. I use it, and see it primarily, as a Perl killer. It also does for Ruby and our infernal shell scripts. I've never considered using Python instead of VB.

Re: Names changed to protect the guilty

2006-10-09 Thread Andy Salnikov
s just > another way of shooting yourself in the foot. OK, I guess nobody ever heard about three-valued logic before, right? Of course it does not apply to the original post because has_key() can only return True or False (I hope it will not ever return DontKnow:) but in general if y

Re: Book about database application development?

2006-10-16 Thread Andy Dingley
Paul Rubin wrote: > http://philip.greenspun.com/sql/ There was a time (some time in the mid 90s) when I thought that Philip Greenspun had a Clue. Then I realised just how wrong he was (he started off reasonably right, he just didn't keep up when the world moved on). The highlight of this process w

Re: HTML Parsing and Indexing

2006-11-13 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > I am involved in one project which tends to collect news > information published on selected, known web sites inthe format of > HTML, RSS, etc I just can't imagine why anyone would still want to do this. With RSS, it's an easy (if not trivial) problem. With HTML

Re: Python v PHP: fair comparison?

2006-11-15 Thread Andy Dingley
walterbyrd wrote: > I don't know if this is a fair comparison or not. Who cares? Anything involving PHP is a "billion flies can't be wrong" type of statement. I agree completely with your observation about PHP's lower cost of access. This is ostensibly a good thing, but it also means that ever

Re: python vs java

2006-09-06 Thread Andy Dingley
Aravind wrote: > some of my friends told that python and java are similar in the idea of > platform independency. Similar in goal, but quite different in approach. Python supports lots of platforms and goes to great lengths to offer facades around whatever features a platform does have, so as

Re: split string problems

2006-09-07 Thread Andy Terrel
try str(p).split()[2] your class is using the __str__ attribute to print and I am guessing that is what you are seeing. Tempo wrote: > Hey. I am trying to grab the prices from the string below but I get a > few errors when I try to do it: Take a look at the code and error > messages below for me

Re: Looking for a regexp generator based on a set of known string representative of a string set

2006-09-08 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > I am looking for python code that takes as input a list of strings > [...] and outputs the python regular expression (s1|s2|s3|s4|s5) for strings of "s1" etc. Regex compilers are themselves quite good at optimising beyond this -- http://mail.python.org/mailman/l

Re: does anybody earn a living programming in python?

2006-09-26 Thread Andy Dingley
walterbyrd wrote: > If so, I doubt there are many. I currently earn my living "programming in Python". This is particularly amusing given that it's a Java shop and I don't even know Python! I've only been using it for a few months as a replacement for the previous shell scripts and instead of

generator with subfunction calling yield

2006-09-27 Thread andy . leszczynski
for i in nnn(): print i for i in nn(): print i gives results: $ python f.py inside 1 before after Traceback (most recent call last): File "f.py", line 18, in ? for i in nn(): TypeError: iteration over non-sequence while I would expect: $ python f.py inside 1 b

Dynamic function execution

2006-11-25 Thread Andy Wu
;t know how to call the function. Say I have a string 'minutes' and a integer 30, now I need to call the func this way: func(minutes = 30), how do I do this? I'm sure this is a simple question, but I can't google it out since I don't know how to describe it in a short ter

Re: rdf, xmp

2006-12-02 Thread Andy Dingley
Imbaud Pierre wrote: > I have to add access to some XMP data to an existing python > application. > XMP is built on RDF, RDF is built on XML. RDF is _NOT_ built on top of XML. Thinking that it is causes a lot of trouble in the architecture of big RDF projects. RDF is a data model, not a serialis

<    1   2   3   4   >