Re: Multiple equates

2008-12-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > >> In article <[EMAIL PROTECTED]>, >> Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >> >&g

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >>def f1(Match): >>return > >Something missing here? Ugh; yes, sorry: def shell_escape(Arg) : """returns

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > >>def shell_escape(Arg) : >>"""returns Arg suitably escaped for use as a command-line

Re: Guido's new method definition idea

2008-12-06 Thread Cameron Simpson
et the $ get in there. And it doesn't add any facility to the language - it's just syntactic lint. So -1 from me. -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows SSH (remote execution of commands) - Python Automation

2008-12-29 Thread Cameron Laird
In article , Tino Wildenhain wrote: . . . >> I am looking for some information on how to automate remote login to a >> UNIX machine using ssh from a windows XP box. >> >> Possible way: >> >> 1. Use putty (or any other ss

Re: flushing of print statements ending with comma

2008-12-29 Thread Cameron Simpson
process the output data... Sending your progress reports to stdout puts junk in the data stream. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Gentle suggestions being those which are written on rocks of less than 5lbs. - Tracy Nelson in comp.lang.c -- http://mai

Re: Regular Expressions...

2009-01-07 Thread Cameron Simpson
s s/this/that/) there is the regular expression object sub() method. It's a bit more broken out than you normally get in perl, but the pieces are all there. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Teamwork is essential. It lets you blame someone else. -- http://mail.python.org/mailman/listinfo/python-list

Re: Developing for Python (2.x or 3)?

2008-10-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Sean DiZazzo <[EMAIL PROTECTED]> wrote: >I would use 2.5.2 or 2.6. I don't think 3 is anywhere near stable >yet. > >Paulo J. Matos wrote: >> Hi all, >> >> I am in the process of choosing which Python version for a brand new >> application. Van Rossum in an intervie

Re: Commercial Products in Python

2008-10-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >Hi all, > >I was just wondering, if you wish to commercialize an application >developed in Python, what's the way to go? >I guess the only way is to sell the source, right? > >This is because (and tell me if I am wrong): >1)

Re: Why gives "k = 09" a syntax error ?

2008-10-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mensanator <[EMAIL PROTECTED]> wrote: >On Oct 29, 2:44 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: >> Guilherme Polo wrote: >> > On 10/29/08, Stef Mientki <[EMAIL PROTECTED]> wrote: >> >> >> hello, >> >> >>  Why gives "k = 09"  a syntax error ? >> >> > 09 is not a v

Re: Anyone in the Houston / College Station / Austin area? Looking to do some sprints / joint projects.

2008-11-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, xkenneth <[EMAIL PROTECTED]> wrote: >All, > > I'm in Houston/College Station/Austin quite often and I'm looking >for other coders to do some joint projects with, share experiences, or >do some sprints. Let me know if you're interested. .

SQL is many things, but "mini" had never occurred to me as one of them (was: push-style templating - an xml-like way to process xhtml)

2008-11-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tino Wildenhain <[EMAIL PROTECTED]> wrote: . . . >Mini languages is the correct term. And yes they have their >purpose. (Think of SQL for example). .

Re: Parse each line by character location

2008-11-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tim Chase <[EMAIL PROTECTED]> wrote: >> I hope this is the right place to ask, but I am trying to come up with >> a way to parse each line of a file. Unfortunately, the file is neither >> comma, nor tab, nor space delimited. Rather, the character locations >> imply

Re: Python 3.0 - is this true?

2008-11-08 Thread Cameron Simpson
would be less flexible. | Wouldn't that even go further to let you know when things happen, that | you don't mean to happen? If I meant to put different types in a list, then this would be a serious problem. -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Single-instance daemons

2008-11-12 Thread Cameron Simpson
o move to truncating the file instead of removing it on daemon shutdown, but that is trivial. And no mucking with privileges, like starting the daemon as root instead of directly as the daemon user, need be done. Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezos

Re: Single-instance daemons

