Re: how to use subprocess.Popen execute "find" in windows

2008-05-06 Thread alito
On May 6, 7:19 pm, [EMAIL PROTECTED] wrote: > In cmd, I can use find like this. > > C:\>netstat -an | find "445" >   TCP    0.0.0.0:445            0.0.0.0:0              LISTENING >   UDP    0.0.0.0:445            *:* > > C:\> > > And os.system is OK.>>> import os > >>> os.system('netstat -an | fin

Re: saving a webpage's links to the hard disk

2008-05-06 Thread Jetus
On May 4, 7:22 am, [EMAIL PROTECTED] wrote: > On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> escribió: > > > > Is there a good place to look to see where I can find some code that > > > will help me to save we

Re: loading folder list from my mailbox in python

2008-05-06 Thread rishab
Hey everyone, I want to print the folder list of my mailbox using python (IMAP4), and with hierarchy, i.e. it should print all the names of the folders of my mailbox and the folders within them. Can anyone please help me with this. -- http://mail.python.org/mailman/listinfo/python-list

Re: License selection for free software

2008-05-06 Thread Paul Rubin
[EMAIL PROTECTED] (Ville M. Vainio) writes: > In practice, the probability of hijacking of source code by an evil > corporation is very low for most projects. And even when it did > happen, the evil corporation would likely submit patches. If they're going to submit patches then they shouldn't ha

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-06 Thread Paul Rubin
"Zed A. Shaw" <[EMAIL PROTECTED]> writes: > How do people feel about Vellum's GPLv3 status? I'm certainly in favor of it, though I didn't notice this question until it spawned its own thread, and I'm not currently a Vellum user or developer, so maybe my view shouldn't count for much. -- http://ma

Re: DISLIN 9.3 starting issues

2008-05-06 Thread Weinhandl Herbert
adolfo wrote: I built the following little program: from numpy import * from dislin import * def main(): x = arange (100, typecode=Float32) plot (x, sin (x/5)) disfin () main() *** Here are the problems: 1. The "from Numeric import" statement did not work, I replaced with "from

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-06 Thread Paul Rubin
[EMAIL PROTECTED] (Ville M. Vainio) writes: > if the idea is to maximize the popularity, GPL is a worse bet. That is not a valid inference. Look at the popularity of Linux vs BSD, for example. -- http://mail.python.org/mailman/listinfo/python-list

Re: License selection for free software

2008-05-06 Thread Paul Rubin
"Matt Porter" <[EMAIL PROTECTED]> writes: > > Python's non-GPL license certainly is annoying to some of us. > I'm intrigued - how can it be annoying? It means GPL'd contributions can't be included in the main Python distro. -- http://mail.python.org/mailman/listinfo/python-list

Problem parsing SOAP envelope with ElementTree

2008-05-06 Thread Zvi
Hi All, Can someone tell me why id the following not working? I have a soap response envelope, for test purpose it's just a string and I create ElementTree from it. Then I try to find Response tag, but I get None. data = """http://schemas.xmlsoap.org/ soap/envelope/" xmlns:xsi="http://

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: > Well, I attach a kind of explanatory Noddy example I wrote a few years ago > for someone on the python-win32 list. I think, glancing over it, that it > includes > what you need to know, although not necessarily in the right order. I'm happy > to > explain if things aren't cle

Re: Script Optimization

2008-05-06 Thread lev
On May 4, 10:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 17:01:15 -0300, lev <[EMAIL PROTECTED]> escribió: > > >> * Change indentation from 8 spaces to 4 > > I like using tabs because of the text editor I use, the script at > > the end is with 4 though. > > Can't

Re: STL multimap

2008-05-06 Thread castironpi
On May 6, 10:03 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > I'm having trouble following your discussion > and I suspect you might be a friend of Mark V Cheney. > But I will focus on this one point. > > On May 5, 11:14 pm, [EMAIL PROTECTED] wrote: > > > If recursive generators are really useless

Re: generator functions in another language

2008-05-06 Thread castironpi
On May 6, 1:00 pm, hdante <[EMAIL PROTECTED]> wrote: > On May 6, 12:28 am, [EMAIL PROTECTED] wrote: > > > > > > > > > There's a process decorator to functions in a module. > > > [supposes] > > > @process > > def datafile( processdict ): > >    processdict.modify( ) > >    op= yield > >    op.call(

Re: Can't drag and drop onto .py in Windows XP?

2008-05-06 Thread Ian Kelly
On Tue, May 6, 2008 at 9:12 PM, Sizer <[EMAIL PROTECTED]> wrote: > I have several python utils that look at sys.argv to get a list of > filenames to process and mangle the files in various ways. If I have a > bar.bat file in Windows XP then I can just drag foo.avi onto bar.bat and > bar.bat gets

Re: Reversing a dict?

2008-05-06 Thread castironpi
On May 6, 10:20 am, [EMAIL PROTECTED] wrote: > Hi - further to my earlier query regarding partial matches (which with > all your replies enabled me to advance my understanding, thanks), I > now need to reverse a dict. > > I know how to reverse a list (with the reverse method - very handy), > but it

Re: open filename with spaces in path

2008-05-06 Thread Kam-Hung Soh
On Wed, 07 May 2008 09:09:08 +1000, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson <[EMAIL PROTECTED]> wrote: I'm having trouble opening a file in linux, whose path has spaces in it. $ mkdir my\ test $ echo test > my\ test/test.txt $ python

Re: Generate labels for a multi-level outline

2008-05-06 Thread castironpi
On May 6, 4:43 pm, [EMAIL PROTECTED] wrote: > I need to generate multi-level incrementing labels for an > outline/hierarchy where the string for each level of a label is based on > an incrementing sequence like 1, 2, 3 or A, B, C, or even I, II, III. > For simplicity, assume that each level's label

Can't drag and drop onto .py in Windows XP?

2008-05-06 Thread Sizer
I have several python utils that look at sys.argv to get a list of filenames to process and mangle the files in various ways. If I have a bar.bat file in Windows XP then I can just drag foo.avi onto bar.bat and bar.bat gets called with foo.avi as an argument, everyone's happy. But if I have a b

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-05-06 Thread John Henry
On May 5, 11:04 am, [EMAIL PROTECTED] wrote: > John, you are the man > > > during my search for perfection, I found Qooxdoo (http://qooxdoo.org/). > > > ... > > > I found QxTransformer > > (http://sites.google.com/a/qxtransformer.org/qxtransformer/Home) which is a > > XSLT toolkit that creats XML

Re: how to use subprocess.Popen execute "find" in windows

2008-05-06 Thread Justin Ezequiel
On May 6, 5:19 pm, [EMAIL PROTECTED] wrote: > In cmd, I can use find like this. > > C:\>netstat -an | find "445" > TCP0.0.0.0:4450.0.0.0:0 LISTENING > UDP0.0.0.0:445*:* > > C:\> > > And os.system is OK.>>> import os > >>> os.system('netstat -an | fin

The worlds largest FREE jobs and resume database!

2008-05-06 Thread fashion girl
The worlds largest FREE jobs and resume database! Employers search resumes and post jobs FREE. Jobseekers post resumes and search jobs FREE. http://www.freewebs.com/eeyes/ -- http://mail.python.org/mailman/listinfo/python-list

Re: License selection for free software

2008-05-06 Thread Ben Finney
[EMAIL PROTECTED] (Ville M. Vainio) writes: > So I'm not opposed to GPL - just saying that it's not often the > choice that will net you the most users. Fortunately, that's not always the goal of a free software project. When freedom of all users matters more than "popular at any cost", the GPL i

Re: How do you debug memory usage?

2008-05-06 Thread Noah
On May 6, 2:19 pm, David <[EMAIL PROTECTED]> wrote: > I want to debug rdiff-backup (Python backup tool for Linux) - it's > using 2 GB of memory (1GB ram, 1GB swap) on a backup server at work. > ... > David Rsync uses a lot of memory: http://www.samba.org/rsync/FAQ.html#4 rdiff-backup uses librs

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-06 Thread andrej . panjkov
On May 6, 9:06 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > "Wojciech Walczak" <[EMAIL PROTECTED]> writes: > > 2008/5/6, Banibrata Dutta <[EMAIL PROTECTED]>: > > > > Use /usr/bin/env. If env is not in /usr/bin, put a link to it there. > > > > So why not put symlink to Python over there on all mac

Re: open filename with spaces in path

2008-05-06 Thread Kam-Hung Soh
On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson <[EMAIL PROTECTED]> wrote: I'm having trouble opening a file in linux, whose path has spaces in it. $ mkdir my\ test $ echo test > my\ test/test.txt $ python >>> open('./my test/test.txt') Exception >>> open('./my\\ test/test.txt') Exce

Re: open filename with spaces in path

2008-05-06 Thread Gary Herron
Michael Robertson wrote: I'm having trouble opening a file in linux, whose path has spaces in it. $ mkdir my\ test $ echo test > my\ test/test.txt $ python >>> open('./my test/test.txt') Exception This works just fine for me. No need to escape the spaces. You haven't given us much to work w

Re: open filename with spaces in path

2008-05-06 Thread Micah Elliott
On 2008-05-06 Michael Robertson wrote: > I'm having trouble opening a file in linux, whose path has > spaces in it. > > $ mkdir my\ test > $ echo test > my\ test/test.txt > $ python > > >>> open('./my test/test.txt') > Exception That's funny. These exact steps work fine for me on Linux, with Pyt

DISLIN 9.3 starting issues

2008-05-06 Thread adolfo
*** I thought I posted this subject 45 min ago but it does not show so something went wrong and it does not show up. Excuse me if I repeat myself *** DISLIN 9.3 old manual problems I just installed DISLIN 9.3 for python (DISPY is installed too) and I am up to: 1.4 Quickplots Some quickplots ar

Re: open filename with spaces in path

2008-05-06 Thread Christian Heimes
Michael Robertson schrieb: > I'm having trouble opening a file in linux, whose path has spaces in it. > > $ mkdir my\ test > $ echo test > my\ test/test.txt > $ python > open('./my test/test.txt') > Exception Works for me >>> open('./my test/test.txt') Christian -- http://mail.python.or

open filename with spaces in path

2008-05-06 Thread Michael Robertson
I'm having trouble opening a file in linux, whose path has spaces in it. $ mkdir my\ test $ echo test > my\ test/test.txt $ python >>> open('./my test/test.txt') Exception >>> open('./my\\ test/test.txt') Exception but yet... >>> import os >>> os.chdir('./my test') >>> open('./test') works ju

Re: DISLIN Manual

2008-05-06 Thread Robert Kern
adolfo wrote: I am at the very beginning of the DISLIN 9.3 Manual: 1.4 Quickplots I recommend asking the DISLIN author. I don't think that DISLIN is widely used in Python. Some quickplots are added to the DISLIN module which are collections of DISLIN routines for displaying data with one

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-06 Thread Vlastimil Brom
Hi David, thanks for your comments and hints, the proposed approach with a list of dicts lookup dict is indeed much faster, than my previous attempts with a database (even without psyco). I used a slightly different structure with sets of indices, since they should be unique anyway and the values a

DISLIN Manual

2008-05-06 Thread adolfo
I am at the very beginning of the DISLIN 9.3 Manual: 1.4 Quickplots Some quickplots are added to the DISLIN module which are collections of DISLIN routines for displaying data with one command. For example, the function ’plot’ displays two-dimensional curves. Example: from Numeric import * from

RE: Bit twiddling floating point numbers

2008-05-06 Thread Blubaugh, David A.
Sorry for the reply. I did not get your message until now. I was wondering if there was a way to develop floating-point mathematics package within a module. I was wondering if some of your work on bit twiddling floating - point numbers could be provided to me!!! Thanks. David Blubaugh

Generate labels for a multi-level outline

2008-05-06 Thread python
I need to generate multi-level incrementing labels for an outline/hierarchy where the string for each level of a label is based on an incrementing sequence like 1, 2, 3 or A, B, C, or even I, II, III. For simplicity, assume that each level's label segment is separated by a period ("."). I will pas

Re: Newbie question - probably FAQ (but not exactly answered by regular FAQ)

2008-05-06 Thread Nick Craig-Wood
Banibrata Dutta <[EMAIL PROTECTED]> wrote: > As such 2.6 & 3.0 are also cooking, but from what I see on the mailing > list, some of the features are a bit controversial. So if I start with > 2.5 now, unless there are some break-thru preformance gains, or > annoying defects fixed, I'd stick to i

Re: python vs. grep

2008-05-06 Thread Wojciech Walczak
2008/5/6, Anton Slesarev <[EMAIL PROTECTED]>: > But I have some problem with writing performance grep analog. [...] > Python code 3-4 times slower on windows. And as I remember on linux > the same situation... > > Buffering in open even increase time. > > Is it possible to increase file readin

Re: How do you debug memory usage?

2008-05-06 Thread David
> > Here is my modified version of Chris' get_all_objects() function. > All I did was force garbage collection using gc.collect(). > This makes sure that you are not counting objects that Python has > left in memory, but plans on deleting at some point. Thanks for the logic. I want to debug r

Re: python vs. grep

2008-05-06 Thread Arnaud Delobelle
Anton Slesarev <[EMAIL PROTECTED]> writes: > f = open("bigfile",'r') > > flines = (line for line in f if pat.search(line)) > c=0 > for x in flines: > c+=1 > print c It would be simpler (and probably faster) not to use a generator expression: search = re.compile('sometext').search c = 0 for

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-06 Thread hdante
On May 5, 3:26 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > "Zed A. Shaw" <[EMAIL PROTECTED]> writes: > > > GPLv3? > > > How do people feel about Vellum's GPLv3 status?  It actually doesn't > > impact anyone unless you embed Vellum into a project/product or you > > Yeah, but it effectively prev

Re: How do you debug memory usage?

2008-05-06 Thread Noah
On May 6, 6:27 am, David <[EMAIL PROTECTED]> wrote: > Hi list. > What is the best way to debug memory usage in a Python script? > ... > Are there any tools/modules/etc I can use like this? > David. You need to use the debug build of Python to get exact numbers, but there are a few tricks you can u

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Larry Bates
jmDesktop wrote: Studying OOP and noticed that Python does not have Interfaces. Is that correct? Is my schooling for nought on these OOP concepts if I use Python. Am I losing something if I don't use the "typical" oop constructs found in other languages (Java, C# come to mind.) I'm afraid tha

Re: Reversing a dict?

2008-05-06 Thread Paul Hankin
On May 6, 4:24 pm, [EMAIL PROTECTED] wrote: > On May 6, 5:20 pm, [EMAIL PROTECTED] wrote: > > > > > Hi - further to my earlier query regarding partial matches (which with > > all your replies enabled me to advance my understanding, thanks), I > > now need to reverse a dict. > > > I know how to reve

Re: read line

2008-05-06 Thread Larry Bates
[EMAIL PROTECTED] wrote: hi every body, I'm a new python user and I'm making a program to run useing Abaqus and there is something I can't do, if i have a text file that has a line like this " 10 20 30 40 50" and I wana do the coding to put every number of these like 10 or 20 in a separa

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-06 Thread Carl Banks
On Apr 29, 3:51 am, "Zed A. Shaw" <[EMAIL PROTECTED]> wrote: > GPLv3? > > How do people feel about Vellum's GPLv3 status? It's going to scare away some folks. Using LGPL will almost certainly scare away fewer. People who don't like GPL are usually concerned about its viral aspects moreso than th

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Max M
Arnaud Delobelle skrev: jmDesktop <[EMAIL PROTECTED]> writes: Studying OOP and noticed that Python does not have Interfaces. Is that correct? Is my schooling for nought on these OOP concepts if I use Python. Am I losing something if I don't use the "typical" oop constructs found in other lan

Re: Java or C++?

2008-05-06 Thread Issam
I need to help me.. please.. I have assingment for C++ programe-- http://mail.python.org/mailman/listinfo/python-list

Re: License selection for free software

2008-05-06 Thread Matt Porter
On Tue, 06 May 2008 20:02:21 +0100, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: [EMAIL PROTECTED] (Ville M. Vainio) writes: [EMAIL PROTECTED] (Ville M. Vainio) writes: I don't think BSD/MIT like license really annoys anyone. Think python here ;-) Python's non-GPL license certainly is a

Re: License selection for free software

2008-05-06 Thread Carl Banks
On May 6, 1:22 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Excuse the long post. > > Ben Finney <[EMAIL PROTECTED]> writes: > >> I guess it's safe to assume that you are not opposed to using code > >> based on more liberal license, right? :-) > > > I'm less inclined to base work on, or contrib

Re: Python MIDI in 2008

2008-05-06 Thread Aahz
In article <[EMAIL PROTECTED]>, Max M <[EMAIL PROTECTED]> wrote: > >Well I just thought I would mention that it is not dead. Merely middle aged. "'E's just resting!" -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ Help a hearing-impaired person: http://rule6.info/h

Re: python vs. grep

2008-05-06 Thread Ian Kelly
On Tue, May 6, 2008 at 1:42 PM, Anton Slesarev <[EMAIL PROTECTED]> wrote: > Is it possible to increase file reading performance? Dunno about that, but this part: > flines = (line for line in f if pat.search(line)) > c=0 > for x in flines: > c+=1 > print c could be rewritten as just: pr

python vs. grep

2008-05-06 Thread Anton Slesarev
I've read great paper about generators: http://www.dabeaz.com/generators/index.html Author say that it's easy to write analog of common linux tools such as awk,grep etc. He say that performance could be even better. But I have some problem with writing performance grep analog. It's my script:

Re: License selection for free software

2008-05-06 Thread Paul Rubin
[EMAIL PROTECTED] (Ville M. Vainio) writes: [EMAIL PROTECTED] (Ville M. Vainio) writes: > I don't think BSD/MIT like license really annoys anyone. Think python > here ;-) Python's non-GPL license certainly is annoying to some of us. -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Matt Nordhoff
Mike Driscoll wrote: > On May 6, 8:44 am, jmDesktop <[EMAIL PROTECTED]> wrote: >> Studying OOP and noticed that Python does not have Interfaces. Is >> that correct? Is my schooling for nought on these OOP concepts if I >> use Python. Am I losing something if I don't use the "typical" oop >> cons

Re: logger output

2008-05-06 Thread skunkwerk
On May 5, 3:44 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 13:02:12 -0300,skunkwerk<[EMAIL PROTECTED]> escribió: > > > > > On May 4, 10:40 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Mon, 05 May 2008 00:33:12 -0300,skunkwerk<[EMAIL PROTECTED]> escribi

Re: calling variable function name ?

2008-05-06 Thread Blais, Gerard C.
Sure! Make a dictionary: fdict = {"A":fa, "B":fb, ... } Then consider x = "A" result = fdict(x)(param1, param2) should call fa without any if's... Gerry -- http://mail.pytho

Re: Are rank noobs tolerated, here?

2008-05-06 Thread Jeffrey Froman
notbob wrote: > Do python scripts require the: > > #!/usr/bin/env python An appropriate shebang is required if you intend to use the module itself as a script, from the command line, like: $ ./my_module.py argument argument ... It is not required merely to import the module into a python

Re: How do you debug memory usage?

2008-05-06 Thread Banibrata Dutta
Ah yes. Thanks for posting your finding. Had come accross Heapy, earlier, but forgotten about it completely. On Tue, May 6, 2008 at 8:34 PM, David <[EMAIL PROTECTED]> wrote: > > > > I'll check a few of those results and post to the list if I find > something good. > > > > It looks like Heapy, p

Re: Are rank noobs tolerated, here?

2008-05-06 Thread notbob
On 2008-05-06, Jeffrey Froman <[EMAIL PROTECTED]> wrote: > Nice to see another Slackware user around here! Likewise. ;) > That's correct. A function doesn't generally *do* anything until it is > called. Here, it is only defined. The only thing this function does when > called is to print the v

Re: generator functions in another language

2008-05-06 Thread hdante
On May 6, 12:28 am, [EMAIL PROTECTED] wrote: > > There's a process decorator to functions in a module. > > [supposes] > > @process > def datafile( processdict ): >    processdict.modify( ) >    op= yield >    op.call( ) in processdict >    # op.call( ) in namespace > > More simply: > > @process > d

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread hdante
On May 6, 12:09 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > On May 6, 10:26 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > > On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > > > > Studying OOP and noticed that Python does not have Interfaces.  Is > > > that correct?  Is my schooling for n

Re: License selection for free software

2008-05-06 Thread Ville M. Vainio
Excuse the long post. Ben Finney <[EMAIL PROTECTED]> writes: >> I guess it's safe to assume that you are not opposed to using code >> based on more liberal license, right? :-) > > I'm less inclined to base work on, or contribute to, a work under a > non-copyleft license, because I have less assu

Re: Are rank noobs tolerated, here?

2008-05-06 Thread hdante
On May 5, 3:43 pm, notbob <[EMAIL PROTECTED]> wrote: > > -- > > "Here is an example of a user-defined function that has a parameter: > > def print_twice(bruce): > print bruce, bruce > > > ME > is this just an example of how the def should be written and it doesn't > really do an

Re: select.poll() and WSAPoll

2008-05-06 Thread Jean-Paul Calderone
On Tue, 6 May 2008 08:44:36 -0700 (PDT), Giles Brown <[EMAIL PROTECTED]> wrote: On 6 May, 14:18, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: On Tue, 6 May 2008 08:36:28 -0400, inhahe <[EMAIL PROTECTED]> wrote: >select.poll isn't supported on Windows, because Windows doesn't have such a >featu

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > > I would imagine this is why I haven't found any schools teaching > Python in their basic programming classes too. On the dynamic typing, I don't understand your reasoning. What part does 'this' refer to? Also, you are wrong. We teach 2nd yea

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Torsten Bronger
Hallöchen! jmDesktop writes: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Is my schooling for nought on these OOP concepts if I > use Python. Am I losing something if I don't use the "typical" oop > constructs found in other languages (Java, C# come to mi

Re: Reversing a dict?

2008-05-06 Thread Ian Kelly
On Tue, May 6, 2008 at 9:26 AM, Jeremy Sanders <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Hi - further to my earlier query regarding partial matches (which with > > all your replies enabled me to advance my understanding, thanks), I > > now need to reverse a dict. > > There is

Re: sed to python: replace Q

2008-05-06 Thread Diez B. Roggisch
> Ah ha, thar's the disconnect. Thanks for all the pointers, my def is > now working. Still don't understand the logic behind this design though. > I mean why would any programming language have separate search or find > functions, one for regex and and another for non-regex based pattern > match

Re: Decimal vs Float comparasion

2008-05-06 Thread Rhamphoryncus
On May 6, 1:31 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 6 May 2008 11:52:10 +0800, "Yuan HOng" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > It seems to me that rather than allowing this to happen, comparasion > > between the two should either be mad

Re: select.poll() and WSAPoll

2008-05-06 Thread Giles Brown
On 6 May, 14:18, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 6 May 2008 08:36:28 -0400, inhahe <[EMAIL PROTECTED]> wrote: > >select.poll isn't supported on Windows, because Windows doesn't have such a > >feature, or at least it didn't until Vista. Vista implements the same thing > >bu

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: [...] > Python is built to be easy to read, And also very easy to *write*. I rarely hear this, but it is the main reason why I like Python so much. I can't really explain why though. [...] (cokofreedom, I found your explanation of the virtues of Python was excellent!)

Re: STL multimap

2008-05-06 Thread Arnaud Delobelle
Aaron Watters <[EMAIL PROTECTED]> writes: > I'm having trouble following your discussion > and I suspect you might be a friend of Mark V Cheney. > But I will focus on this one point. > > On May 5, 11:14 pm, [EMAIL PROTECTED] wrote: >> If recursive generators are really useless (erect wall might no

Re: Reversing a dict?

2008-05-06 Thread krumblebunk
Thanks all!! kb. -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Arnaud Delobelle
jmDesktop <[EMAIL PROTECTED]> writes: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Is my schooling for nought on these OOP concepts if I > use Python. Am I losing something if I don't use the "typical" oop > constructs found in other languages (Java, C# co

Re: Reversing a dict?

2008-05-06 Thread Jeremy Sanders
[EMAIL PROTECTED] wrote: > Hi - further to my earlier query regarding partial matches (which with > all your replies enabled me to advance my understanding, thanks), I > now need to reverse a dict. There is no guaranteed order to the items stored in a dictionary. They can and will move around as

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-06 Thread Ethan Furman
Banibrata Dutta wrote: On 5/6/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and other unixy OSes. We have python installed in a number of different places: /bin/python /usr/local/bin/python /usr/bin/python /opt/freeware/Pyth

Re: Reversing a dict?

2008-05-06 Thread cokofreedom
On May 6, 5:20 pm, [EMAIL PROTECTED] wrote: > Hi - further to my earlier query regarding partial matches (which with > all your replies enabled me to advance my understanding, thanks), I > now need to reverse a dict. > > I know how to reverse a list (with the reverse method - very handy), > but it

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread cokofreedom
> I would imagine this is why I haven't found any schools teaching > Python in their basic programming classes too. On the dynamic typing, > isn't that the same sort of thing that lots of scripting languages > do? VBScript doesn't require you to define your variables, but I > don't really want to

Reversing a dict?

2008-05-06 Thread krumblebunk
Hi - further to my earlier query regarding partial matches (which with all your replies enabled me to advance my understanding, thanks), I now need to reverse a dict. I know how to reverse a list (with the reverse method - very handy), but it doesn't seem possible to reverse a dict. I suspect wha

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-06 Thread Wojciech Walczak
2008/5/6, Ben Finney <[EMAIL PROTECTED]>: > > > So why not put symlink to Python over there on all machines, if > > > we can put one (or env itself) there ? > > To avoid linking all the rest of interpreters like perl, ruby, lua > > and dozens of others. > The argument was being made from "thou

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread jmDesktop
On May 6, 10:26 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > > > Studying OOP and noticed that Python does not have Interfaces.  Is > > that correct?  Is my schooling for nought on these OOP concepts if I > > Depends on your definition of 'Pyt

Re: sed to python: replace Q

2008-05-06 Thread Mel
Raymond wrote: > My other gripe is with the kludgy object-oriented regex functions. > Couldn't these be better implemented in-line? Why should I, as a coder, > have to 're.compile()' when all the reference languages do this at compile > time, from a much more straightforward and easy to read in-l

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Jim Washington
jmDesktop wrote: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Is my schooling for nought on these OOP concepts if I > use Python. Am I losing something if I don't use the "typical" oop > constructs found in other languages (Java, C# come to mind.) I'm > af

Re: STL multimap

2008-05-06 Thread Aaron Watters
I'm having trouble following your discussion and I suspect you might be a friend of Mark V Cheney. But I will focus on this one point. On May 5, 11:14 pm, [EMAIL PROTECTED] wrote: > If recursive generators are really useless (erect wall might not be), I would like to have recursive generators --

Re: How do you debug memory usage?

2008-05-06 Thread David
> > I'll check a few of those results and post to the list if I find something > good. > It looks like Heapy, part of the Guppy project can do this: http://guppy-pe.sourceforge.net/#Heapy David. David. -- http://mail.python.org/mailman/listinfo/python-list

Re: sed to python: replace Q

2008-05-06 Thread Marco Mariani
Raymond wrote: Aren't sed, awk, grep, and perl the reference implementations of search and replace? I don't know about "reference implementations", but I daresay they are a mess w.r.t. usability. -- http://mail.python.org/mailman/listinfo/python-list

Re: parameters to lambda's executed at run time.

2008-05-06 Thread castironpi
On May 6, 5:17 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > wyleu wrote: > > I'm trying to supply parameters to a function that is called at a > > later time as in the code below: > > > llist = [] > > > for item in range(5): > >     llist.append(lambda: func(item)) > > > def func(item): > >

Re: sed to python: replace Q

2008-05-06 Thread Raymond
>Another approach is to use the split() function in "re" module. Ah ha, thar's the disconnect. Thanks for all the pointers, my def is now working. Still don't understand the logic behind this design though. I mean why would any programming language have separate search or find functions, one for

Re: Another MIDI question - soundfonts

2008-05-06 Thread Laszlo Nagy
Chuckk Hubbard wrote: Hello. I'm writing a microtonal sequencer, and I don't want to use MIDI per se, but I'd like to be able to load standard sample banks to play. The only standard format I'm familiar with is soundfont, and it seems to be the most popular; if anyone knows of others, especially

Cygwin and path issues

2008-05-06 Thread Berlin Brown
I am trying to run some basic unit tests, but I can't get the paths setup in python/cygwin to pick up my modules. This code works fine in linux and I installed python through cygwin not as part of the win32 install. DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) PROJECT_

Re: How do you debug memory usage?

2008-05-06 Thread David
On Tue, May 6, 2008 at 4:21 PM, Banibrata Dutta <[EMAIL PROTECTED]> wrote: > Many not be the most intuitive and elegant solution (I'm just a Python > newbie), but if your Python code is constrained to the usage of Python 2.2 > language features, you could use Jython, and then (I'm hoping, since I'v

Re: How to generate binary python?

2008-05-06 Thread BlueBird
On May 6, 6:29 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 19:43:24 -0300, David Anderson <[EMAIL PROTECTED]> > escribió: > > > Hi, i'm comingo from Java and I'm wanting to know what in Python is the > > equivalent to the file.class in java, I am producing some apps tha

Re: how to use subprocess.Popen execute "find" in windows

2008-05-06 Thread BlueBird
On May 6, 11:19 am, [EMAIL PROTECTED] wrote: > In cmd, I can use find like this. > > C:\>netstat -an | find "445" > TCP0.0.0.0:4450.0.0.0:0 LISTENING > UDP0.0.0.0:445*:* > > C:\> > > And os.system is OK.>>> import os > >>> os.system('netstat -an | fi

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Is my schooling for nought on these OOP concepts if I Depends on your definition of 'Python does not have Interfaces'. They are not in the official language, bu

Re: Are rank noobs tolerated, here?

2008-05-06 Thread Jeffrey Froman
notbob wrote: > I'm running > vers 2.5.1 on slackware 12. Nice to see another Slackware user around here! > "Here is an example of a user-defined function that has a parameter: > > > def print_twice(bruce): > print bruce, bruce > is this just an example of how the def should be written a

Re: How do you debug memory usage?

2008-05-06 Thread Banibrata Dutta
Many not be the most intuitive and elegant solution (I'm just a Python newbie), but if your Python code is constrained to the usage of Python 2.2 language features, you could use Jython, and then (I'm hoping, since I've not tried this myself), use the Java Memory usage profiling/debugging tools. W

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread hdante
On May 6, 10:44 am, jmDesktop <[EMAIL PROTECTED]> wrote: > Studying OOP and noticed that Python does not have Interfaces.  Is > that correct?  Is my schooling for nought on these OOP concepts if I > use Python.  Am I losing something if I don't use the "typical" oop > constructs found in other lang

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Diez B. Roggisch
jmDesktop wrote: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Yes. > Is my schooling for nought on these OOP concepts if I > use Python. Am I losing something if I don't use the "typical" oop > constructs found in other languages (Java, C# come to mind.

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Mike Driscoll
On May 6, 8:44 am, jmDesktop <[EMAIL PROTECTED]> wrote: > Studying OOP and noticed that Python does not have Interfaces.  Is > that correct?  Is my schooling for nought on these OOP concepts if I > use Python.  Am I losing something if I don't use the "typical" oop > constructs found in other langu

Re: Module to read input from commandline

2008-05-06 Thread python
Hi James, > What I was looking for was a commandline read loop that executes within a > script that is already running ... or can optparse be used in this context as well? Apologies. I missed the nuance of the read loop within an already running script. Malcolm -- http://mail.python.org/mailman

  1   2   >