Re: Numeric literal syntax

2008-09-02 Thread Steven D'Aprano
On Mon, 01 Sep 2008 22:11:13 -0700, Dennis Lee Bieber wrote: > On Tue, 02 Sep 2008 13:51:16 +1000, Ben Finney > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> This is no more the case than for literal strings: >> >> a = "spam" "eggs" "ham" >> >> a = "spam", "eggs", "ham

Changing the (codec) error handler for the stdout/stderr streams in Python 3.0

2008-09-02 Thread Jukka Aho
Just a tip for those who are only just cutting their teeth on Python 3.0 and might have encountered the same problem as I did: When a Python (3.x) program is run on a terminal that only supports a legacy character encoding - such as Latin 1 or Codepage 437 - all characters printed to stdout wi

Re: Enhanced property decorator

2008-09-02 Thread Gabriel Genellina
En Mon, 25 Aug 2008 22:45:36 -0300, Daniel <[EMAIL PROTECTED]> escribió: > I've often been frustrated by the inability of the built-in property > descriptor to handle anything other than a read-only property when > used as a decorator. Furthermore, read/write/delete properties take > their doc-str

python 3k, when will it be mainstream?

2008-09-02 Thread Almar Klein
Hi, I read that python 3k is now in its final beta version. I was wondering when we can expect the major packages to make a 3.0 branch. I am myself quite new to python, and would like to make the transition as soon as possible, simply because it would save me porting code later, and I can focus o

Re: (in memory) database

2008-09-02 Thread Paul Boddie
On 2 Sep, 04:46, Zentrader <[EMAIL PROTECTED]> wrote: > On Ubuntu you want to install something like python-sqlite (a search > for "python" should turn up everything).  There are 2 parts to this, > SQLite and the python bindings to SQLite.  So you seem to have SQLite > installed but not the Python

Re: How to print first(national) char from unicode string encoded inutf-8?

2008-09-02 Thread sniipe
On 2 Wrz, 06:05, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "Marco Bizzarri" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > On Mon, Sep 1, 2008 at 3:25 PM, <[EMAIL PROTECTED]> wrote: > > >> When I do ${urllib.unquote(c.user.firstName)} without encoding to > >> latin-1 I

Re: How to print first(national) char from unicode string encoded inutf-8?