2008-11-13 Thread Cameron Simpson
On 12Nov2008 22:30, Jeffrey Barish <[EMAIL PROTECTED]> wrote: | Cameron Simpson wrote: | > Or, more simply, get root to make an empty pid file once and chown it to | > the daemon user. Then the daemon can rewrite the file as needed. You need | > to move to truncating the file inst

Re: Two instances share an attribute

2008-11-15 Thread Cameron Simpson
values = None): if values is None: values = [] self.values_ = values which makes a new [] during the instance creation. Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ If you don't live on

Re: Multiple equates

2008-11-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tim Chase <[EMAIL PROTECTED]> wrote: . . . >To the OP, I think rather than cluttering my code, I'd just >create a loop > > for i in [x1,x2,x3,x4,...x1024]: > a[i] = False

Re: ZSI / MTOM

2009-02-23 Thread Cameron Simpson
hough it isn't going to be | exactly simple. Is there anyone working on a patch (or interested in | collaborating if it comes down to writing one)? Maybe you should ask on the pywebsvcs mailing list, where ZSI discussion takes place? http://pywebsvcs.sourceforge.net/ Cheers, -- Cameron Si

Re: nohup and os.system

2009-03-11 Thread Cameron Simpson
y it.) The other thing to be aware of when doing this is that script logs the output post the terminal character driver; this will normally translate newlines in the program output into carriage-return and then newline because that is what a terminal requires to move the cursor as needed. Ch

Re: nohup and os.system

2009-03-11 Thread Cameron Simpson
ring quotes). Anyway, see "man script" on your system for the correct invocation. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ A man with one watch knows what time it is; a man with two watches is never sure. - Lee Segall -- http://mail.python.org/mailman/listinfo/python-list

Re: Help in reading the pdf file

2009-03-28 Thread Cameron Laird
In article , Gabriel Genellina wrote: >En Thu, 26 Mar 2009 18:31:31 -0300, M Kumar >escribió: > >> I need to read pdf files and extract data from it, is there any way to >> do it >> through python. > >If you are interested in the text, I'd use ghostscript pdf2text (you may >invoke it from insid

Re: PID lockfile

2009-03-28 Thread Cameron Simpson
uot;my home dir is NFS shared across our LAN" and you're instantly into routine lockfile-on-NFS land. I speak as one who was in that circumstance in my former life. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ NFS: Not a File System -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2, proxies, and pac files on OS X

2009-03-31 Thread Cameron Simpson
that particular fetch. Clearly you can't get a static proxy description in the general case. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Look, Dave... I can see you're really upset about this... I honestly think you ought to sit down calmly, ... take a stress pill, a

Re: Accessing mail box tree of Thunderbird/Seamonkey?

2009-04-05 Thread Cameron Simpson
hich is a cache of Thunderbird's knowledge of the mbox contents (header values and probably message offsets within the file). -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ ..And in all of Babylonia there was wailing and gnashing of teeth, till the prophets bade the multitudes g

Re: statvfs clearance

2009-04-05 Thread Cameron Simpson
these | values ? The first three I know, I need to know about the rest Since os.statvfs is a wrapper for the OS statvfs system call, I would consult "man statvfs" on your platform. That will tell you about the OS facility underlying the python library function. -- Cameron Simpso

Re: named pipe and Linux

2009-04-07 Thread Cameron Simpson
ould return with what is there. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Language... has created the word "loneliness" to express the pain of being alone. And it has created the word "solitude" to express the glory of being alone. - Paul Johannes

Re: Adding a Badge to an Icon in Mac OS X

2009-04-11 Thread Cameron Simpson
k finding answers on a OS X-related list. Like this one? http://mail.python.org/mailman/listinfo/pythonmac-sig Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ -- http://mail.python.org/mailman/listinfo/python-list

Re: named pipe and Linux

