Sphinx 0.3 released

2008-05-06 Thread Georg Brandl
I'm pleased to announce the next minor version of Sphinx, the Python documentation generation tool. What is it? === Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of multiple reStructuredText

OSDC 2008 Sydney (1-5 Dec 2008) - Call for Papers

2008-05-06 Thread Mark Rees
Call for Papers Open Source Developers' Conference 2008 1st - 5th December 2008, Sydney, Australia The Open Source Developers' Conference 2008 is a conference run by open source developers, for developers and business people. It covers numerous programming languages across a range of operating

ChiPy May Meeting

2008-05-06 Thread bray
Chicago Python User Group = Come join us for our best meeting ever! When Thursday, May 8th, ~7pm Topics -- * The Screen craping console, Cycloctopus (Feighong Hsu) * Demonstration on using the built-in Unit Testing Django Apps (Brian Ray) * How to get

Pygments 0.10 Malzeug released

2008-05-06 Thread Georg Brandl
I've just uploaded the Pygments 0.10 packages to CheeseShop. Pygments is a generic syntax highlighter written in Python. Download it from http://pypi.python.org/pypi/Pygments, or look at the demonstration at http://pygments.org/demo. Highlights in this release are: - Lexers added: * Io *

Re: config files in python

2008-05-06 Thread sandipm
Thanks for various useful suggestions. actually right now I am using conf files only in psp handler of mod_python/apache but I have other processes which might use same config files. One way is I can put conf related data directly in database and database handling module can directly pickup

Re: word shifts

2008-05-06 Thread Arnaud Delobelle
George Sakkis [EMAIL PROTECTED] writes: On May 5, 11:02 pm, dave [EMAIL PROTECTED] wrote: On 2008-05-04 01:10:40 -0600, Arnaud Delobelle [EMAIL PROTECTED] said: dave [EMAIL PROTECTED] writes: Hello, I made a function that takes a word list (one word per line, text file) and

Re: USB HID documentation?

2008-05-06 Thread Tim Roberts
Diez B. Roggisch [EMAIL PROTECTED] wrote: You seem to misunderstand HID. HID is a protocol over USB (and Bluetooth I believe) that will create user input device events which are mapped to your OS input layer. That means that whenever you e.g. attach a keyboard device, it's keyboard events will

Re: Decimal vs Float comparasion

2008-05-06 Thread Wojciech Walczak
2008/5/6, Yuan HOng [EMAIL PROTECTED]: It seems decimal object will always be larger than float in comparasion, which goes against common sense: from decimal import Decimal a = Decimal('0.5') a 9 False a 9.0 True It seems to me that rather than allowing this to

Re: How can we write a class factory that dynamically redefines the __init__ function etc.

2008-05-06 Thread s0suk3
On May 6, 12:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: (the convention is to use lowercase names for attributes: rawdata instead of RawData) But at least put an underscore between the words (raw_data), or, if you like the OO world, make the subsequent words capitalized (rawData). --

Re: config files in python

2008-05-06 Thread Jorge Vargas
On Tue, May 6, 2008 at 2:00 AM, sandipm [EMAIL PROTECTED] wrote: here I would like to have python file which read conf from text file and load those params in current process space. so only importing that python file should read up the conf file and load the current process with

Re: Decimal vs Float comparasion

2008-05-06 Thread Wojciech Walczak
2008/5/6, Wojciech Walczak [EMAIL PROTECTED]: a 9.0 returns True because NotImplemented 9.0 returns True. a 9.0 returns False because NotImplemented 9.0 returns False. Sorry, it should rather be: Decimal('0.5') 9.0 returns True because: Decimal('0.5') NotImplemented

Re: How can we write a class factory that dynamically redefines the __init__ function etc.

2008-05-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On May 6, 12:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: (the convention is to use lowercase names for attributes: rawdata instead of RawData) But at least put an underscore between the words (raw_data), or, if you like the OO world, make the subsequent

Confusion regarding the readline module

