Re: ImageMagick Issue

2007-05-31 Thread Michael Bentley
On May 31, 2007, at 8:08 PM, Sick Monkey wrote: I ran into another slight problem. And I attempted to fix it, but have not been able to do so yet. If a filename does not contain a space, then this method works like a charm. But if there is a space then the code throws a nasty error. i

Re: unknown host

2007-06-01 Thread Michael Bentley
On Jun 1, 2007, at 8:09 AM, abcd wrote: > I have a linux machine (ip = 10.10.10.8), which can ping other > machines on the same subnet...such as > > 10.10.10.1 > 10.10.10.2 > 10.10.10.5 > 10.10.10.6 > 10.10.10.254 > > If I use socket.gethostbyaddr() I get back results when ip is > 10.10.10.1 and

Re: Python Pop Quiz

2007-06-02 Thread Michael Bentley
On Jun 1, 2007, at 9:33 PM, [EMAIL PROTECTED] wrote: > 1. Do you like Python? It's pretty good. > 2. Do you think Python is good? It's pretty good. > 3. Do you think Python is real good? It's pretty good. > 4. What is your favorite version of Python? The one I have. > 5. Because of Python,

Re: Beginning Python

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 9:29 AM, abhiee wrote: > Hello , I have just begun learning python...and I'm loving it...Just > wanted to ask you that how much time would it take me to learn python > completely and which languages should i learn alongwith python to be a > good professional programmer?...Now i

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 3:01 PM, Rob Wolfe wrote: > Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > >> But you can't ever catch sigkill. > > There is no protection against sigkill. > >> Isn't there a way to make sure the os kills the childprocess when the >> parrent dies? > > If the parent dies sudd

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 4:17 PM, Thomas Dybdahl Ahle wrote: > Den Tue, 05 Jun 2007 15:46:39 -0500 skrev Michael Bentley: > >> But actually *that* is an orphan process. When a parent process dies >> and the child continues to run, the child becomes an orphan and is >>

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 5:13 PM, Michael Bentley wrote: > > On Jun 5, 2007, at 4:17 PM, Thomas Dybdahl Ahle wrote: > >> Den Tue, 05 Jun 2007 15:46:39 -0500 skrev Michael Bentley: >> >>> But actually *that* is an orphan process. When a parent process >>> dies

Re: subprocess leaves child living

2007-06-06 Thread Michael Bentley
On Jun 6, 2007, at 7:11 AM, Thomas Dybdahl Ahle wrote: > Den Tue, 05 Jun 2007 17:41:47 -0500 skrev Michael Bentley: > >> On Jun 5, 2007, at 5:13 PM, Michael Bentley wrote: >> >> >>> On Jun 5, 2007, at 4:17 PM, Thomas Dybdahl Ahle wrote: >>> >>>

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread Michael Bentley
On Apr 18, 2007, at 5:11 PM, Kevin Walzer wrote: > James Stroud wrote: > >> This appears more or less unique to Objective C. It looks that with >> PyObjC, you have to interact with the Objective C runtime to manage >> memory. This is not required, thankfully, with any other GUI tookits >> I've se

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread Michael Bentley
On Apr 19, 2007, at 4:11 AM, Antoon Pardon wrote: > On 2007-04-19, Michael Bentley <[EMAIL PROTECTED]> wrote: >> >> On Apr 18, 2007, at 5:11 PM, Kevin Walzer wrote: >> >>> James Stroud wrote: >>> >>>> This appears more or less unique to

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread Michael Bentley
*plonk* -- http://mail.python.org/mailman/listinfo/python-list

Re: Styled Output