2009-04-12 Thread Cameron Simpson
On 08Apr2009 16:13, Thomas Bellman wrote: | Cameron Simpson wrote: | > On 07Apr2009 10:08, akineko wrote: | >| I'm trying to use named pipes to fuse a Python program and a C | >| program. | >| One side creates pipes using os.mkfifo() and both sides use the same | >| named p

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
like using Python2 for that. Finally, I have a small python program whose whole purpose in life is to transcode UNIX filenames before transfer to a MacOSX HFS directory, because of HFS's enforced particular encoding. What approach should a Python app take to transcode UNIX pathnames under your s

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
e-byte stuff to be off in the "posix" module if os.* goes pure character instead of bytes or bytes+strings. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ ... that, in a few years, all great physical constants will have been approximately estimated, and that the only occu

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread Cameron Simpson
On 25Apr2009 14:07, "Martin v. Löwis" wrote: | Cameron Simpson wrote: | > On 22Apr2009 08:50, Martin v. Löwis wrote: | > | File names, environment variables, and command line arguments are | > | defined as being character data in POSIX; | > | > Specific citation plea

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-29 Thread Cameron Simpson
ning from rare illegal strings to merely uncommon but legal characters. - Some parties think it would be better to not return strings from os.listdir but a subclass of string (or at least a duck-type of string) that knows where it came from and is also handily recognisable as

Re: Multiprocessing.Queue - I want to end.

2009-04-30 Thread Cameron Simpson
item in iterq: ... The producer calls iterq.close() when it's done. I'll clean up the formatting and add a bunch of missing docstrings if anyone wants it... Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Indeed! But do not reject these teachings as false

Re: Multiprocessing.Queue - I want to end.

2009-04-30 Thread Cameron Simpson
that, as the name suggests, you can use the class as | an iterator: | for item in iterq: | ... | The producer calls iterq.close() when it's done. Someone asked, so code appended below. Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ class IterableQueue(Queue): '

Re: exit a program gracefully

2009-05-05 Thread Cameron Simpson
... do stuff ... if check1_failed: break; ... do more stuff ... if check2_failed: break; ... do even more stuff ... break ... cleanup goes here ... Seems more straightforward to me! And there's always try/except and context managers. Cheers, -- Cameron Sim

Newcomer to Python tutorial question

2009-05-07 Thread Alan Cameron
7;banana'} >>> print(basket) {'orange', 'banana', 'pear', 'apple'} in the sequence given? -- Alan Cameron -- http://mail.python.org/mailman/listinfo/python-list

Re: Newcomer to Python tutorial question

2009-05-07 Thread Alan Cameron
"Alan Cameron" wrote in message news:hrfml.50224$tb.4...@newsfe07.ams2... >I am not sure of this is the right place to ask a question about the >tutorial > > http://docs.python.org/3.0/tutorial/datastructures.html#sets > > why is the printed result of > >>&

Re: Newcomer to Python tutorial question

2009-05-07 Thread Alan Cameron
"Chris Rebert" wrote in message news:mailman.5238.1241723354.11746.python-l...@python.org... > On Thu, May 7, 2009 at 11:58 AM, Alan Cameron > wrote: >> "Alan Cameron" wrote in message >> news:hrfml.50224$tb.4...@newsfe07.ams2... >>>I am not su

Re: Newcomer to Python tutorial question