2008-05-06 Thread Siddhant
Hi! I am having some doubts related to the readline module. I hope someone could clear them. 1. What exactly does the readline.get_line_buffer() function do? Does it return whatever is the current input by the user? If yes, then can I use it to check the current inputs of the user and base the

Re: Bad form to access a *private variable* like _foo?

2008-05-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bad form to access a *private variable* like _foo? In this case, this would be spelled protected - or even better implementation. And the contract is: nothing prevent you to access implementation attributes, but then you're on your own if anything breaks. The

Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the like, just foo). I

Re: Browser + local Python-based web server vs. wxPython

2008-05-06 Thread Bruno Desthuilliers
Mike Driscoll a écrit : (snip) The most popular Python web frameworks seem to be TurboGears, Django, Pylons, CherryPy and mod_python. I wouldn't call mod_python a web framework. It's a library that exposes (most of) Apache's request handling process to Python, and is mostly used as a

read line

2008-05-06 Thread moustafa . elmihy
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 separate variable .. any

Re: use php in python httpservers

2008-05-06 Thread artasis
On May 5, 3:48 pm, Jeff [EMAIL PROTECTED] wrote: ctypes? hm..may you explain it? -- http://mail.python.org/mailman/listinfo/python-list

Python MIDI in 2008

2008-05-06 Thread Maciej Bliziński
For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. Some packages don't seem to be really used, for instance portmidi doesn't even

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

2008-05-06 Thread Bruno Desthuilliers
Nick Craig-Wood a écrit : Banibrata Dutta [EMAIL PROTECTED] wrote: I've gone through the list of language differences between 2.3 / 2.4 2.5 of CPython. I've spend around 2 weeks now, learning v2.5 of CPython, and I consider myself still very very newbie. So, unable to take a call as to

Re: listing computer hard drives with python

2008-05-06 Thread Tim Golden
Ohad Frand wrote: I am looking for a way to get a list of all active logical hard drives of the computer ([c:,d:..]) You can do this with WMI [*] under Windows: code import wmi c = wmi.WMI () for i in c.Win32_LogicalDisk (): print i.Caption /code If you want only fixed disks (ie exluding

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

2008-05-06 Thread Banibrata Dutta
On 5/6/08, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Nick Craig-Wood a écrit : Banibrata Dutta [EMAIL PROTECTED] wrote: I've gone through the list of language differences between 2.3 / 2.4 2.5 of CPython. I've spend around 2 weeks now, learning v2.5 of CPython, and I consider

Re: psycopg2 ReferenceManual

2008-05-06 Thread M.-A. Lemburg
On 2008-04-30 16:52, David Anderson wrote: Hi all, where can I find the reference manual from the psycopg2 or the dbapi2.0 because in their official pages I could'nt find The Python DB-API 2.0 is defined in the PEP 249: http://www.python.org/dev/peps/pep-0249/ -- Marc-Andre Lemburg

Re: config files in python

2008-05-06 Thread M.-A. Lemburg
On 2008-05-06 01:16, Matimus wrote: On May 4, 11:35 pm, sandipm [EMAIL PROTECTED] wrote: Hi, In my application, I have some configurable information which is used by different processes. currently I have stored configration in a conf.py file as name=value pairs, and I am importing conf.py file

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

2008-05-06 Thread cokofreedom
2.5 seems the defacto standard now for a new user, NB: probably not the standard for the common business productions. However are you on Windows or *nix? *nix may ship a certain version, so for ease of use it would be best to use that. Personally I use 2.5 because it is a complete version, and

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

2008-05-06 Thread Banibrata Dutta
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

Re: Python MIDI in 2008

2008-05-06 Thread alex23
On May 6, 6:01 pm, Maciej Bliziński [EMAIL PROTECTED] wrote: Is there any other package that allows sending MIDI events in real time? Did anyone recently got any of the above packages to work? There's MidiKinesis (http://www.sci.ccny.cuny.edu/~brinkman/software/ midikinesis/) which allows for

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

2008-05-06 Thread David
Hi Vlasta. I had a look at your original mail. I think your simpler (than XML) format is a good idea for now. At a later stage you could change it to something like this: CUSTOM_TAG KC=12 KNJ=13 VCC=0...etctext goes here, some more text/CUSTOM_TAG CUSTOM_TAG KC=13 KNJ=14 VCC=1...etctext goes

Re: config files in python

2008-05-06 Thread Jorge Vargas
On Tue, May 6, 2008 at 4:33 AM, M.-A. Lemburg [EMAIL PROTECTED] wrote: On 2008-05-06 01:16, Matimus wrote: On May 4, 11:35 pm, sandipm [EMAIL PROTECTED] wrote: Hi, In my application, I have some configurable information which is used by different processes. currently I have stored

Re: read line

2008-05-06 Thread Diez B. Roggisch
[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

Re: Decimal vs Float comparasion

2008-05-06 Thread Marco Mariani
Gasto wrote: I still don't see why such a module exists. There are 2.0 types of programmers: those who always use floating point, and those who know how to use them. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal vs Float comparasion

2008-05-06 Thread Erik Max Francis
Dennis Lee Bieber 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 made correct (by convertion decimal to float e.g.) or

how to use subprocess.Popen execute find in windows

2008-05-06 Thread clyfish
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 | find 445') TCP0.0.0.0:4450.0.0.0:0

Re: config files in python

2008-05-06 Thread M.-A. Lemburg
On 2008-05-06 11:07, Jorge Vargas wrote: On Tue, May 6, 2008 at 4:33 AM, M.-A. Lemburg [EMAIL PROTECTED] wrote: On 2008-05-06 01:16, Matimus wrote: On May 4, 11:35 pm, sandipm [EMAIL PROTECTED] wrote: Hi, In my application, I have some configurable information which is used by different

parameters to lambda's executed at run time.

2008-05-06 Thread wyleu
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): print item for thing in llist: thing() which produces the result IDLE 1.2.1

Re: Python MIDI in 2008

2008-05-06 Thread Max M
Maciej Blizin'ski skrev: For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. existing or very old software packages -

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

2008-05-06 Thread Diez B. Roggisch
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): print item for thing in llist: thing() which produces the result