2007-04-21 Thread Michael Bentley
On Apr 21, 2007, at 3:21 AM, Robert Rawlins - Think Blue wrote: > Chaps, > > > > Hope you’re all having a good weekend, I’m sure it’ll only be the > more ‘hard core’ of you reading this, anyone with any sanity would > be out in the sunshine right now. > > > > I’m running a program of mine fro

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
On Apr 22, 2007, at 1:49 PM, proctor wrote: > i have a small function which mimics binary counting. it runs fine as > long as the input is not too long, but if i give it input longer than > 8 characters it gives > > RuntimeError: maximum recursion depth exceeded in cmp > > i'm not too sure what

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
On Apr 22, 2007, at 4:08 PM, proctor wrote: > On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: >> On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: >> >> >> >>> hello, >> >>> i have a small function which mimics binary counting. it runs >>> fine as >>> long as the input is not too long, but

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
On Apr 22, 2007, at 5:47 PM, proctor wrote: > On Apr 22, 4:37 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> On Apr 22, 2007, at 4:08 PM, proctor wrote: >> >> >> >>> On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: >>>> On Apr 22, 11:49

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
Oops! Note to self: *ALWAYS* try code before posting to a public forum :-( def binary(val, width): print '%10s = the sum of' % val for i in [2 ** x for x in range(width - 1, -1, -1)]: a = val / i print ' ' * 13 + '%s * (2 ** %s)' % (a, width)

Re: recursion depth problem

2007-04-23 Thread Michael Bentley
On Apr 23, 2007, at 1:57 AM, proctor wrote: > On Apr 22, 5:51 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> Oops! Note to self: *ALWAYS* try code before posting to a public >> forum :-( >> >> def binary(val, width): >> print '%10s = the s

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Michael Bentley
OK. In order to kill the-thread-that-would-not-die(tm), I think I know what I must do. I'll print a correction: On Apr 19, 2007, at 2:22 AM, Michael Bentley wrote: > ... I switched to PyObjC. The > learning curve is rather steep IMO, but worth it. One thing I think > I should

Re: Tutorial creates confusion about slices

2007-04-23 Thread Michael Bentley
On Apr 23, 2007, at 7:38 AM, Antoon Pardon wrote: > The following is part of the explanation on slices in the > tutorial: > > The best way to remember how slices work is to think of the indices as > pointing between characters, with the left edge of the first character > numbered 0. Then the righ

Re: Tutorial creates confusion about slices

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 1:39 AM, Antoon Pardon wrote: > On 2007-04-23, Michael Bentley <[EMAIL PROTECTED]> wrote: >> >> On Apr 23, 2007, at 7:38 AM, Antoon Pardon wrote: >> >>> The following is part of the explanation on slices in the >>> tutorial: >&g

Re: Tutorial creates confusion about slices

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 4:47 AM, Antoon Pardon wrote: > On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> wrote: >> >> On Apr 24, 2007, at 1:39 AM, Antoon Pardon wrote: >> >>> I suspect that if you give this explanation to someone and explain >>> that t

Re: Tutorial creates confusion about slices

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 6:35 AM, Antoon Pardon wrote: > On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> wrote: >> >> On Apr 24, 2007, at 4:47 AM, Antoon Pardon wrote: >> >>> On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> wrote: >>>>

Re: Python Screen Scraper

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 11:50 AM, James Stroud wrote: > Hello, > > Does anyone know of an example, however modest, of a screenscraper > authored in python? I am using Firefox. > > Basically, I am answering problems via my browser and being scored for > each problem. I have a tendency to go past my pe

Re: If Dict Contains a particular key

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 12:28 PM, Robert Rawlins - Think Blue wrote: Hello Guys, I’m Looking to build a quick if/else statement that checks a dictionary for a key like follows. If myDict contains ThisKey: Do this... Else Do that... Thats the best way o

Re: Blank rows resulting from simple csv script

2007-04-24 Thread Michael Bentley
On Apr 24, 2007, at 3:35 PM, Drew wrote: > Hi all - > > I've written a simple script to read a .csv file and then write out > rows to a new file only if the value in the 4th column is a 0. Here's > the code: > > import csv > > reader = csv.reader(open('table_export.csv','rb')) > > writer = csv.wr

Re: trinary operator - if then else

2007-04-25 Thread Michael Bentley
On Apr 25, 2007, at 1:58 AM, Alchemist wrote: > What is Python's version for the trinary if..then..else operator? > > I want a one-liner such as > a?b:c > for the if..then..else control structure > if a > then b > else c > > Does Python 2.4 support it? Not precisely, but you can *usually*

Re: Re-ocurring Events

2007-04-26 Thread Michael Bentley
On Apr 26, 2007, at 4:26 AM, Robert Rawlins - Think Blue wrote: > A bit more of a complex one this time, and I thought I’d get your > opinions on the best way to achieve this. Basically I’m looking for > a way to describe a re-occurring event, like a calendar event or > appointment I guess.

Re: editing scripts on a mac

2007-04-27 Thread Michael Bentley
On Apr 27, 2007, at 11:08 AM, Steve Holden wrote: > I am teaching someone Python by email, and part of our conversation > recently ran as follows: > > him> How do I save a script and run it? > > me > Do you have a text editor? If so, edit the script in that, then > save it > me > in your home dir

Re: sqlite for mac?

2007-05-01 Thread Michael Bentley
On May 1, 2007, at 12:39 PM, kirkjobsluder wrote: > On May 1, 1:12 pm, 7stud <[EMAIL PROTECTED]> wrote: >> I'm using python 2.4.4 because the download said there were more mac >> modules available for 2.4.4. than 2.5, and I can't seem to locate a >> place to download sqlite for mac. > > I it come

Re: I wish that [].append(x) returned [x]

2007-05-01 Thread Michael Bentley
On May 1, 2007, at 3:45 PM, Tobiah wrote: > I wanted to do: > > query = "query text" % tuple() > > but the append() method returns none, so I did this: > > fields = rec[1:-1] > fields.append(extra) > query = "query text" % tuple(fields) > As you learned. .append() adds to

Re: How can I get the ascii code of a charter in python?

2007-05-01 Thread Michael Bentley
On May 1, 2007, at 4:06 PM, [EMAIL PROTECTED] wrote: > Hi, > a python newbe needs some help, > > I read the python doc at > http://docs.python.org/lib/module-curses.ascii.html > > I tried > Import curses.asciicurses.ascii > Print ascii('a') > > I get an error saying module curses.ascii8 does not

Re: os.path.join

2007-05-01 Thread Michael Bentley
On May 1, 2007, at 8:36 PM, Elliot Peele wrote: > Why does os.path.join('/foo', '/bar') return '/bar' rather than > '/foo/bar'? That just seems rather counter intuitive. It's the leading slash in '/bar'. os.path.join('/foo', 'bar') returns '/foo/bar'. -- http://mail.python.org/mailman/listi

Re: 4 byte integer

2007-05-11 Thread Michael Bentley
On May 11, 2007, at 4:25 AM, Paul D Ainsworth wrote: > Greetings everyone. I'm a relative newcomer to python and I have a > technical > problem. > > I want to split a 32 bit / 4 byte unsigned integer into 4 separate > byte > variables according to the following logic: - > > bit numbers 0..7 b

Re: searching algorithm

2007-05-11 Thread Michael Bentley
On May 10, 2007, at 12:26 PM, Gigs_ wrote: > Hi all! > > I have text file (english-croatian dictionary) with words in it in > alphabetical > order. > This file contains 17 words in this format: > english word: croatian word > > I want to make instant search for my gui > Instant search, i me

Re: searching algorithm

2007-05-11 Thread Michael Bentley
> > Call me dense, but how does one do this in Python - which doesn't have > pointers? Dictionaries with dictionaries within dictionaries... (with > each letter as the key and the its children as values) is going to be > extremely space inefficient, right? Isn't *everything* in python essentially

Re: searching algorithm

2007-05-11 Thread Michael Bentley
On May 11, 2007, at 3:50 AM, Michael Bentley wrote: > > Here's an idea: use a rats' nest of dictionaries and do all the > lookup work up front when you build the rats' nest. Maybe something > like this: ... Oops! This is better :-) #! /usr/bin/env pytho

Re: How to do basic CRUD apps with Python

2007-05-13 Thread Michael Bentley
On May 13, 2007, at 6:20 PM, walterbyrd wrote: > With PHP, libraries, apps, etc. to do basic CRUD are everywhere. Ajax > and non-Ajax solutions abound. > > With Python, finding such library, or apps. seems to be much more > difficult to find. > > I thought django might be a good way, but I can no

Re: Removing part of string

2007-05-13 Thread Michael Bentley
On May 14, 2007, at 12:56 AM, [EMAIL PROTECTED] wrote: > Hi, > I am parsing an xml file ,and one part of structure looks > something like this: > > - PhysicalLink="Infotainment_Control_Bus_CAN"> > Infotainment_Control_Bus_CAN_TIMEOUT_AX > Timeout N_As/N_Ar > Time from transmit request

Re: Asyncore Help?

2007-05-14 Thread Michael Bentley
On May 14, 2007, at 4:30 AM, Nick Craig-Wood wrote: > The learning curve of twisted is rather brutal :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to choose between python and java

2007-05-16 Thread Michael Bentley
On May 15, 2007, at 8:21 PM, Anthony Irwin wrote: > I saw on the python site a slide from 1999 that said that python was > slower then java but faster to develop with is python still slower > then java? I guess that all depends on the application. Whenever I have a choice between using someth

Re: url question - extracting (2 types of) domains

2007-05-16 Thread Michael Bentley
On May 15, 2007, at 9:04 PM, lazy wrote: > Hi, > Im trying to extract the domain name from an url. lets say I call > it full_domain and significant_domain(which is the homepage domain) > > Eg: url=http://en.wikipedia.org/wiki/IPod , > full_domain=en.wikipedia.org ,significant_domain=wikipedia.org

Re: removing common elemets in a list

2007-05-16 Thread Michael Bentley
On May 16, 2007, at 10:36 AM, John Zenger wrote: > On May 16, 2:17 am, [EMAIL PROTECTED] wrote: >> Hi, >> Suppose i have a list v which collects some numbers,how do i >> remove the common elements from it ,without using the set() opeartor. >>

Re: Code Explanation

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 4:12 AM, Robert Rawlins - Think Blue wrote: I’m currently working on a non-python project, and I’m trying to overcome a task of parsing a text file into a database and/or xml file. I’ve managed to find a parser example written in python, and I’m hoping to deconstruct the

Re: FreeType

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 12:29 PM, Glich wrote: > Hi, where can I download freetype (>= 2.1.7)? I need it to use > matplotlib. I have search a lot but still can not find it. Thanks! Type 'freetype' in the google search form, and click the "I'm Feeling Lucky" button. If that doesn't work for some r

Re: FreeType

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 2:47 PM, Glich wrote: > I've been there. All the code is in C/C++, don't I need it in python? > I will explore the software. I dismissed this because there was no > python. I am knew to all of this. Thanks for your reply. The c stuff (freetype) is what you need (it gets insta

Re: How to convert a number to binary?

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 6:33 PM, Lyosha wrote: > Converting binary to base 10 is easy: int('', 2) > 255 > > Converting base 10 number to hex or octal is easy: oct(100) > '0144' hex(100) > '0x64' > > Is there an *easy* way to convert a number to binary? def to_base(number, bas

Re: How to convert a number to binary?

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 6:45 PM, Lyosha wrote: > On May 17, 4:40 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> On May 17, 2007, at 6:33 PM, Lyosha wrote: >> >>> Converting binary to base 10 is easy: >>>>>> int('', 2) >&g

Re: App Leaving 'sh ' Everywhere

2007-05-18 Thread Michael Bentley
On May 18, 2007, at 3:49 AM, Robert Rawlins - Think Blue wrote: I’ve got an application that seems to leave ‘sh ’ in my os processes list. I’m running it on Debian, albeit a stripped down embedded version. I’m not sure what the cause of this is, My application starts several threads and al

Re: Python compared to other language

2007-05-18 Thread Michael Bentley
On May 18, 2007, at 2:04 PM, scott wrote: > > I have been looking at the various programming languages > available. I > have programed in Basic since I was a teenager and I also have a basic > understanding of C, but I want something better. > > Can anybody tell me the benefits and

Re: Unable to strip \n characters

2007-05-20 Thread Michael Bentley
On May 20, 2007, at 5:50 AM, aiwarrior wrote: > files = f.readlines() >for upload in files: > upload.strip("\n") > final_args = "./rsapiresume.pl %s prem user password" % (upload) > print upload > #os.system( final_args ) for upload in f: final_args = "./rsapiresu

Re: Unable to strip \n characters

2007-05-20 Thread Michael Bentley
On May 20, 2007, at 7:41 AM, Michael Bentley wrote: > (upload.strip()) Oops: (upload.strip(),) or upload.strip() -- http://mail.python.org/mailman/listinfo/python-list

Re: Restart Linux System

2007-05-22 Thread Michael Bentley
On May 22, 2007, at 11:15 AM, Michael L Torrie wrote: >> I’m looking to restart a Linux system from my python application. >> What’s the best way to achieve this, is there something in the OS >> module? > > Probably not. You need to just spawn the "reboot" command, or run > "init > 6." This r

Re: Creating Graphs for the Web

2007-05-23 Thread Michael Bentley
On May 23, 2007, at 4:17 PM, erikcw wrote: > I'm working on a django powered website, and need to dynamically > generate some graphs (bar, pie, and line) from users' data stored in > MySQL. > > Can anyone recommend a good library I can use for this? Matplotlib! -- http://mail.python.org/mailm

Re: How to get a dot's or pixel's RGB with PIL

2007-05-26 Thread Michael Bentley
On May 26, 2007, at 11:29 PM, [EMAIL PROTECTED] wrote: > e.g. rtfm = (100,100) im.getpixel(rtfm) -- http://mail.python.org/mailman/listinfo/python-list

Re: ImageMagick Issue

2007-05-30 Thread Michael Bentley
On May 30, 2007, at 11:00 PM, Sick Monkey wrote: When I run the following command: [EMAIL PROTECTED] david.huggins]# identify -format %w '/someDIR/ images/david.huggins/100_0264.JPG' I get the following result 2304 However, when I try to set this value to a variable, ie

Re: Good Python style?

2007-05-31 Thread Michael Bentley
On May 31, 2007, at 2:59 AM, Andreas Beyer wrote: > Hi, > > I found the following quite cryptic code, which basically reads the > first column of some_file into a set. > In Python I am used to seeing much more verbose/explicit code. > However, > the example below _may_ actually be faster than t

Re: Launching App

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 3:01 AM, Robert Rawlins - Think Blue wrote: I’m looking for the best method to launch my python app when my Linux system boots up. At the moment I just have an entry like this in my rc.local file: CD /myfolder/anotherfolder ./myapp.py Is this the best way to do this?

Re: Launching App

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 3:01 AM, Robert Rawlins - Think Blue wrote: I’m looking for the best method to launch my python app when my Linux system boots up. At the moment I just have an entry like this in my rc.local file: CD /myfolder/anotherfolder ./myapp.py Is this the best way to do this? O

Re: Stackless Integration

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 4:48 AM, Jean-Paul Calderone wrote: > On Thu, 09 Aug 2007 09:00:27 -, "Justin T." > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I've been looking at stackless python a little bit, and it's awesome. >> My question is, why hasn't it been integrated into the upstream >> python

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Michael Bentley
On Aug 12, 2007, at 6:28 PM, Dick Moores wrote: n = 12 base = 36 print to_base(n, base) == This seems to work fine for n >= base, but not for n < base. For example, the code shown returns "c". Is my indentation wrong, or the code? It seems to me that

Re: Colored text

2007-08-12 Thread Michael Bentley
On Aug 12, 2007, at 7:05 PM, Rohan wrote: > Can some one tell me how do I get colored text. Say when I want to > write something in a text file , how do I get it colored. You can use ANSI escape codes -- http://en.wikipedia.org/wiki/ ANSI_escape_code: colorCodes = [ "\033[0mAll attributes

Re: curses library

2007-08-15 Thread Michael Bentley
On Aug 14, 2007, at 11:10 AM, Ghirai wrote: > I need to write a console application. > > Are there any wrappers around curses/ncurses? > Or any other similar libraries? It looks like Curses Tk still exists: http://www.schwartzcomputer.com/ tcl-tk/tcl-tk.html It probably requires a recompile of

Re: clarification

2007-08-16 Thread Michael Bentley
On Aug 16, 2007, at 2:42 AM, Beema shafreen wrote: hi every body, i have compared two files: code: fh = open('HPRD_MAIN_20.txt','r') for line in fh.readlines(): data = line.strip().split('#') fh1 = open('NOMENCLATURE_MAIN_20.txt','r') for line1 in fh1.readlines():

Re: popen4 not returning output

2007-08-20 Thread Michael Bentley
On Aug 19, 2007, at 8:58 PM, [EMAIL PROTECTED] wrote: > I am trying to run the following script: > > > #!/usr/bin/python > > import popen2 > > commandToRun = """scp scp_trial.py [EMAIL PROTECTED]:/targetDirectory""" > #commandToRun = "ls" > print commandToRun > p_out, p_in = popen2.popen4 (comman

Re: Where we need to use Python ?

2007-08-20 Thread Michael Bentley
On Aug 20, 2007, at 1:02 AM, [EMAIL PROTECTED] wrote: > And Is it a interpreted language or a programming language > It comes in which category > > I very keen to know this please tell [ open on suburban kitchen, Wife and Husband arguing ] Wife: New Shimmer is a floor wax! Husband: No, new Shi

Re: Syslog

2007-08-23 Thread Michael Bentley
On Aug 20, 2007, at 4:56 PM, greg wrote: > Hi All, > > Could anyone tell me how I could syslog to a specific log (e.g. /var/ > log/daemon.log, /var/log/syslog.log...)? > # something like this: import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(lev

Re: simple spider in python

2007-08-23 Thread Michael Bentley
On Aug 23, 2007, at 6:33 AM, [EMAIL PROTECTED] wrote: > Hi everybody, i'm new to the forum so: hello everybody (should I say > "world"?) ^_^ > I'm trying to do a simple spider in python which: > > 1) ask google a query > 2) parse the data > > I'm a python newbie so *any* help would be very, very

Re: convert non-delimited to delimited

2007-08-27 Thread Michael Bentley
On Aug 27, 2007, at 10:59 AM, RyanL wrote: > I'm a newbie! I have a non-delimited data file that I'd like to > convert to delimited. > > Example... > Line in non-delimited file: > 01397256359210100534+42050-102800FM-15+1198KAIA > > Should be: > 0139,725635,9,2000,01,01,00,53,4,+42050

Re: how can I find out the process ids with a process name

2007-09-02 Thread Michael Bentley
On Sep 2, 2007, at 12:26 PM, herman wrote: > I would like to find out all the process id with the process name > 'emacs'. > > In the shell, i can do this: > > $ ps -ef |grep emacs > root 20731 8690 0 12:37 pts/200:00:09 emacs-snapshot-gtk > root 25649 25357 0 13:55 pts/900:00:05 e

Re: how can I find out the process ids with a process name

2007-09-03 Thread Michael Bentley
> > cd /proc > for i in ls [0-9]*/status > do > echo $i `grep '^Name' $i | cut -f2` | sed 's/\/status//g' > done > Um... cd /proc for i in `ls [0-9]*/status` do echo $i `grep '^Name' $i | cut -f2` | sed 's/\/status//g' done --- Let the wookie win. -- http://mail.python.org/mailma

Re: merits of Lisp vs Python

2007-03-09 Thread Michael Bentley
On Mar 9, 2007, at 1:10 PM, Tim Bradshaw wrote: > On 2007-03-09 07:00:06 +, [EMAIL PROTECTED] (Alex Martelli) said: > >> (nee "One Laptop Per Child", OLPC, and once known as the "$100 >> laptop") >> uses Python as its preferred (only?-) application language, and it's >> slated to be the most

Re: Database module & multithreading

2007-03-10 Thread Michael Bentley
> > Thanx for this pointer buddy! I have done my homework. Some Database > modules are not actively maintained some modules does not work with > Python 2.5. At this moment I am using Sqlite3 which is pretty fast but > it dosent allow me to use multi threading so which database module is > better i

Re: using python to visit web sites and print the web sites image to files

2007-03-12 Thread Michael Bentley
> > I wonder whether python can be used to simulate a real user to do the > following: > 1) open a web site in a browser; > 2) printscreen, so to copy the current active window image to > clipboard; > 3) save the image file to a real file > > Any pointer will be apprieciated! Which OS? -- http