2008-09-02 Thread sniipe
On 2 Wrz, 10:17, [EMAIL PROTECTED] wrote: > On 2 Wrz, 06:05, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > > > > > "Marco Bizzarri" <[EMAIL PROTECTED]> wrote in message > > >news:[EMAIL PROTECTED] > > > > On Mon, Sep 1, 2008 at 3:25 PM, <[EMAIL PROTECTED]> wrote: > > > >> When I do ${urllib.unquote(

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Gabriel Genellina
En Mon, 01 Sep 2008 04:23:38 -0300, Jeremy Banks <[EMAIL PROTECTED]> escribió: > Hi. I wondered if anyone knew the rationale behind the naming of the > Popen class in the subprocess module. Popen sounds like the a suitable > name for a function that created a subprocess, but the object itself is >

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Gabriel Genellina
En Mon, 01 Sep 2008 04:23:38 -0300, Jeremy Banks <[EMAIL PROTECTED]> escribió: > Hi. I wondered if anyone knew the rationale behind the naming of the > Popen class in the subprocess module. Popen sounds like the a suitable > name for a function that created a subprocess, but the object itself is >

Re: python mechanize/libxml2dom question

2008-09-02 Thread Paul Boddie
On 2 Sep, 05:35, "bruce" <[EMAIL PROTECTED]> wrote: > > i've got the following situation, with the following test url: > "http://schedule.psu.edu/soc/fall/Alloz/a-c/acctg.html#";. > > i can generate a list of the tables i want for the courses on the page. > however, when i try to create the xpath q

python glibc error

2008-09-02 Thread anand nalya
I'm getting the following errors while trying to run a python script: *** glibc detected *** python: free(): invalid next size (normal): 0x0d2da210 *** *** glibc detected *** python: malloc(): memory corruption: 0x1b81da60 *** Is this a bug in my script or python or gllbc? Relev

Re: Relative imports and "import X as Y"

2008-09-02 Thread Gabriel Genellina
En Sun, 31 Aug 2008 07:27:12 -0300, Wojtek Walczak <[EMAIL PROTECTED]> escribió: > On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote: > >>> Download the latest beta for your system and give it a try. >> >> Thanks for the advice, but I'd really rather not deal with >> installing the e

Re: The Importance of Terminology's Quality

2008-09-02 Thread RedGrittyBrick
George Neuner wrote: On Mon, 1 Sep 2008 21:03:44 + (UTC), Martin Gregorie <[EMAIL PROTECTED]> wrote: On Mon, 01 Sep 2008 12:04:05 -0700, Robert Maas, http://tinyurl.com/uh3t wrote: From: George Neuner <[EMAIL PROTECTED]> A friend of mine had an early 8080 micros that was programmed throu

Re: Python 3.0b2 cannot map '\u12b'

2008-09-02 Thread Jukka Aho
Terry Reedy wrote: If the terminal expects cp437 then displaying utf-8 might give some problems. My screen displays whatever Windows tells the graphics card to tell the screen to display. In OpenOffice, I can select a unicode font that displays at least everything in the BasicMultilingualPla

Re: The Importance of Terminology's Quality

2008-09-02 Thread Martin Gregorie
On Mon, 01 Sep 2008 20:48:23 -0400, George Neuner wrote: > I don't know the correct term, but what I was talking about was a tiny > switch with a 1/2 inch metal handle that looks like a longish grain of > rice. We used to call them "knife" switches because after hours > flipping them they would f

Re: Numeric literal syntax (was: Py 2.6 changes)

2008-09-02 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Ben Finney: > > I don't see any good reason (other than your familiarity with the D > > language) to use underscores for this purpose, and much more reason > > (readability, consistency, fewer arbitrary differences in syntax, > > perhaps simpler imple

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Nicola Musatti
On Sep 1, 9:23 am, Jeremy Banks <[EMAIL PROTECTED]> wrote: > Hi. I wondered if anyone knew the rationale behind the naming of the > Popen class in the subprocess module. Popen sounds like the a suitable > name for a function that created a subprocess, but the object itself is > a subprocess, not a

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 05:02:07 -0700, Nicola Musatti wrote: > On Sep 1, 9:23 am, Jeremy Banks <[EMAIL PROTECTED]> wrote: >> Hi. I wondered if anyone knew the rationale behind the naming of the >> Popen class in the subprocess module. Popen sounds like the a suitable >> name for a function that creat

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-02 Thread Guilherme Polo
On Tue, Sep 2, 2008 at 12:44 AM, akineko <[EMAIL PROTECTED]> wrote: > On Sep 1, 8:28 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> Can you clarify what is this "sticky" behavior ? Are you referring to >> a toggle button ? If yes, then you might be after a simple >> Checkbutton: >> >> checkbutt

about downloading the selected information

2008-09-02 Thread woaibeiyang
I have a problem to download the information from url http://www.ncbi.nlm.nih.gov/sites/entrez. Because it is impossible for me to add searching material to the url to construct a new url and then visit the website. I have the searching material, however I could not find the way to deal with th

Algorithm used by difflib.get_close_match

2008-09-02 Thread Guillermo
Hi all, Does anyone know whether this function uses edit distance? If not, which algorithm is it using? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

what's the difference between f(a) and f(*a)

2008-09-02 Thread qxyuestc
def sum1(*a): return(sum(i*i for i in a)) def sum2(a): return(sum(i*i for i in a)) a=[1,2,3] print(sum1(*a), sum2(a)) showed above: the result from sum1() and sum2() is the same. So, what is the difference between f(a) and f(*a) -- http://mail.python.org/mailma

How do I adjust the font size on IDLE when running on Mac OS 10.5.4? TIA.

2008-09-02 Thread Malcolm Lewis
-- http://mail.python.org/mailman/listinfo/python-list

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Derek Martin
On Tue, Sep 02, 2008 at 12:27:49PM +, Marc 'BlackJack' Rintsch wrote: > > The Python class is a generalization of the standard Posix function of > > (almost) the same name: > > http://opengroup.org/onlinepubs/007908775/xsh/popen.html > > So it's a name of a *function* and it's a little bit uns

Re: Algorithm used by difflib.get_close_match

2008-09-02 Thread Jon Clements
On Sep 2, 2:17 pm, Guillermo <[EMAIL PROTECTED]> wrote: > Hi all, > > Does anyone know whether this function uses edit distance? If not, > which algorithm is it using? > > Regards, > > Guillermo help(difflib.get_close_matches) will give you your first clue... -- http://mail.python.org/mailman/list

What is module initialization?

2008-09-02 Thread dudeja . rajat
Hi, I found on the net that there is something called module initialization. Unfortunately, there is not much information for this. However, small the information I found module initialization can be of use to me in my project. I'm currently messing with a problem where I'm keeping my global vari

Re: Algorithm used by difflib.get_close_match

2008-09-02 Thread Wojtek Walczak
On Tue, 2 Sep 2008 06:17:37 -0700 (PDT), Guillermo wrote: > Does anyone know whether this function uses edit distance? If not, > which algorithm is it using? The following passage comes from difflib.py: SequenceMatcher is a flexible class for comparing pairs of sequences of any type, so long as

Re: What is module initialization?

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 14:32:30 +0100, dudeja.rajat wrote: > I found on the net that there is something called module initialization. > Unfortunately, there is not much information for this. However, small > the information I found module initialization can be of use to me in my > project. "Module i

Re: what's the difference between f(a) and f(*a)

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 06:24:21 -0700, qxyuestc wrote: > showed above: the result from sum1() and sum2() is the same. So, what is > the difference between f(a) and f(*a) f(a) -> f([1, 2, 3]) f(*a) -> f(1, 2, 3) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 09:28:42 -0400, Derek Martin wrote: > On Tue, Sep 02, 2008 at 12:27:49PM +, Marc 'BlackJack' Rintsch > wrote: >> > The Python class is a generalization of the standard Posix function >> > of (almost) the same name: >> > http://opengroup.org/onlinepubs/007908775/xsh/popen.ht

Re: How can we get to the end of a quote inside a string

2008-09-02 Thread Antoon Pardon
On 2008-08-31, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all, > Suppose I have a string which contains quotes inside quotes - > single and double quotes interchangeably - > s = "a1' b1 " c1' d1 ' c2" b2 'a2" > I need to start at b1 and end at b2 - i.e. I have to parse the > single

Python IDEs with F5 or hotkey shell interaction

2008-09-02 Thread mmm
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a bett

Leo 4.5 final released

2008-09-02 Thread Edward K Ream
Leo 4.5 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.5: -- - Full s

Re: What is module initialization?

2008-09-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hi, I found on the net that there is something called module initialization. The Python C api has a module init function for C-coded modules. There's no need for such a thing in pure Python modules since all the top-level code is executed when the module is loaded

Re: what's the difference between f(a) and f(*a)

2008-09-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : def sum1(*a): return(sum(i*i for i in a)) def sum2(a): return(sum(i*i for i in a)) a=[1,2,3] print(sum1(*a), sum2(a)) showed above: the result from sum1() and sum2() is the same. So, what is the difference between f(a) and f(*a)

Re: SQL package

2008-09-02 Thread Diez B. Roggisch
Juan schrieb: Hi I am trying to write a little a script that can be configurable. This script should access to a database, that can be of any type (MySQL, Postgres, SQLite, MS, etc).It has only to perform 2 or 3 simple plain SQL queries. Hi have tested SQLAlchemy, and it is great, but too much f

Re: What is module initialization?

2008-09-02 Thread dudeja . rajat
> While this is technically legal, you should restrain yourself from doing > such a thing, unless you *really* know what you're doing and why. > >> but the variable is not getting updated in the module >> containing global symbols ( variables). > > I suspect you didn't use a qualified name when imp

Re: Storing Subprocess Results

2008-09-02 Thread Wojtek Walczak
On Tue, 2 Sep 2008 07:16:21 -0700 (PDT), topazcode wrote: > I am using the subprocess module to run some shell commands on a Linux > system: > > import subprocess > output = subprocess.call('''ssh server1 "uptime"''', shell=True) > > The above assigns the output variable with a return code, i.e. 0

Re: Storing Subprocess Results

2008-09-02 Thread Benjamin Kaplan
On Tue, Sep 2, 2008 at 10:16 AM, topazcode <[EMAIL PROTECTED]> wrote: > I am using the subprocess module to run some shell commands on a Linux > system: > > import subprocess > output = subprocess.call('''ssh server1 "uptime"''', shell=True) > > The above assigns the output variable with a return

Re: Using NLTK in Java

2008-09-02 Thread hussainsaiger
On 1 Sep, 16:21, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On 1 Sep, 11:55, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] schrieb: > > >> > I am trying to convert a python module (that contains the use of > >> > NLTK.Corpus) by jythonc. It i

Re: configure kdevelop for python

2008-09-02 Thread John Fabiani
Sindhu wrote: > am a newbie to python language and kdevelop, so i would like to know > how to configure kdevelop for python programming? complete with a > debugger? I have not used python and kdevelop but I do know it requires qt and the link below has several video's of a developer using python

Re: What is module initialization?

2008-09-02 Thread Wojtek Walczak
On Tue, 2 Sep 2008 15:32:07 +0100, [EMAIL PROTECTED] wrote: > But if I do :- >#question.py > from myglobals import * > myglobals.answer = "WTF ?" > > will this work? Why won't you try? In this case you should receive NameError. -- Regards, Wojtek Walczak, http://tosh.pl/gminick/ -- http://mail.

Re: How can we get to the end of a quote inside a string

2008-09-02 Thread Paul McGuire
On Aug 31, 9:29 am, [EMAIL PROTECTED] wrote: > Hi all, >     Suppose I have a string which contains quotes inside quotes - > single and double quotes interchangeably - >  s = "a1' b1 " c1' d1 ' c2" b2 'a2" >      I need to start at b1 and end at b2 - i.e. I have to parse the > single quote strings

dict.update

2008-09-02 Thread Mike P
Hi All, I have two dictionaries e.g dict1 = {123:3,234:5,456:3} dict2 = {123:4,157:2,234:5,456:3,567:2} I want to merge these two dictionaries together so i have a resultant dictionary of: dict3 = {123:[4,3],157:[2,0],234:[5,5],456:[3,3],567:[2,0]} As later on i want to write a csv file that wo

Re: dict.update

2008-09-02 Thread Diez B. Roggisch
Mike P schrieb: Hi All, I have two dictionaries e.g dict1 = {123:3,234:5,456:3} dict2 = {123:4,157:2,234:5,456:3,567:2} I want to merge these two dictionaries together so i have a resultant dictionary of: dict3 = {123:[4,3],157:[2,0],234:[5,5],456:[3,3],567:[2,0]} As later on i want to write

Re: dict.update

2008-09-02 Thread Raymond Hettinger
On Sep 2, 8:04 am, Mike P <[EMAIL PROTECTED]> wrote: > Hi All, > > I have two dictionaries e.g > dict1 = {123:3,234:5,456:3} > dict2 = {123:4,157:2,234:5,456:3,567:2} > > I want to merge these two dictionaries together so i have a resultant > dictionary of: > > dict3 = {123:[4,3],157:[2,0],234:[5,5

Re: Using NLTK in Java

2008-09-02 Thread bearophileHUGS
On Sep 1, 12:30 pm, [EMAIL PROTECTED]: >in Jython (which is assumed to replace Python), I don't think so. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.update

2008-09-02 Thread Mike P
Thanks Diez, This is almost perfect! Is there a way to ensure each list has two elements, even if one of them is blank? Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.update

2008-09-02 Thread Mike P
Thanks Raymond, That's a neat trick, i'll look into learning more about this Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Derek Martin
On Tue, Sep 02, 2008 at 01:57:26PM +, Marc 'BlackJack' Rintsch wrote: > > I would argue that they don't represent processes at all; the object is > > a set of files which connect the standard I/O streams of a subprocess to > > its parent, and methods to operate on those files. > > And the proc

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-02 Thread akineko
On Sep 2, 5:46 am, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > Did you even try creating a checkbutton with indicatoron=False ? You > could get surprised. I didn't. My perception of checkbutton was a button with a check. So, I tried as you suggested. Yes, you are right. It is almost what I wante

Re: (in memory) database

2008-09-02 Thread Zentrader
> I don't understand why Cameron has a different version of Python which > doesn't seem to have sqlite support enabled. Agreed, but won't the package manager tell him if python-sqlite is installed? That would be the next step since it appears that SQLite intself is already installed. Since Ubunt

Re: dict.update

2008-09-02 Thread Tino Wildenhain
Mike P wrote: Hi All, I have two dictionaries e.g dict1 = {123:3,234:5,456:3} dict2 = {123:4,157:2,234:5,456:3,567:2} I want to merge these two dictionaries together so i have a resultant dictionary of: dict3 = {123:[4,3],157:[2,0],234:[5,5],456:[3,3],567:[2,0]} As later on i want to write a

Re: [ctypes-users] ctypes - loading 'librsvg-2-2.dll'

2008-09-02 Thread Tim Grove
Thanks Martin (and others) for your advice. No, this solution didn't quite work either. Well, the extremely annoying thing is that it DOES work on another home pc, but on my laptop which I use for work, it doesn't want to know!!! Both are running WinXP Pro. All the dependencies and paths "seem"

source for the property function

2008-09-02 Thread Rowland Smith
Anyone know where the source code for the built-in property function is located in a python distribution? I would like to see how it works - mainly, how does it know which class it is being called from? Thanks, Rowland -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literal syntax (was: Py 2.6 changes)

2008-09-02 Thread Peter Pearson
On 02 Sep 2008 06:10:51 GMT, Steven D'Aprano wrote: > At the risk of bike-shedding, [snip] (startled noises) It is a delight to find a reference to that half-century-old essay (High Finance) by the wonderful C. Northcote Parkinson, but how many readers will catch the allusion? -- To email me, s

email.Message problem

2008-09-02 Thread Corrado Gioannini
Hi all, i know i'm probably going to ask a very silly question, but i can't figure out where i'm doing wrong just reading the docs. trying to build and send a mail message using the email.* modules (with python 2.5). a simplified version of my script that breaks is this: mailtest.py

Re: Changing the (codec) error handler for the stdout/stderr streams in Python 3.0

2008-09-02 Thread John Nagle
Jukka Aho wrote: Just a tip for those who are only just cutting their teeth on Python 3.0 and might have encountered the same problem as I did: When a Python (3.x) program is run on a terminal that only supports a legacy character encoding - such as Latin 1 or Codepage 437 - all characters pr

pyparsing: match empty line

2008-09-02 Thread Marek Kubica
Hi, I am trying to get this stuff working, but I still fail. I have a format which consists of three elements: \d{4}M?-\d (4 numbers, optional M, dash, another number) EMPTY (the token) [Empty line] (the token. The line may contain whitespaces, but nothing else) While the ``watchname`` and ``

Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread cnb
I have a bunch of files consisting of moviereviews. For each file I construct a list of reviews and then for each new file I merge the reviews so that in the end have a list of reviewers and for each reviewer all their reviews. What is the fastest way to do this? 1. Create one file with reviews,

Re: source for the property function

2008-09-02 Thread Diez B. Roggisch
Rowland Smith schrieb: Anyone know where the source code for the built-in property function is located in a python distribution? I would like to see how it works - mainly, how does it know which class it is being called from? Google the "descriptor protocol" for new-style classes. That expl

Re: Changing the (codec) error handler for the stdout/stderr streams in Python 3.0

2008-09-02 Thread Steven D'Aprano
On Tue, 02 Sep 2008 09:57:05 -0700, John Nagle wrote: > Jukka Aho wrote: >> Just a tip for those who are only just cutting their teeth on Python >> 3.0 and might have encountered the same problem as I did: >> >> When a Python (3.x) program is run on a terminal that only supports a >> legacy chara

How to write verbose scripts

2008-09-02 Thread Steven D'Aprano
I find myself writing command line tools in Python where I wish to include "verbose" output to stdout. I start with a helper function: def print_(obj, level=0): if _verbosity >= level: print obj And then I end up with functions or methods looking like this: def parrot(x) pri

Re: How to write verbose scripts

2008-09-02 Thread Joe Riopel
On Tue, Sep 2, 2008 at 12:55 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Is there a better way of doing this than the way I am going about it? Would the logging module help, and just print the output to the stdout (or a file) instead? -- http://mail.python.org/mailman/listinfo/python-list

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread Steven D'Aprano
On Tue, 02 Sep 2008 09:48:32 -0700, cnb wrote: > I have a bunch of files consisting of moviereviews. > > For each file I construct a list of reviews and then for each new file I > merge the reviews so that in the end have a list of reviewers and for > each reviewer all their reviews. > > What is

Re: (in memory) database

2008-09-02 Thread Peter Otten
Zentrader wrote: >> I don't understand why Cameron has a different version of Python which >> doesn't seem to have sqlite support enabled. > > Agreed, but won't the package manager tell him if python-sqlite is > installed? That would be the next step since it appears that SQLite > intself is alr

Re: Numeric literal syntax

2008-09-02 Thread Alan G Isaac
On 02 Sep 2008 06:10:51 GMT, Steven D'Aprano wrote: At the risk of bike-shedding, [snip] Peter Pearson wrote: (startled noises) It is a delight to find a reference to that half-century-old essay (High Finance) by the wonderful C. Northcote Parkinson, but how many readers will catch the allus

Re: What is module initialization?

2008-09-02 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: # myglobals.py: answer = 42 # question.py import myglobals myglobals.answer = "WTF ?" But if I do :- #question.py from myglobals import * myglobals.answer = "WTF ?" will this work? with the above definition of myglobals, no. "from myglobals import" doesn't add t

Re: Numeric literal syntax

2008-09-02 Thread Fredrik Lundh
Peter Pearson wrote: (startled noises) It is a delight to find a reference to that half-century-old essay (High Finance) by the wonderful C. Northcote Parkinson, but how many readers will catch the allusion? anyone that's been involved in open source on the development side for more than, say

Re: source for the property function

2008-09-02 Thread Christian Heimes
Rowland Smith wrote: Anyone know where the source code for the built-in property function is located in a python distribution? I would like to see how it works - mainly, how does it know which class it is being called from? Property is not a function but a type. Properties are a common usage

converting a sed / grep / awk / . . . bash pipe line into python

2008-09-02 Thread hofer
Hi, Something I have to do very often is filtering / transforming line based file contents and storing the result in an array or a dictionary. Very often the functionallity exists already in form of a shell script with sed / awk / grep , . . . and I would like to have the same implementation in m

Problems when working with different timezones

2008-09-02 Thread ocgstyles
Here's some Python code executed on Red Hat 3.4 web server located in Mountain time (MDT). You'll notice that the time after setting the timezone to Eastern time (EST), the time is incorrectly 6 hours ahead, when it should only be 3. Python 2.5 (r25:51908, Mar 23 2007, 14:22:20) [GCC 3.4.6 200604

Re: Relative imports and "import X as Y"

2008-09-02 Thread OKB (not okblacke)
Gabriel Genellina wrote: > En Sun, 31 Aug 2008 07:27:12 -0300, Wojtek Walczak > <[EMAIL PROTECTED]> escribió: > >> On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote: >> Download the latest beta for your system and give it a try. >>> >>> Thanks for the advice, but I'd reall

Re: (in memory) database

2008-09-02 Thread Paul Boddie
On 2 Sep, 17:38, Zentrader <[EMAIL PROTECTED]> wrote: > > I don't understand why Cameron has a different version of Python which > > doesn't seem to have sqlite support enabled. > > Agreed, but won't the package manager tell him if python-sqlite is > installed? It shouldn't need to be installed: t

Re: How to write verbose scripts

2008-09-02 Thread Mensanator
On Sep 2, 11:55 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I find myself writing command line tools in Python where I wish to > include "verbose" output to stdout. > > I start with a helper function: > > def print_(obj, level=0): > if _verbosity >= level: > prin

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread cnb
On Sep 2, 7:06 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Tue, 02 Sep 2008 09:48:32 -0700, cnb wrote: > > I have a bunch of files consisting of moviereviews. > > > For each file I construct a list of reviews and then for each new file I > > merge the reviews so that in t

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread cnb
over 17000 files... netflixprize. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I adjust the font size on IDLE when running on Mac OS 10.5.4? TIA.

2008-09-02 Thread Chris Rebert
Same as on all the other platforms. 1. Open IDLE 2. Go Options -> Configure IDLE... 3. Choose the Fonts/Tabs section 4. Use the Size pulldown box - Chris On Tue, Sep 2, 2008 at 6:26 AM, Malcolm Lewis <[EMAIL PROTECTED]> wrote: > > > -- > http://mail.python.org/mailman/listinfo/python-list > -

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread Eric Wertman
I think you really want use a relational database of some sort for this. On Tue, Sep 2, 2008 at 2:02 PM, cnb <[EMAIL PROTECTED]> wrote: > over 17000 files... > > netflixprize. > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: converting a sed / grep / awk / . . . bash pipe line into python

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 10:36:50 -0700, hofer wrote: > sed 's/\.\..*//' \### remove '//' comments | sed 's/#.*//' Comment does not match the code. Or vice versa. :-) Untested: from __future__ import with_statement from itertools import ifilter, ifilterfalse, imap def is_junk(line): line

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread Paul Rubin
cnb <[EMAIL PROTECTED]> writes: > For each file I construct a list of reviews and then for each new file > I merge the reviews so that in the end have a list of reviewers and > for each reviewer all their reviews. > > What is the fastest way to do this? Scan through all the files sequentially, em

rope class (heavyweight string)

2008-09-02 Thread castironpi
Does anyone want to talk about a Rope implementation in Python? It doesn't get faster than the native strings until about 2 megs. P.S. Didn't your momma ever tell you not to talk on newsgroups? -- http://mail.python.org/mailman/listinfo/python-list

Re: source for the property function

2008-09-02 Thread Bruno Desthuilliers
Rowland Smith a écrit : Anyone know where the source code for the built-in property function Actually, it's a class, not a function. is located in a python distribution? property being a builtin type, you should find it somewhere in the CPython's C source AFAICT. I would like to see how

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 11:39:09 -0400, Derek Martin wrote: > On Tue, Sep 02, 2008 at 01:57:26PM +, Marc 'BlackJack' Rintsch > wrote: >> > I would argue that they don't represent processes at all; the object >> > is a set of files which connect the standard I/O streams of a >> > subprocess to its

Re: Large amount of files to parse/organize, tips on algorithm?

2008-09-02 Thread jay graves
On Sep 2, 1:02 pm, cnb <[EMAIL PROTECTED]> wrote: > over 17000 files... > > netflixprize. http://wiki.python.org/moin/NetflixPrizeBOF specifically: http://pyflix.python-hosting.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literal syntax

2008-09-02 Thread Peter Pearson
On Tue, 02 Sep 2008 17:18:58 GMT, Alan G Isaac <[EMAIL PROTECTED]> wrote: >> On 02 Sep 2008 06:10:51 GMT, Steven D'Aprano wrote: >>> At the risk of bike-shedding, >> [snip] > > Peter Pearson wrote: >> (startled noises) It is a delight to find a reference to >> that half-century-old essay (High Fin

Re: How to write verbose scripts

2008-09-02 Thread Diez B. Roggisch
Steven D'Aprano schrieb: I find myself writing command line tools in Python where I wish to include "verbose" output to stdout. I start with a helper function: def print_(obj, level=0): if _verbosity >= level: print obj And then I end up with functions or methods looking like th

Re: about downloading the selected information

2008-09-02 Thread Gabriel Genellina
En Tue, 02 Sep 2008 09:47:46 -0300, woaibeiyang <[EMAIL PROTECTED]> escribió: > I have a problem to download the information from url > http://www.ncbi.nlm.nih.gov/sites/entrez. Because it is impossible for me to > add searching material to the url to construct a new url and then visit the > websi

Re: What is module initialization?

2008-09-02 Thread dudeja . rajat
On Tue, Sep 2, 2008 at 6:22 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >>> # myglobals.py: >>> answer = 42 >>> >>> # question.py >>> import myglobals >>> myglobals.answer = "WTF ?" >>> >> >> But if I do :- >> #question.py >> from myglobals import * >> myglobals.answer

synthetic properties

2008-09-02 Thread rowland
I'm trying to come up with solution for adding synthetic properties to python, similar to synthetic properties in Objective-C. I'm playing around with doing this in a MetaClass. I can dynamically create the attributes that will back the property, but I'm having trouble figuring out how to dynamic

Re: email.Message problem

2008-09-02 Thread Gabriel Genellina
En Tue, 02 Sep 2008 13:04:18 -0300, Corrado Gioannini <[EMAIL PROTECTED]> escribió: > Hi all, > i know i'm probably going to ask a very silly question, but i > can't figure out where i'm doing wrong just reading the docs. > > trying to build and send a mail message using the email.* modules > (wi

Re: configure kdevelop for python

2008-09-02 Thread David Boddie
On Sunday 31 August 2008 10:29, Sindhu wrote: > am a newbie to python language and kdevelop, so i would like to know > how to configure kdevelop for python programming? complete with a > debugger? Maybe asking on the kdevelop mailing list will yield a helpful answer: http://lists.kde.org/?l=kdev

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Gabriel Genellina
En Tue, 02 Sep 2008 12:39:09 -0300, Derek Martin <[EMAIL PROTECTED]> escribió: > On Tue, Sep 02, 2008 at 01:57:26PM +, Marc 'BlackJack' Rintsch wrote: >> > I would argue that they don't represent processes at all; the object is >> > a set of files which connect the standard I/O streams of a su

Numpy/Scipy set field of matrix?

2008-09-02 Thread cnb
, 'argmax', 'argmin', 'argsort', 'astype', 'base', 'byteswap', 'choose', 'clip', 'compress', 'conj', 'conjugate', 'copy', 'ctypes', 'cumprod', 'cumsum', 'data', 'diagonal', 'dtype', 'dump', 'dumps', 'fill', 'flags', 'flat', 'flatten', 'getA', 'getA1', 'getH', 'getI', 'getT', 'getfield', 'imag', 'it

Re: synthetic properties

2008-09-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I'm trying to come up with solution for adding synthetic properties to python, similar to synthetic properties in Objective-C. I'm playing around with doing this in a MetaClass. I can dynamically create the attributes that will back the property, but I'm having troubl

Re: Numeric literal syntax

2008-09-02 Thread Christian Heimes
Fredrik Lundh wrote: Peter Pearson wrote: (startled noises) It is a delight to find a reference to that half-century-old essay (High Finance) by the wonderful C. Northcote Parkinson, but how many readers will catch the allusion? anyone that's been involved in open source on the development si

Re: synthetic properties

2008-09-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I'm trying to come up with solution for adding synthetic properties to python, similar to synthetic properties in Objective-C. Please explain what Objective-C "synthetic properties" are - not everyone here has a strong Objective-C background... I'm playing around

Re: How to write verbose scripts

2008-09-02 Thread MRAB
On Sep 2, 5:55 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I find myself writing command line tools in Python where I wish to > include "verbose" output to stdout. > > I start with a helper function: > > def print_(obj, level=0): >     if _verbosity >= level: >         print

Renumbering

2008-09-02 Thread Francesco Pietra
Hi; I would like to renumber, starting from 1, column 6 (i.e, 428 become 1, 429 becomes 2, etc for a very long list) ATOM 3424 N LEU B 428 143.814 87.271 77.726 1.00115.20 2SG3426 ATOM 3425 CA LEU B 428 142.918 87.524 78.875 1.00115.20 2SG3427 ATOM 3426 CB L

Re: [cairo] Rendering SVG with libRSVG,Python ... CTYPES SUCCESS AT LAST!!!

2008-09-02 Thread Tim Grove
Thanks for your advice Gerdus, but I have tried your suggestion with no success. It has at least been beneficial to discover a tool which I did not know about in 'Dependency Walker'; all dependencies appear okay. HOWEVER (!!!) I HAVE JUST HAD SUCCESS IN LOADING THE DLL !!! In searching through

  1   2   >