Tree or hierarchical structure

2008-10-30 Thread Abah Joseph
I need tutorial or book on Tree or hierarchical structure using Python. -- http://mail.python.org/mailman/listinfo/python-list

Optparse object containing generators: only seem to work if given particular names?

2008-10-30 Thread John O'Hagan
Here's a strange one for you: I have a generator function which produces lists of numbers and takes options which influence the output. The generator contains a loop, and to enable the options to have a different value on each iteration, the options may themselves be instances of the same gener

how to run python file from the python IDLE editor

2008-10-30 Thread Seid Mohammed
Greetins all 1. I can easily run python file from a comand prompt just typing "python filname.py". How can I do this from the python IDLE shell 2. How to create EXE in python. thanks all for making me to be more copnfortable with python Seid M -- "RABI ZIDNI ILMA" -- http://mail.python.org/mailma

Re: Finding the instance reference of an object

2008-10-30 Thread greg
Dale Roberts wrote: Are you saying that C++ is capable of using the Call By Reference idiom, but C is not, because C does not have a reference designation for formal function parameters? Call by reference is not an "idiom", it's a *language feature*. Pascal has it (using "var"), VB.NET has it

Re: modifying locals

2008-10-30 Thread Tino Wildenhain
Hi John, John [H2O] wrote: Steven D'Aprano-7 wrote: What you are actually trying to do is unclear to me. Perhaps you could try explaining better with a more concrete example? -- Steven -- Actually, maybe a LACK of an example would make it simpler. What I'm after is a function, to which I

Re: [Novice]Installing eric4 with python 2.6

2008-10-30 Thread Saurabh Agrawal
On Thu, Oct 30, 2008 at 9:56 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Saurabh Agrawal wrote: > > > > PyQt supported Python 2.6 on the day it was released. > > > > A snapshot of the PyQt Windows installer for Python 2.6 can be > > downloaded > > from the same page as you downlo

Re: open a new terminal window from another terminal window in linux/unix system

2008-10-30 Thread Steve Holden
gaurav kashyap wrote: > Dear all, > > I am using Microsoft Windows XP.Using putty.exe,I connected to LINUX > server and a terminal window gets opened.Here i logeed in as root. > > What i want to do is open another terminal window from already opened > terminal window. > Can this be achieved.If y

open a new terminal window from another terminal window in linux/unix system

2008-10-30 Thread gaurav kashyap
Dear all, I am using Microsoft Windows XP.Using putty.exe,I connected to LINUX server and a terminal window gets opened.Here i logeed in as root. What i want to do is open another terminal window from already opened terminal window. Can this be achieved.If yes,please provide a tested solution T

Re: How to open a shell prompt from an existing shell prompt

2008-10-30 Thread gaurav kashyap
Dear Tino, There is no subprocess module in python 2.3.5. My goal is: 1.Open a terminal window and login as root. 2.Issue some command in the terminal window that will open another terminal,similar to the onealready opened. Am i clear now. -- http://mail.python.org/mailman/listinfo/python-l

Re: Exec and Scope