Re: Twelve Proofs that Muhammad is a True Prophet

2007-03-13 Thread Michael Bentley
On Mar 14, 2007, at 12:09 AM, moslim wrote: > My brothers and sisters everywhere! With this essay, I am not singling > out the adherents of Islam - to which I ascribe - but rather I am > writing this essay to every man and woman throughout the whole world. > ... > You know, at first I didn't rea

Re: How to calculate a file of equations in python

2007-03-19 Thread Michael Bentley
On Mar 19, 2007, at 11:48 PM, John wrote: > Hi, > I have a text file which contains math expression, like this > 134 > +234 > +234 > > (i.e. an operation (e.g. '+) and then a number and then a new line). > > Can you please tell me what is the easiest way to calculate that file? > for example the

Re: Mastering Python

2007-03-22 Thread Michael Bentley
>> > For future reference, and I hope you don't mind the lesson, the past > tense of "bind" is "bound" (I can't state it as a firm rule, but many > *ind words seem to go *ound: bind, find, wind [as in wrap, not blowing > in the...], grind -> bound, found, wound [not to confuse with an > injur

Re: My MVC critique

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 9:29 AM, [EMAIL PROTECTED] wrote: > mickey mouse Well, at least you spelled Mickey Mouse right... :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Been a while...

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 10:34 AM, John Salerno wrote: > Hi guys. It's been a while since I've used Python, so I got a little > rusty, but I really want to start using it again, just out of habit > and > for fun. Can anyone suggest a book or a website with little projects I > could work on to keep m

Re: Problem with time

2007-03-22 Thread Michael Bentley
> > 1) i got 2 values from mysql db (fields are "time" type) > 2) python get it as "" (why timedelta???) > 3) i need to compare 2 fields with actual time ... EG: > if ArrOutputsAuto[i].TimeFrom >= GNow and ArrOutputsAuto[i].TimeTo > <= GNow: > > i need actual time, and 2 fields from DB in datetim

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 12:07 PM, Anton Vredegoor wrote: > Agreed. There's now probably even room on the job market for those who > don't belong to the select elite of early adopters. We might even root > out the professionalist attitude and address the problem of tying > people > to their resumes.

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 1:00 PM, Anton Vredegoor wrote: > So HRM people keep asking questions like 'But > what have you been doing?' In the end I just started my own > company, and > while I'm not always employed as a freelancer I can at least now > say I'm > running my own business. Yeah, I've

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Michael Bentley
> > would there be any speed increase in code execution after python > code being > compiled into exe file with py2exe? > No. I would expect slower startup followed by the same code execution time you'd get from running normally (not that I've actually tested it, mind you). regards, Michae

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Michael Bentley
> > Actualy startup is faster for the apps that I have py2exe'd. I think > this may be because all the modules are in one place and Python > doesn't > have to go searching for them. Thanks, Will! That's good to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
On Mar 24, 2007, at 12:30 PM, Robert Hicks wrote: > I want to upgrade to 2.5 but I don't see any unistall instructions > anywhere. Don't uninstall it. That's why Apple put python under /Library/Frameworks/ Python.framework/Versions. So you can have multiple versions installed. Hopefully you le

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
On Mar 24, 2007, at 12:55 PM, 7stud wrote: > In addition, the download notes for the stand alone MacPython 2.5 > install say that there aren't as many modules for 2.5 as there are for > the 2.4, which is something you may want to consider. There aren't as many pre-built modules for 2.5 at the Ma

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
> No, the OSX version is like 2.3 something. I installed the 2.4.4 > version in /usr/local bypassing the Apple stuff. Oh! Well then: ---[cut here]--- # danger will robinson -- use at your own risk ;-) rm /usr/local/bin/python* rm -rf /usr/local/lib/python ---[snip]--- Is the uninstall program :

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
> > /Libary/Frameworks/ is an empty directory(except for . and ..) on my > Mac, and I have 2.3.5 installed somewhere. Ye sorry 'bout that... Apple's default install is under /System/ Library... Framework builds from python.org get installed under / Library -- http://mail.python.org/mailman/