2009-05-08 Thread Alan Cameron
"Terry Reedy" wrote in message news:mailman.5248.1241732704.11746.python-l...@python.org... > Alan Cameron wrote: >> >>>>> why is the printed result of >>>>> >>>>>>>> basket = {'apple', 'orange',

Re: How to catch str exception?

2009-05-15 Thread Cameron Simpson
owing non-ValueError exceptions then many many programs break. Java would prevent one from changing int() in such a fashion outright. Python requires the self-discipline on the part of the implementer of int() to raise only ValueError exceptions, and internally handle anything else at a lower level. Che

NameError function not found

2009-05-29 Thread Cameron Pulsford
Hey everyone, I am extremely stumped on this. I have 2 functions.. def _determinant(m): return m[0][0] * m[1][1] - m[1][0] * m[0][1] def cofactor(self): """Returns the cofactor of a matrix.""" newmatrix = [] for i, minor in enumerate(self.minors()): newmatrix.append(_determinan

Have a variable column length in printf

2009-05-30 Thread Cameron Pulsford
Hello all, I'm trying to pretty print a list, so I am doing something like print '%3d' % integer only I would like that 3 to be a variable, instead of hardcoded. Is this possible, or are there any other ways to accomplish this? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Have a variable column length in printf

2009-05-31 Thread Cameron Pulsford
Thanks all, I think I'l stick with the '*' method because this is just a one time thing for a __repr__ function and it seems easiest. On Sun, May 31, 2009 at 6:32 AM, Terry Reedy wrote: > Gary Herron wrote: > >> Cameron Pulsford wrote: >> >>> Hello al

Python needn't apologize (was: Using Python for programming algorithms)

2008-06-01 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, sturlamolden <[EMAIL PROTECTED]> wrote: >On May 18, 5:46 am, "inhahe" <[EMAIL PROTECTED]> wrote: > >> The numbers I heard are that Python is 10-100 times slower than C. > >Only true if you use Python as if it was a dialect of Visual Basic. If >you use the right tool

Re: struct.pack behavior

2008-06-25 Thread Cameron Simpson
. Conversely, packing "BH" puts a byte at offset zero but puts the short at offset 2 (to be even), leaving a gap after the byte to achieve this, thus the 4 byte size of the result (byte, gap, short). This layout procedure is called "alignment". Cheers, -- Cameron Simpson <[E

Re: Testing for an empty list

2008-07-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: >Alexnb wrote: >> Okay this is a simple question I just don't know how. If I have a list, say: >> >> funList = [] >> >> and after a while something possible should have been appended to it, but >> wasn't. How can I te

Re: Determining when a file has finished copying

2008-07-09 Thread Cameron Simpson
files appear in sequence (a single serial upload process, not multiple uploaders) you can augument this with a check that an additional file has started to upload, ergo the current file has finished. Of course, only you can decide if this might be relied upon. Cheers, -- Cameron Simpson <[EMAIL PROTEC

Re: Determining when a file has finished copying

2008-07-10 Thread Cameron Simpson
On 10Jul2008 13:20, Manuel Vazquez Acosta <[EMAIL PROTECTED]> wrote: | Cameron Simpson wrote: | > On 09Jul2008 15:54, Ethan Furman <[EMAIL PROTECTED]> wrote: | >> The solution my team has used is to monitor the file size. If the file | >> has stopped growing for

Re: Gracefull application exit.

2008-07-24 Thread Cameron Simpson
cations. | The implementation looks nice and is certainly the way I would like to go, | but unless it'll work when killed by sigterm it likely won't be for me. If you catch SIGTERM with the signal module and call sys.exit() they should fire. This all gets harder with threads. -- Cameron S

Re: How to find processes from Python

2008-07-25 Thread Cameron Simpson
On 25Jul2008 11:34, Johny <[EMAIL PROTECTED]> wrote: | Is there a way how to find out running processes?E.g. how many | Appache's processes are running? See the popen function and use the "ps" system command. -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://

Re: Not entirely serious: recursive lambda?

2008-07-27 Thread Cameron Simpson
ard to find; not that I have or want a gun license, but it was the example discussed). Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ Humans are incapable of securely storing high quality cryptographic keys and they have unacceptable speed and a

Re: Is there a such Python module ?

2008-07-30 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: >Johny wrote: >> Is there a Python module that can help with reading SMS message from a >> mobile phone? >> Or is there an example how to read SMS message using a program written >> in Python,C, or any other language? >

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Cameron Simpson
#x27;re changing something that works. Whether an "upgrade" changes a bug or a feature is irrelevant - it changes behaviour. Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ Zombies don't get pumped. - Jake, in rec.climbing -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematical Python Library

2008-04-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Mon, 7 Apr 2008 09:05:57 -0700 (PDT), mc <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > >> I'm looking for a library which can do mathematical stuff like >> solving equations. Or calculation the

Who makes up these rules, anyway? (was: Python-URL! - weekly Python news and links (Apr 28))

2008-04-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Gabriel Genellina <[EMAIL PROTECTED]> wrote: . . . >Explicit variable declaration for functions: > >http://groups.google.com/group/comp.lang.python/browse_thread/thread/6c4a508edd2fbe0

Books for a new generation of Pythoneers (was: Newbie to python --- why should i learn !)

2008-05-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, maxinbjohn <[EMAIL PROTECTED]> wrote: >Hi Raxit, > >One of the the tempting features of Python is that it is fun to code >in Python. If you are really trying to learn python, you should read >Adventures with Neko (http://gnuvision.com/books/pybook/) . It is an >intr

Re: Python does not get environment variable when using cron.

2008-08-17 Thread Cameron Simpson
bin/sh -c '/usr/bin/python someprogram.py' /usr/bin/python someprogram.py i.e. three process alive. > Or, in Python, you can use "socket.gethostname()", which will > get you the host name used for networking purposes. Or, on a cron line (after the time fields, omitted here): HOSTNAME=`hostname`; export HOSTNAME; python someprogram.py Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ 186,282 miles per second - Not just a good idea, It's the Law! -- http://mail.python.org/mailman/listinfo/python-list

Re: print "%s"

2008-08-17 Thread Cameron Simpson
to iterate over the strings. Print a tab before each string except the first. Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ You see, wire telegraph is a kind of a very, very long cat. You pull his tail in New York and his head is meowing in Los Ang

Re: AOP in Python

2008-08-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Kay Schluehr <[EMAIL PROTECTED]> wrote: >On 18 Aug., 15:21, Hussein B <[EMAIL PROTECTED]> wrote: >> Hey, >> AOP is build in Groovy language via many means, does Python support >> AOP out of the box without the need for such >tools:http://pythonsource.com/open-source

Re: Prevalent Python/Django academic software

2008-08-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Daniel Bickett <[EMAIL PROTECTED]> wrote: >Is anyone working on any software at present, using django or python >in general, which serves various academic/course functions, or else >that of student-instructor arbitration? A popular example which my >university uses

Re: Using Tkinter

2008-08-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >On Aug 22, 7:20 am, J-Burns <[EMAIL PROTECTED]> wrote: . . . >> If I have a drop down box in Pythons tkinter, is it possible that the >> entities that the drop down h

Re: rules of thumb for cross os code

2008-08-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, DwBear75 <[EMAIL PROTECTED]> wrote: >I am considering using python as a replacement for a lot of bash >scripting that I have been doing. I would like to be as cross platform . . . >2) nifty lamb

Re: Turning py into an Executable Program for Win?

2008-08-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >On 24 Aug, 01:28, "W. eWatson" <[EMAIL PROTECTED]> wrote: >> How do I get my py code into some executable form so that Win users who >> don't have python can execute it? > >Py2exe: http://www.py2exe.org/ More generally, http://wiki.pytho

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >Martin Marcher wrote: > >> On 2008-08-26 00:32:20, cnb wrote: >>> Are dictionaries the same as hashtables? . . . >Python does not have a "one key maps

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> In article <[EMAIL PROTECTED]>, >> Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >>>Martin Marcher wrote: >>> >>>> On 2008-

Re: Tkinter event loop question

2008-08-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >gordon wrote: > >> is it possible to send a message to the gui instance while the Tk >> event loop is running?I mean after i create a gui object like . .

Re: Wild Card String Comparison

2008-08-28 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, W. eWatson <[EMAIL PROTECTED]> wrote: >Is it possible to do a search for a wild card string in another string. For >example, I'd like to find "v*.dat" in a string called bingo. v must be >matched against only the first character in bingo, and not simply found >som

Re: Python in a Nutshell -- Book vs Web

2008-08-28 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Matimus <[EMAIL PROTECTED]> wrote: >On Aug 28, 3:05 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: >> I read an Amazon of Python in a Nutshell. The first edition is supposedly >> much like the web site. What web site? The second edition apparently adds >> more to the b

Re: Python in a Nutshell -- Book vs Web

2008-08-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> No. No, to an almost libelous extent. > >No matter what you write about, there's always a certain subcategory of >potential readers who insist that collect

Re: Ensure only single application instance.

2008-08-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Uberman <[EMAIL PROTECTED]> wrote: >On Fri, Aug 29, 2008 at 6:51 AM, Heston James <[EMAIL PROTECTED]> wrote: >> Good afternoon all. >> >> I have an application/script which is launched by crontab on a regular >> basis. I need an effective and accurate way to ensure

Re: Command lime code

2008-08-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Timothy Grant <[EMAIL PROTECTED]> wrote: >On Fri, Aug 29, 2008 at 3:38 PM, <[EMAIL PROTECTED]> wrote: >>>Seriously, did you think we've hacked your computer and are spying on >>>your web browsing? How would we know what web page you have visited? >> >> I was hoping

Re: Multipart - Counting the amount of Values for One key

2008-08-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >En Fri, 29 Aug 2008 14:41:53 -0300, Ron Brennan <[EMAIL PROTECTED]> >escribi�: > >> I am trying to find the amount of values there are pertaining to one key. >> >> For example: >> >> - To find the average of the value

Re: When to use try and except?

2008-08-30 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Carl Banks <[EMAIL PROTECTED]> wrote: . . . >> Basically, there's a general principle (EAFP: Easier to ask >> forgiveness than permission) in Python to just "try" something and >> then catch the

Re: (in memory) database

2008-08-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >mark wrote: . . . >> Unfortunately I have only some knowledge of SQLite which is not an >> option here. > >why is sqlite not an option? it's is bundled

Re: python subprocess know how

2008-08-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, King <[EMAIL PROTECTED]> wrote: >Hi, > >I am using subprocess module to execute a command and print results >back. > >startupinfo = subprocess.STARTUPINFO() >startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW >my_process = subprocess.Popen(cmnd, startupinfo=star

Re: (in memory) database

2008-08-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: >On 31 Aug, 16:45, [EMAIL PROTECTED] (Cameron Laird) wrote: >> Yes and no. My own experience with Debian packages is that with a >> standard >> apt-get install python2.5 >> an attem

Re: (in memory) database

2008-08-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: >On 31 Aug, 20:05, [EMAIL PROTECTED] (Cameron Laird) wrote: >> >> Let's take a definite example: I have a convenient >> Ubuntu 8.04.1 >> The content of /etc/apt/sources.li

Re: (in memory) database

2008-08-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >On Sun, 31 Aug 2008 18:05:08 +, Cameron Laird <[EMAIL PROTECTED]> wrote: >>In article <[EMAIL PROTECTED]>, >>Paul Boddie <[EMAIL PROTECTED]> wrote: >> [snip

Re: use str as variable name

2008-09-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Mathieu Prevot a écrit : >> 2008/9/4 Chris Rebert <[EMAIL PROTECTED]>: > >(snip) > >>> You're looking for the setattr() built-in function. In this exact case: >>>setattr(a, arg, new_value) >>> >>> This is probably

Re: Converting .doc to .txt in Linux

2008-09-04 Thread Cameron Simpson
n or subprocess from Python, if you must use Python (I'd just write a shell script for such a task myself unless its embedded in a larger python context). Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ Please do not send me Microsof

Re: Why are "broken iterators" broken?

2008-09-21 Thread Cameron Simpson
n here is any better than just doubling up every call to next() with an empty() check immediately beforehand. You could write a trivial wrapping generator to take the original blocking queue and return a sentinel value on empty, too. My suggestion is also an excellent way of getting programs that fail

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Cameron Simpson
else: y = something_else should appear. If it's your code, this is up to you. If it's another's, well anyone can write unreadable code... Cheers, -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ Principles have no real force ex

Re: multiple processes, private working directories

2008-09-24 Thread Cameron Simpson
| regenerate with each call of the script. See the pipe scheme in point (2) above. Doubtless there are other methods, but pipes are each shared resources with the right behaviour. I'd prefer method (1) myself, assuming you have control of the working file paths. Cheers, -- Cameron

CP4E? (was: Help - just a few lines of code needed)

2006-03-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >There is some fine permutation code in the cookbook. Take a look at >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 . > >You can easily code something like: . .

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 6)

2006-03-07 Thread Cameron Laird
QOTW: "This PyCon has been better in so many respects than the three that preceded it. ... PyCon will continue to improve." - Steve Holden, chairman of PyCon 2003-2005 http://holdenweb.blogspot.com/ "Design patterns are kind of like sarcasm: hard to use well, not always appropriate, and di

Re: What version of python is running a script

2006-03-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > >Hi, > >How can my script tell which version of python is running it? . . . $ python Python 2.3.5 (#2, Aug 30 2005, 15:50:26) [GCC 4.0.2 20

Bear not false witness (was: Which GUI toolkit is THE best?)

2006-03-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Thomas Guettler <[EMAIL PROTECTED]> wrote: . . . >tkinter (or better TK) has no good table widget. . . . http://tkinter.un

Re: Numbers in python

2006-03-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> However, I can't seem to get the program to treat the numbers as >> numbers. If I put them in the dictionary as 'THE' = int(0.965) the >> program returns 1.0 > >It certainoly does _not_ return 1.0 - it returns 1. And tha

Re: Tkinter - Drawing rotated text in a widget

2006-03-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Eric Apperley <[EMAIL PROTECTED]> wrote: >How do I draw rotated text in a Tkinter widget using the draw.text method? > >Alternatively, if I draw text as normal, how can I then subsequently >rotate it about its start point? > > Not easily. The (base) Tk-ers have w

Re: accessing a USB HID

2006-03-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Serge Orlov <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: . . . >> The obstacle our group currently faces is communicating with a >> microcontroller (ACS USB Servo II) that appears in Wind

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 17)

2006-03-17 Thread Cameron Laird
QOTW: "Generally, you should always go for whatever is clearest/most easily read (not just in Python, but in all languages)." - Timothy Delaney "You will find as your programming experience increases that the different languages you learn are appropriate for different purposes, and have differen

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 17)

2006-03-18 Thread Cameron Laird
QOTW: "Generally, you should always go for whatever is clearest/most easily read (not just in Python, but in all languages)." - Timothy Delaney "You will find as your programming experience increases that the different languages you learn are appropriate for different purposes, and have differen

Remote teamwork anecdotes (was: Where can we find top-notch python developers?)

2006-03-20 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Unfortunately, I entirely understand _why_ most software development >firms prefer face-to-face employees: when I found myself, back when I >was a

Re: instantiate a class with a variable

2006-03-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: >"John" <[EMAIL PROTECTED]> writes: >> class foo: >> def method(self): >> pass >> >> x='foo' >> >> Can I use variable x value to create an instance of my class? > >You seem to be asking "is it possible to call an obj

Re: Seems like I want a pre-processor, but...

2006-03-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Russell Warren <[EMAIL PROTECTED]> wrote: . . . >Anyway - it worked... you've answered my question perfectly, thanks. I >hadn't considered that the module loading phase could basically used >for

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 4)

2006-04-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, gene tani <[EMAIL PROTECTED]> wrote: > >Peter Otten wrote: >> The old Python "To-Do List" now lives principally in a >> SourceForge reincarnation. >> http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse >> http://python.source

Farther OT: financial analytics (was: OT: job offering in Milan)

2006-04-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Robin Becker <[EMAIL PROTECTED]> wrote: . . . >My math skills are now so degraded I have difficulty reading about conic >programming using Nesterov's barrier functions etc etc.

Re: Feature request: String-inferred names

2009-11-26 Thread Cameron Simpson
you can achieve nearly the same conciseness by defining __setitem__ and __getitem__ so that: obj[attrname] = foo does what you want. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ For reading rec.moto, I use one of those carbon-fiber Logitech mice w/a little 'No Fea

Python-URL! - weekly Python news and links (Dec 9)

2009-12-09 Thread Cameron Laird
QOTW: "I'm not sure you ever understood what the problem was, or where, but I'm happy you feel like you've solved it." - Marco Mariani http://groups.google.com/group/comp.lang.python/browse_thread/thread/8ec7ad4fcc714538 Python 2.7a1, the first alpha release of the 2.7 series, is availa

<    17   18   19   20   21   22   23   24   25   >