Re: Confusion regarding the readline module

2008-05-06 Thread Diez B. Roggisch
Siddhant wrote: Hi! I am having some doubts related to the readline module. I hope someone could clear them. 1. What exactly does the readline.get_line_buffer() function do? Does it return whatever is the current input by the user? If yes, then can I use it to check the current inputs of

Re: Bad form to access a *private variable* like _foo?

2008-05-06 Thread Diez B. Roggisch
The way you wrote it here, yes. If there's no official way to do the same operation and you have a real use case for it - in which case you may want to add a commit() method to SQLObject's model base class and submit the patch to SQLObject's maintainer. But I strongly suspect there's a better

Re: computing with characters

2008-05-06 Thread Boris Borcic
Duncan Booth wrote: Torsten Bronger [EMAIL PROTECTED] wrote: The biggest ugliness though is ,.join(). No idea why this should be better than join(list, separator= ). Besides, ,.join(ux) yields an unicode object. This is confusing (but will probably go away with Python 3). It is only ugly

Cannot install Pypvm (Python Parallel Virtual Machine)

2008-05-06 Thread spectrumdt
Hello. I am trying to install Pypvm (http://pypvm.sourceforge.net/), the Python interface to PVM (Parallel Virtual Machine). Unfortunately, installation fails. I am hoping someone can help me fix it. I am running Fedora Core 8 Linux. The official Pypvm documentation is very helpful (or

Re: Cannot install Pypvm (Python Parallel Virtual Machine)

2008-05-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hello. I am trying to install Pypvm (http://pypvm.sourceforge.net/), the Python interface to PVM (Parallel Virtual Machine). Unfortunately, installation fails. I am hoping someone can help me fix it. I am running Fedora Core 8 Linux. The official Pypvm

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

2008-05-06 Thread Boris Borcic
One way : from functools import partial def func(item) : print item llist = [partial(func,item) for item in range(5)] for thing in llist : thing() 0 1 2 3 4 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

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

2008-05-06 Thread Wojciech Walczak
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 machines, if we can put one (or env itself) there ? To avoid linking all the rest of interpreters like perl, ruby, lua and

Re: use php in python httpservers

2008-05-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hi, that is my task: I need to create python webserver-like extension(dll) which will run php and python scripts as plugins. I have no problems with dll creating and run python scripts, but I cannot understand how to run php(CLI is not a solution). Is there a way to

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

2008-05-06 Thread Ben Finney
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 machines, if we can put one (or env itself) there ? To avoid linking all

Re: Python MIDI in 2008

2008-05-06 Thread Brett g Porter
Maciej Bliziński wrote: For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. Some packages don't seem to be really used, for instance

Re: Are rank noobs tolerated, here?

2008-05-06 Thread alex23
On May 6, 4:43 am, 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 ok, I try and follow the above, but where is he getting the script? So, I make a script called chap03.py and put

Re: computing with characters

2008-05-06 Thread cokofreedom
On May 6, 12:22 pm, Boris Borcic [EMAIL PROTECTED] wrote: Duncan Booth wrote: Torsten Bronger [EMAIL PROTECTED] wrote: The biggest ugliness though is ,.join(). No idea why this should be better than join(list, separator= ). Besides, ,.join(ux) yields an unicode object. This is

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

2008-05-06 Thread Diez B. Roggisch
[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 | find 445') TCP0.0.0.0:445

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: In a spirit of teaching people to fish... ... If you put something like Python windows registry into Google, you get quite a few hits, the top one of which is probably pointing to the stdlib _winreg module, but several others point towards wrapper classes, modules etc.

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

2008-05-06 Thread Marco Mariani
Boris Borcic wrote: One way : from functools import partial def func(item) : print item llist = [partial(func,item) for item in range(5)] for thing in llist : thing() 0 1 2 3 4 Another way: class Func(object): def __init__(self, item): self.item = item def

Comparing strings - akin to Perl's =~

2008-05-06 Thread krumblebunk
Hello gurus, I am learning Python to take the place of Perl in my toolbox of bits and bobs, and writing something pretty simple in theory, but having a hard time in Python with it - I am using a 3rd party module, and I am sure the etiquette of this channel states that this is pure Python

Another MIDI question - soundfonts

2008-05-06 Thread Chuckk Hubbard
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 for Mac, which I

select.poll() and WSAPoll

2008-05-06 Thread inhahe
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 but called WSAPoll, an article is here http://blogs.msdn.com/wndp/archive/2006/10/26/WSAPoll.aspx I hope that the next edition of Python

Re: Module to read input from commandline

2008-05-06 Thread james
On Apr 13, 9:05 pm, [EMAIL PROTECTED] wrote: On Apr 13, 7:44 pm, [EMAIL PROTECTED] wrote: What you're looking for is no module, it is included in the standard python namespace. snip raw_input Thanks for the response GL. What I am looking for is a module to wrap raw_input so it can

Re: get the pid of a process with pexpect

2008-05-06 Thread Karim Bernardet
Many thanks ! This is what I did for mytunnel.py : I use pexpect like this tunnel_command = '''bash -c ssh -N -R 60011:localhost:60002 [EMAIL PROTECTED] ''' com=echo \+str(ssh_tunnel.pid)+\ pids ... time.sleep(172800) in the bash script which calls mytunnel.py : ./mytunnel.py ${USERN}

Re: Comparing strings - akin to Perl's =~

2008-05-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hello gurus, I am learning Python to take the place of Perl in my toolbox of bits and bobs, and writing something pretty simple in theory, but having a hard time in Python with it - I am using a 3rd party module, and I am sure the etiquette of this channel states

Re: select.poll() and WSAPoll

2008-05-06 Thread Christian Heimes
inhahe schrieb: 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 but called WSAPoll, an article is here http://blogs.msdn.com/wndp/archive/2006/10/26/WSAPoll.aspx I hope that the next

Re: Module to read input from commandline

2008-05-06 Thread python
James, Check out the optparse module as well. The optparse module supercedes(?) the cmd module and offers a lot more functionality. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: select.poll() and WSAPoll

2008-05-06 Thread Jean-Paul Calderone
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 but called WSAPoll, an article is here

Re: os.open and O_EXCL

2008-05-06 Thread Micah Elliott
On 2008-05-01 Ethan Furman wrote: I am trying to lock a file so no other process can get read nor write access to it. This looks promising: http://pypi.python.org/pypi/lockfile/0.2 -- Micah Elliott | [EMAIL PROTECTED] | http://MicahElliott.blogspot.com signature.asc Description:

Re: Comparing strings - akin to Perl's =~

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello gurus, Hello fellow-guru, I am grabbing the output from a SQL statement (using PyGreSQL 'pg' module), and when it returns the result, I am pulling it out as such: try: sc=pg.connect(dbname='mydb',host='dbhost',user='ppp')

Re: Comparing strings - akin to Perl's =~

2008-05-06 Thread Carsten Haese
[EMAIL PROTECTED] wrote: for foo in sc.query(sql).dictresult(): - this returns a dict of the result f=dict(foo) for k in f.iteritems() if k == '^Hostname': -- need this sort of behaviour - match a partial string. print %s % f[3] -- ..and if

How do you debug memory usage?

2008-05-06 Thread David
Hi list. I've tried Googling for this and I checked the Python docs, but to no avail. What is the best way to debug memory usage in a Python script? I'd like to see what objects are using the most memory. Ideally this would be aware of references too. So if I have a small list that contains

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: So basically I am looking for these things: 1) Read one subkey from HKEY_LOCAL_MACHINE at a time (I think QueryValueEx() is needed here) 2) Check if said subkey contains some predetermined string (like 'foo' here) 3) If the above applies, change the value into another