Re: Join strings - very simple Q.

2007-03-24 Thread Michael Bentley
On Mar 25, 2007, at 6:33 AM, Dennis Lee Bieber wrote: > On Sat, 24 Mar 2007 10:53:20 +0200, "Hendrik van Rooyen" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> What happened in 1850 to make it the demarcation line? >> > Well... The Modified Julian Date zero is 17

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread Michael Bentley
On Mar 25, 2007, at 12:04 PM, [EMAIL PROTECTED] wrote: > don't even get me > started on python docs.. ayaa ;] ok, try getting started with this then: http://www.crummy.com/ software/BeautifulSoup/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending ECHO_REQUEST (pinging) with python

2007-03-26 Thread Michael Bentley
On Mar 26, 2007, at 1:30 AM, Thomas Dybdahl Ahle wrote: > Hi, I've writing a python application in which I'd like to have a > small > "ping label", to always tell the current ping time to the server. > > It seems however that I have to be root to send those imcp > packages, but > I guess there

Re: Sending ECHO_REQUEST (pinging) with python

2007-03-26 Thread Michael Bentley
On Mar 26, 2007, at 1:30 AM, Thomas Dybdahl Ahle wrote: > > It seems however that I have to be root to send those imcp > packages, but > I guess there must be a workaround since I can easily use the "ping" > command as ordinary user. > The workaround your ping command is using btw, is probably