2008-10-30 Thread Rafe
On Oct 31, 10:47 am, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > Hi everybody! > > I'm trying to do something in a way that is probably not particularly > wise but at this point I don't know any better, so bear with me. > > Suppose in main.py I have the following statements: > > myObject = MyO

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread alex23
On Oct 31, 2:05 am, "Andy O'Meara" <[EMAIL PROTECTED]> wrote: > I don't follow you there.  If you're referring to multiprocessing, our > concerns are: > > - Maturity (am I willing to tell my partners and employees that I'm > betting our future on a brand-new module that imposes significant > restri

Re: Exec and Scope

2008-10-30 Thread James Mills
Manu, Good lord man, what are you trying to solve ? Describe your "actual problem" you're attempting to solve... This looks really really ugly and I would advise against any solution that relies on exec() --JamesMills On Fri, Oct 31, 2008 at 1:47 PM, Emanuele D'Arrigo <[EMAIL PROTECTED]> wrote:

Exec and Scope

2008-10-30 Thread Emanuele D'Arrigo
Hi everybody! I'm trying to do something in a way that is probably not particularly wise but at this point I don't know any better, so bear with me. Suppose in main.py I have the following statements: myObject = MyObject() execThis("myObject.myCommand()") Now suppose the method def execThis(aC

Re: Finding the instance reference of an object

2008-10-30 Thread Douglas Alan
greg <[EMAIL PROTECTED]> writes: > Douglas Alan wrote: >> greg <[EMAIL PROTECTED]> writes: >> >>>Seems to me that (1) describes exactly how parameter passing >>>works in Python. So why insist that it's *not* call by value? >> Because there's an important distinction to be made, > > The distinction

Re: Restricted Execution of untrusted code

2008-10-30 Thread Aaron Brady
On Oct 30, 3:50 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Oct 30, 6:35 am, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > > > > > I noticed that this issue has been discussed in this newsgroup > > periodically over the years and I seem to understand that - > > comprehensive- safe/restricted

Re: about recursive load

2008-10-30 Thread alex23
On Oct 30, 2:22 pm, Michel Perez <[EMAIL PROTECTED]> wrote: > Hi, am very newbie in Python, but as part of a project i need to load > configuration -a settings.py file in the package dir- of my apps > recursively, something like this: > > settings.load_config("project.test.app") > settings.load_co

Re: Finding the instance reference of an object

2008-10-30 Thread Joe Strout
On Oct 30, 2008, at 6:58 PM, greg wrote: For what it's worth, I happen to agree that telling someone that Python passes parameters "by value" without being sure they understand exactly what "by value" means, is not a good idea -- not because the term isn't well-defined, but because of the widesp

Re: Finding the instance reference of an object

2008-10-30 Thread Joe Strout
On Oct 30, 2008, at 6:38 PM, greg wrote: The distinction isn't about parameter passing, though, it's about the semantics of *assignment*. Once you understand how assigment works in Python, all you need to know then is that parameters are passed by assigning the actual parameter to the formal par

Re: Finding the instance reference of an object

2008-10-30 Thread Aaron Brady
On Oct 30, 9:05 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 31 Oct 2008 13:58:13 +1300, greg wrote: > > Dale Roberts wrote: > snip > > > If they understand how assignment works in Python, that tells them all > > they need to know. > > Nonsense. Maybe I missed this p

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Rhamphoryncus
On Oct 30, 8:23 pm, "Patrick Stinson" <[EMAIL PROTECTED]> wrote: > Speaking of the big picture, is this how it normally works when > someone says "Here's some code and a problem and I'm willing to pay > for a solution?" I've never really walked that path with a project of > this complexity (I guess

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Patrick Stinson
Speaking of the big picture, is this how it normally works when someone says "Here's some code and a problem and I'm willing to pay for a solution?" I've never really walked that path with a project of this complexity (I guess it's the backwards-compatibility that makes it confusing), but is this p

Re: Finding the instance reference of an object

2008-10-30 Thread Steven D'Aprano
On Fri, 31 Oct 2008 13:58:13 +1300, greg wrote: > Dale Roberts wrote: > >> Okay, you can have it that way, but every time you explain to someone >> that Python passes "By Value", you will have to add the additional >> baggage that, oh, by the way, there is a completely different meaning >> for "v

Re: Finding the instance reference of an object

2008-10-30 Thread Steven D'Aprano
On Thu, 30 Oct 2008 09:03:42 -0600, Joe Strout wrote: > Python's behavior is exactly and always equivalent to the "ByVal" > behavior of languages that have both behaviors. Pascal has both ByVal and By Ref, and Python's behaviour is absolutely not the same as Pascal's ByVal. > It also matches th

Re: Finding the instance reference of an object

2008-10-30 Thread greg
Dale Roberts wrote: Okay, you can have it that way, but every time you explain to someone that Python passes "By Value", you will have to add the additional baggage that, oh, by the way, there is a completely different meaning for "value" in Python than what you are used to. For what it's wort

Re: list versions of all installed modules

2008-10-30 Thread John [H2O]
Excellent! Thank you. Gerhard Häring wrote: > > John [H2O] wrote: >> Is there a quick way to list the version of each installed module? > > $ sudo easy_install yolk > $ yolk -l > > -- Gerhard > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- View this message in contex

Re: Finding the instance reference of an object

2008-10-30 Thread greg
Gabriel Genellina wrote: En Tue, 28 Oct 2008 00:58:10 -0200, greg <[EMAIL PROTECTED]> escribió: > (1) Call by value: The actual parameter is an expression. It is evaluated and the result is assigned to the formal parameter. Subsequent assignments to the formal parameter do not affect

Re: Printing with interspersed element

2008-10-30 Thread Matimus
On Oct 30, 2:10 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 8:42 PM, Arnaud Delobelle > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > >> Hi all, > > >> I guess this is a recurring issue for someone who doesn't re

Re: Finding the instance reference of an object

2008-10-30 Thread greg
Douglas Alan wrote: greg <[EMAIL PROTECTED]> writes: Seems to me that (1) describes exactly how parameter passing works in Python. So why insist that it's *not* call by value? Because there's an important distinction to be made, The distinction isn't about parameter passing, though, it's ab

Re: Code not work - DESPERATE HELP :(

2008-10-30 Thread Glenn Linderman
On approximately 10/30/2008 2:13 PM, came the following characters from the keyboard of Bill McClain: On 2008-10-30, fx5900 <[EMAIL PROTECTED]> wrote: I just went to go and get a coffee when i noticed a email, thought it was just usual spam. Read your message, and it worked. it was becaus

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Ben Finney
Łukasz Ligowski <[EMAIL PROTECTED]> writes: > 2.5 docs say that: > "a.has_key(k) Equivalent to k in a, use that form in new code" > > 2.6 docs say that: > "dict.has_key(key) is equivalent to key in d, but deprecated." > > which is true? Both are true, and are different ways of saying the same

Re: Graphical object browser

2008-10-30 Thread Jason
Yeah, PyCrust is in wxPython now. But I take back my initial excitement — it's freaking hard to use, despite its provision of a "pywrap" script (batch file under Windows). You certainly can't just replace "python /path/to/blah.py" with "pywrap /path/to/blah.py", especially if your script requires k

Re: Graphical object browser

2008-10-30 Thread Jason
Yeah, PyCrust is in wxPython now. But I take back my initial excitement — it's freaking hard to use, despite its provision of a "pywrap" script (batch file under Windows). You certainly can't just replace "python /path/to/blah.py" with "pywrap /path/to/blah.py", especially if your script requires k

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread James Mills
On Fri, Oct 31, 2008 at 9:18 AM, John Krukoff <[EMAIL PROTECTED]> wrote: > Are you sure? It looks like his complaint isn't that it doesn't work, > but that the error message is misleading. > > With the setup: > > Python 2.5.2 (r252:60911, Sep 22 2008, 12:08:38) > [GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on

Re: modifying locals

2008-10-30 Thread Steve Holden
John [H2O] wrote: > I would like to write a function to write variables to a file and modify a > few 'counters'. This is to replace multiple instances of identical code in a > module I am writing. > > This is my approach: > > def write_vars(D): > """ pass D=locals() to this function... """ >

Re: modifying locals

2008-10-30 Thread John [H2O]
Steven D'Aprano-7 wrote: > > What you are actually trying to do is unclear to me. Perhaps you could > try explaining better with a more concrete example? > > -- > Steven > -- > Actually, maybe a LACK of an example would make it simpler. What I'm after is a function, to which I can pass a d

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread John Krukoff
On Fri, 2008-10-31 at 08:55 +1000, James Mills wrote: > What you have discovered is not a bug :) > > cheers > James > Are you sure? It looks like his complaint isn't that it doesn't work, but that the error message is misleading. With the setup: Python 2.5.2 (r252:60911, Sep 22 2008, 12:08:38)

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread James Mills
On Fri, Oct 31, 2008 at 8:49 AM, mark floyd <[EMAIL PROTECTED]> wrote: > I was doing some testing with the different ways to pass arguments into > functions and ran into what looks like a bug. > > Given function, > > def foo(a,b,c): > print a > print b > print c > > # Call function with

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Glenn Linderman
On approximately 10/30/2008 6:26 AM, came the following characters from the keyboard of Jesse Noller: On Wed, Oct 29, 2008 at 8:05 PM, Glenn Linderman <[EMAIL PROTECTED]> wrote: On approximately 10/29/2008 3:45 PM, came the following characters from the keyboard of Patrick Stinson: If y

Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread mark floyd
I was doing some testing with the different ways to pass arguments into functions and ran into what looks like a bug. Given function, def foo(a,b,c): print a print b print c # Call function with named parameter list, leaving 'b' out foo(a=1, c=3) Traceback (most recent call last):

Re: open a shell prompt froma python program

2008-10-30 Thread Derek Martin
On Thu, Oct 30, 2008 at 02:47:48AM -0700, gaurav kashyap wrote: > Simply i want to open a shell prompt from a python program. If this is literally true, then you just need to figure out what command will open a terminal window from the shell prompt. Once you figure that out, it's as simple as: c

Re: Web crawler on python

2008-10-30 Thread James Mills
On Fri, Oct 31, 2008 at 8:13 AM, yura <[EMAIL PROTECTED]> wrote: > I need simple web crawler, I found Ruya, but it's seems not currently > maintained. Does anybody know good web crawler on python or with > python interface? > http://watch-me.890m.com http://hg.softcircuit.com.au/index.wsgi/project

Re: Python suitable for Midi ?

2008-10-30 Thread Gabriel Genellina
En Thu, 30 Oct 2008 16:50:22 -0200, Chuckk Hubbard <[EMAIL PROTECTED]> escribió: On Wed, Oct 29, 2008 at 10:32 PM, J Kenneth King <[EMAIL PROTECTED]> wrote: One also has access to nice-levels on unix systems. True enough, but it's not so much a problem for me, as I'm pretty okay at tuning m

Re: modifying locals

2008-10-30 Thread Steven D'Aprano
On Thu, 30 Oct 2008 14:21:01 -0700, John [H2O] wrote: > I would like to write a function to write variables to a file and modify > a few 'counters'. Are you talking about a function to generate Python source code? > This is to replace multiple instances of identical > code in a module I am wri

Web crawler on python

2008-10-30 Thread yura
I need simple web crawler, I found Ruya, but it's seems not currently maintained. Does anybody know good web crawler on python or with python interface? http://watch-me.890m.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing with interspersed element

2008-10-30 Thread Grant Edwards
On 2008-10-30, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 8:42 PM, Arnaud Delobelle ><[EMAIL PROTECTED]> wrote: >> On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: >>> Hi all, >>> >>> I guess this is a recurring issue for someone who doesn't really know >>> t

Re: Printing with interspersed element

2008-10-30 Thread Arnaud Delobelle
On 30 Oct 2008, at 21:10, Paulo J. Matos wrote: On Thu, Oct 30, 2008 at 8:42 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: Hi all, I guess this is a recurring issue for someone who doesn't really know the python lib inside

modifying locals

2008-10-30 Thread John [H2O]
I would like to write a function to write variables to a file and modify a few 'counters'. This is to replace multiple instances of identical code in a module I am writing. This is my approach: def write_vars(D): """ pass D=locals() to this function... """ for key in D.keys(): e

Re: Printing with interspersed element

2008-10-30 Thread Grant Edwards
On 2008-10-30, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >> print ' 10 '.join(str(x) for x in lst) > > Thanks for the tip but that has an issue when dealing with potentially > millions of objects. You are creating a string in memory to then dump > to a file [or screen] while you could dump to the

Re: Code not work - DESPERATE HELP :(

2008-10-30 Thread Bill McClain
On 2008-10-30, fx5900 <[EMAIL PROTECTED]> wrote: >I just went to go and get a coffee when i noticed a email, thought it was > just usual spam. Read your message, and it worked. it was because i did not > put they 'python' keyword infront. How did u figure it out? It is some problem with the D

Re: Printing with interspersed element

2008-10-30 Thread Paulo J. Matos
On Thu, Oct 30, 2008 at 8:42 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I guess this is a recurring issue for someone who doesn't really know >> the python lib inside out. There must be a simple way to do this.

Re: Code not work - DESPERATE HELP :(

2008-10-30 Thread fx5900
Hi, I just went to go and get a coffee when i noticed a email, thought it was just usual spam. Read your message, and it worked. it was because i did not put they 'python' keyword infront. How did u figure it out? Although, cos i nver worked with python, things are bound to go wrong on the fi

Re: Code not work - DESPERATE HELP :(

2008-10-30 Thread Bill McClain
On 2008-10-30, fx5900 <[EMAIL PROTECTED]> wrote: > Hi, >i am trying to convert an .osm (openstreetmap) file into gml format and > finally to shapefile given this wiki info > http://wiki.openstreetmap.org/index.php/GML. I'm using windows and when i > entered the following commands osm2gml.py

Re: Restricted Execution of untrusted code

2008-10-30 Thread Aaron Brady
On Oct 30, 6:35 am, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > I noticed that this issue has been discussed in this newsgroup > periodically over the years and I seem to understand that - > comprehensive- safe/restricted execution of untrusted code in python > is currently quite hard to achie

Re: Printing with interspersed element

2008-10-30 Thread Arnaud Delobelle
On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > Hi all, > > I guess this is a recurring issue for someone who doesn't really know > the python lib inside out. There must be a simple way to do this. > I have a list of objects [x1, x2, x3, ..., xn] and I have defined a > print metho

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 30, 3:06 pm, Dale Roberts <[EMAIL PROTECTED]> wrote: > ... that idiom deserves a different name which > distinguishes it from the commonly accepted notion of Pass By Value. Bah, what I meant to end with was: Just as the Pass By Reference idiom deserves a unique name to distinguish it from

Re: Regarding shared memory

2008-10-30 Thread Aaron Brady
On Oct 29, 11:13 pm, gaurav kashyap <[EMAIL PROTECTED]> wrote: > Dear all, > > I have a server program that listens to a particular port and a number > of client programs that connect to the server. > > Now i want to put some data in form of python list in main memory on > server.Hence whenver a cl

Re: Printing with interspersed element

2008-10-30 Thread Grant Edwards
On 2008-10-30, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > Hi all, > > I guess this is a recurring issue for someone who doesn't really know > the python lib inside out. There must be a simple way to do this. > I have a list of objects [x1, x2, x3, ..., xn] and I have defined a > print method for t

Printing with interspersed element

2008-10-30 Thread Paulo J. Matos
Hi all, I guess this is a recurring issue for someone who doesn't really know the python lib inside out. There must be a simple way to do this. I have a list of objects [x1, x2, x3, ..., xn] and I have defined a print method for them print_obj(). Now I want to print them intersepersed by an elemen

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Patrick Stinson
On Wed, Oct 29, 2008 at 4:05 PM, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/29/2008 3:45 PM, came the following characters from the > keyboard of Patrick Stinson: >> >> If you are dealing with "lots" of data like in video or sound editing, >> you would just keep the data in sh

Re: [PyCon-Organizers] PyCon 2009 (US) - Call for tutorials Extended to 11/3

2008-10-30 Thread Douglas Napoleone
We should get an announcement out on the blog: http://pycon.blogspot.com/ and note that the deadline is approaching for both talks and tutorials. For some reason blogger does not like my google account, so I cant seem to do it :-( -Doug On Thu, Oct 30, 2008 at 3:28 PM, Greg Lindstrom <[EMAI

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Martin v. Löwis
>> Why do you think so? For C code that is carefully written, the GIL >> allows *very well* to write CPU bound scripts running on other threads. >> (please do get back to Jesse's original remark in case you have lost >> the thread :-) >> > > I don't follow you there. If you're referring to multip

PyCon 2009 (US) - Call for tutorials Extended to 11/3

2008-10-30 Thread Greg Lindstrom
We have had requests to extend the deadline for submitting Tutorial Proposals for PyCon 2009 (US) through the weekend and are willing to do so. We will accept tutorial proposals through Monday, November 3. --greg == The period for submitting tutorial proposals for

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 30, 11:03 am, Joe Strout <[EMAIL PROTECTED]> wrote: > ... >> Are you saying that C++ is capable of using the Call By Reference idiom, >> but C is not, because C does not have a reference designation for formal >> function parameters? > > It's been a LONG time since I did anything in C, but y

Re: Python suitable for Midi ?

2008-10-30 Thread Chuckk Hubbard
On Wed, Oct 29, 2008 at 10:32 PM, J Kenneth King <[EMAIL PROTECTED]> wrote: > > One also has access to nice-levels on unix systems. True enough, but it's not so much a problem for me, as I'm pretty okay at tuning my own system, but I believe most of the people who'd be interested in my app (if an

Code not work - DESPERATE HELP :(

2008-10-30 Thread fx5900
Hi, i am trying to convert an .osm (openstreetmap) file into gml format and finally to shapefile given this wiki info http://wiki.openstreetmap.org/index.php/GML. I'm using windows and when i entered the following commands osm2gml.py < map_01_data.osm > map_01_data.gml on my dos prompt i ge

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Terry Reedy
Andy O'Meara wrote: On Oct 28, 6:11 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: You should really reconsider writing performance-critical code in Python. I don't follow you there... Performance-critical code in Python?? Martin meant what he said better later >> Again, if you do heavy

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Paul Boddie
On 30 Okt, 14:12, "Andy O'Meara" <[EMAIL PROTECTED]> wrote: > > 3) Start a new python implementation, let's call it "CPythonES" [...] > 4) Drop python, switch to Lua. Have you looked at tinypy? I'm not sure about the concurrency aspects of the implementation, but the developers are not completel

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Jesse Noller
On Thu, Oct 30, 2008 at 1:54 PM, Andy O'Meara <[EMAIL PROTECTED]> wrote: > On Oct 30, 1:00 pm, "Jesse Noller" <[EMAIL PROTECTED]> wrote: > >> >> Multiprocessing is written in C, so as for the "less agile" - I don't >> see how it's any less agile then what you've talked about. > > Sorry for not bein

In search for a simple build tool

2008-10-30 Thread Orestis Markou
Hello, as many of you probably know anyway, there's been a lot of talk about Python build tools and solutions these days. The thing is, now with so many tools to choose from, I can't choose! Hopefully people with more experience can help me. My requirements are: * Simple filesystem oper

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Andy O'Meara
On Oct 30, 1:00 pm, "Jesse Noller" <[EMAIL PROTECTED]> wrote: > > Multiprocessing is written in C, so as for the "less agile" - I don't > see how it's any less agile then what you've talked about. Sorry for not being more specific there, but by "less agile" I meant that an app's codebase is less

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Terry Reedy
D'Arcy J.M. Cain wrote: On Thu, 30 Oct 2008 09:50:57 -0500 "Kurt Smith" <[EMAIL PROTECTED]> wrote: 2.5 docs say that: "a.has_key(k) Equivalent to k in a, use that form in new code" Meaning: don't use 'a.has_key(k)'. 2.6 docs say that: "dict.has_key(key) is equivalent to key in d, but deprec

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread VanL
Jesse Noller wrote: > Even luminaries such as Brian Goetz and many, many others have pointed > out that threading, as it exists today is fundamentally difficult to > get right. Ergo the "renaissance" (read: echo chamber) towards > Erlang-style concurrency. I think this is slightly missing what An

Re: beutifulsoup

2008-10-30 Thread Kay Schluehr
On 30 Okt., 18:28, luca72 <[EMAIL PROTECTED]> wrote: > hello > Another stupit question instead of use > sito = urllib.urlopen('http://www.prova.com/') > esamino = BeautifulSoup(sito) > > i do >  sito = urllib.urlopen('http://onlygame.helloweb.eu/') >  file_sito = open('sito.html', 'wb') >  for line

Re: Is ctypes appropriate in my case?

2008-10-30 Thread Terry Reedy
[EMAIL PROTECTED] wrote: For CPython, an importable module written in C. There is a doc Extending and Embedding the Python Interpreter. But I expect you can write the class in Python with ctypes. Thanks Terry. I'll be using ctypes now and have started writing the class. But the

Re: beutifulsoup

2008-10-30 Thread luca72
hello Another stupit question instead of use sito = urllib.urlopen('http://www.prova.com/') esamino = BeautifulSoup(sito) i do sito = urllib.urlopen('http://onlygame.helloweb.eu/') file_sito = open('sito.html', 'wb') for line in sito : file_sito.write(line) file_sito.close() how can i pa

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Jesse Noller
On Thu, Oct 30, 2008 at 12:05 PM, Andy O'Meara <[EMAIL PROTECTED]> wrote: > On Oct 28, 6:11 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> > Because then we're back into the GIL not permitting threads efficient >> > core use on CPU bound scripts running on other threads (when they >> > otherwi

Re: Tkinter: How to get Label wraplength functionality in Text Box

2008-10-30 Thread Mudcat
Awesome...there it goes. I guess my main problem was trying to evaluate the box before it had been displayed (or all the frame propagations were finished). The key was getting the binding in there once I got the count functionality to work. After all that...such a simple function: def textBo

Re: Is psyco available for python 2.6?

2008-10-30 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: sert: I used the windows installer for the latest version of psyco, which is labeled as compatible with 2.5, but it gives the following error: ImportError: DLL load failed: The specified module could not be found. (check that the compiled extension 'C:\Python26\lib\site-

Re: open a shell prompt froma python program

2008-10-30 Thread Grant Edwards
On 2008-10-30, Derek Martin <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 03:53:52AM -0700, gaurav kashyap wrote: >> HI, >> I am getting the following error: >> >> konsole: cannot connect to X server >> >> do i need to install the related files. > > Maybe, but given that error message, pro

Re: HTML File Parsing

2008-10-30 Thread Felipe De Bene
On Oct 28, 6:18 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Felipe De Bene wrote: > > I'm having problems parsing anHTMLfile with the following syntax : > > > > > User ID > > Name > BGCOLOR='#c0c0c0'>Date > > and so on > > > whenever I feed the parser with such file I get the error

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Andy O'Meara
On Oct 28, 6:11 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Because then we're back into the GIL not permitting threads efficient > > core use on CPU bound scripts running on other threads (when they > > otherwise could). > > Why do you think so? For C code that is carefully written, the G

Fwd: how to get full-text search of pysqlite3 work in python2.5.2

2008-10-30 Thread hawk gao
actually, the latest situation is debian:~/pysqlite-2.5.0/doc# python >>> from pysqlite2 import dbapi2 as sqlite3 >>> con = sqlite3.connect(":memory:") >>> con.execute("CREATE VIRTUAL TABLE posts using FTS3(title, body);") Traceback (most recent call last): File "", line 1, in pysqlite2.dbapi2.

Re: Is psyco available for python 2.6?

2008-10-30 Thread bearophileHUGS
sert: > I used the windows installer for the latest version of psyco, > which is labeled as compatible with 2.5, but it gives the > following error: > ImportError: DLL load failed: The specified module could not be > found. (check that the compiled extension 'C:\Python26\lib\site- > packages\psyco\

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Łukasz Ligowski
Hi, On Thursday 30 of October 2008 16:11:07 you wrote: > On Thu, 30 Oct 2008 09:50:57 -0500 > > Wow! That is so badly written. Both those statements could easily be > read the opposite by someone reading the docs. Granted the latter is > better and it is correct but it could be clearer the the

Re: open a shell prompt froma python program

2008-10-30 Thread Derek Martin
On Thu, Oct 30, 2008 at 03:53:52AM -0700, gaurav kashyap wrote: > HI, > I am getting the following error: > > konsole: cannot connect to X server > > do i need to install the related files. Maybe, but given that error message, probably not. You would do yourself a great favor by providing a lot

Re: Ascii codec can't encode

2008-10-30 Thread Ulrich Eckhardt
luca72 wrote: > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in > position 8: ordinal not in range(128) > > I have solve in this way: > > file_ricerca = codecs.open('ri', 'wb', 'ISO-8859-15', 'repalce') That should be 'replace' instead of 'repalce', I assume you just mistyped

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread D'Arcy J.M. Cain
On Thu, 30 Oct 2008 09:50:57 -0500 "Kurt Smith" <[EMAIL PROTECTED]> wrote: > > 2.5 docs say that: > > "a.has_key(k) Equivalent to k in a, use that form in new code" > > Meaning: don't use 'a.has_key(k)'. > > > 2.6 docs say that: > > "dict.has_key(key) is equivalent to key in d, but deprecated."

Re: Single string vs list of strings

2008-10-30 Thread Joe Strout
On Oct 30, 2008, at 8:55 AM, Grant Edwards wrote: The question you might want to asked is whether the parameter is a single string or a sequence of strings. That way your code will also work with an iterator that returns strings. type('asdf') is str True I agree with the general approach,

Re: Finding the instance reference of an object

2008-10-30 Thread Joe Strout
On Oct 30, 2008, at 7:56 AM, Dale Roberts wrote: That's the misconception that is leading some folks around here into tangled nots of twisty mislogic, ultimately causing them to make up new terms for what every other modern language is perfectly happy calling Call-By-Value. Doesn't this logic

Re: Single string vs list of strings

2008-10-30 Thread Grant Edwards
On 2008-10-30, Scott Sharkey <[EMAIL PROTECTED]> wrote: > I have a need to determine whether a passed variable is a single string, > or a list of strings. What is the most pythonic way to do this? >>> type('asdf') is list False >>> type(['asdf','qwer']) is list True The question you might want

Re: how to get full-text search of pysqlite3 work in python2.5.2

2008-10-30 Thread Guilherme Polo
On 10/30/08, hawk <[EMAIL PROTECTED]> wrote: > On Oct 30, 8:21 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > > On 10/30/08, hawk <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > my environment is debian, python 2.5.2. > > > when i call con.enable_load_extension(True), the follow

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Kurt Smith
On Thu, Oct 30, 2008 at 9:37 AM, Łukasz Ligowski <[EMAIL PROTECTED]>wrote: > Hi, > > There is small inconsistency (or I don't understand it right) between > python > 2.5 docs and python 2.6 docs. > > 2.5 docs say that: > "a.has_key(k) Equivalent to k in a, use that form in new code" Meaning: do

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Terry Reedy
Łukasz Ligowski wrote: Hi, There is small inconsistency (or I don't understand it right) between python 2.5 docs and python 2.6 docs. 2.5 docs say that: "a.has_key(k) Equivalent to k in a, use that form in new code" 2.6 docs say that: "dict.has_key(key) is equivalent to key in d, but depre

Is psyco available for python 2.6?

2008-10-30 Thread sert
I used the windows installer for the latest version of psyco, which is labeled as compatible with 2.5, but it gives the following error: ImportError: DLL load failed: The specified module could not be found. (check that the compiled extension 'C:\Python26\lib\site- packages\psyco\_psyco.pyd' is

Re: Is ctypes appropriate in my case?

2008-10-30 Thread dudeja . rajat
> For CPython, an importable module written in C. There is a doc Extending > and Embedding the Python Interpreter. But I expect you can write the class > in Python with ctypes. Thanks Terry. I'll be using ctypes now and have started writing the class. But the problem is that there are some 150 A

"xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Łukasz Ligowski
Hi, There is small inconsistency (or I don't understand it right) between python 2.5 docs and python 2.6 docs. 2.5 docs say that: "a.has_key(k) Equivalent to k in a, use that form in new code" 2.6 docs say that: "dict.has_key(key) is equivalent to key in d, but deprecated." which is true?

Re: py2exe

2008-10-30 Thread Mike Driscoll
On Oct 30, 7:19 am, Gandalf <[EMAIL PROTECTED]> wrote: > I'm new to py2exe. > > i'm using python 2.5 on XP > and py2exe 0.6.6 > > does someone know what may be wrong with this script: > > from distutils.core import setup > > import py2exe > > setup(console=['babylon.py'], > > options = { > > "py2ex

Single string vs list of strings

2008-10-30 Thread Scott Sharkey
Hi All, I have a need to determine whether a passed variable is a single string, or a list of strings. What is the most pythonic way to do this? Thanks. -Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: How to get Label wraplength functionality in Text Box

2008-10-30 Thread Guilherme Polo
On 10/30/08, Mudcat <[EMAIL PROTECTED]> wrote: > I'm not sure why my tkinter would not be compiled against 8.5 since I > have the latest version. I assumed that Python 2.6 would have it > without requiring me to do an extra compile. It is not really python's fault if tkinter is compiled against

Simple ElementTree Help

2008-10-30 Thread Heston James - Cold Beans
Hello Guys, I have a small element tree task here whereby I need to crack open an XML file, modify the text for one element and then resave it back again. I'm currently trying to do this like follows: # Parse the XML file. application_settings = etree.parse('/configuration/application.xml'

  1   2   >