Re: Module to read input from commandline

2008-05-06 Thread james
On May 6, 2:11 pm, [EMAIL PROTECTED] wrote: Check out the optparse module as well. The optparse module supercedes(?) the cmd module and offers a lot more functionality. Hi Malcom, Doesn't the optparse module work by parsing the arguments that are passed to the script when it is invoked? What

Python Wins Favorite Scripting Language Award

2008-05-06 Thread Steve Holden
The Linux Journal readers apparently suffer the same ambiguity as the rest of us when it comes to defining what the difference between a scripting language and a programming language. They do, however, clearly like Python, which they voted their scripting language of 2008. PHP, Bash and Perl

Re: select.poll() and WSAPoll

2008-05-06 Thread inhahe
I don't think we can officially support WPAPoll since Python 2.6 is suppose to run on Windows 2000 and XP, too. Christian Oh, yeah, I was wondering about that, since there aren't separate distributions of Python for Vista vs. XP etc. But I wonder if Python could just give an attribute

Re: Comparing strings - akin to Perl's =~

2008-05-06 Thread krumblebunk
On May 6, 2:23 pm, A.T.Hofkamp [EMAIL PROTECTED] wrote: Without a explicit Python value of what comes out of the sql query, I can only guess. As example, assume the following data: f = { 1: ['Hostname', 'blabla', 'person', 'john'], 2: ['MachineName', 'blabla', 'company',

Am I missing something with Python not having interfaces?

2008-05-06 Thread jmDesktop
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 that if I never use

Re: Module to read input from commandline

2008-05-06 Thread Banibrata Dutta
something like curses but w/o the fancy window decorations perhaps ? if so, then following link might help ( http://www.amk.ca/python/howto/curses/). thanks regards, banibrata On Tue, May 6, 2008 at 6:56 PM, [EMAIL PROTECTED] wrote: On May 6, 2:11 pm, [EMAIL PROTECTED] wrote: Check out the

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

2008-05-06 Thread Benjamin Kaplan
On Tue, May 6, 2008 at 9: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

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 --

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 languages

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.) I'm

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 languages

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.

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 snip is this just an example of how the def should be written and

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, but

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 | find 445') TCP

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 that ar not

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've

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__)))

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,

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: 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):     print item for

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: 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: 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: 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 afraid

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-line

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 'Python does not

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 thousands of

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

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 use

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: #!/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

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

  1   2   3   >