Re: python on window

2007-03-26 Thread Michael Bentley
On Mar 26, 2007, at 7:00 AM, sandeep patil wrote: > i have written this program but i have gott following error, > in anather proram "indentation error" sir how i will indent in my > editor > > #test.py def invert(table): > index=() > for key in table: > value=table[

Re: enumerating processes

2007-03-26 Thread Michael Bentley
On Mar 27, 2007, at 1:07 AM, 李现民 wrote: > thanks for your help, but that is not what I am looking for. My > question is: I need to determine whether another process is running > now ---in my problem, that is 'tomcat5.exe' ---that determines what > should I do next. Maybe this can help: htt

Re: Weird behavior in search in a list

2007-03-29 Thread Michael Bentley
On Mar 29, 2007, at 6:51 AM, Su Y wrote: > > I want find the first number in extend[] which is larger than num, so > I wrote: > def find(num): > count=0 > for elem in extend: > if elem count+=1 > return count > > I found that if extend[] is monotonous, like [1.1, 2.

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Michael Bentley
On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote: > I want to be able to insert a '-' character in front of all numeric > values in a string. I want to insert the '-' character to use in > conjunction with the getopt.getopt() function. > > Rigt now, I'm implementing a menu system where users will b

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Michael Bentley
On Mar 30, 2007, at 4:41 PM, Paul McGuire wrote: > On Mar 30, 2:09 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote: >> >> >> >> >> >>> I want to be able to insert a '-' character in f

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Michael Bentley
On Mar 30, 2007, at 5:42 PM, Michael Bentley wrote: > for i in yourstring.split(): > if i[0].isdigit(): > yourstring = yourstring.replace(i, '-%s' % (i,), 1) *OR* yourstring ' '.join(x[0].isdigit() and '-%s' % x or x for x i

Re: Generic logic/conditional class or library for classification of data

2007-04-01 Thread Michael Bentley
On Mar 31, 2007, at 11:54 PM, Basilisk96 wrote: > This topic is difficult to describe in one subject sentence... > > Has anyone come across the application of the simple statement "if > (object1's attributes meet some conditions) then (set object2's > attributes to certain outcomes)", where "obje

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread Michael Bentley
On Apr 6, 2007, at 2:32 PM, John Henry wrote: > I am back against the wall trying to migrate my multithreaded > application from Python 2.3 to 2.5. The part of the code that's > failing has to do with queues (2.3 queues and 2.5 queues are not the > same). Since WingIDE doesn't support multith

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Michael Bentley
On Apr 9, 2007, at 3:29 AM, 人言落日是天涯,望极天涯不 见家 wrote: > Is there a simple function to generate a list like ['a', 'b', 'c', ... > 'z']? The range() just can generate the numeric list. import string list(string.lowercase) -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >