exec within function

2010-02-03 Thread Simon zack
hi, I'm not sure how I can use exec within a function correctly here is the code i'm using: def a(): exec('b=1') print(b) a() this will raise an error, but I would like to see it outputting 1 thanks smk -- http://mail.python.org/mailman/listinfo/python-list

simple and fast platform independent IPC

2010-02-03 Thread News123
Hi, I wondered what IPC library might be best simplest for following task? I'm having a few python scripts all running on the same host (linux or win), which are started manually in random order. (no common parent process) Each process might be identified by an integer (1,2,3) or by a symbolic na

Re: Logging oddity: handlers mandatory in every single logger?

2010-02-03 Thread Masklinn
On 2 Feb 2010, at 17:52 , Jean-Michel Pichavant wrote: > > Masklinn wrote: >> Jean-Michel Pichavant wrote: >> >>> To add a custom level, I would proceed that way: >>> >>> logging.ALERT = 45 >>> logging.addLevelName(logging.ALERT, 'ALERT !!') >>> logging.getLogger().log(logging.ALERT, 'test') >>

Re: Python and Ruby

2010-02-03 Thread Timothy N. Tsvetkov
On Jan 28, 2:29 am, Jonathan Gardner wrote: > On Jan 27, 5:47 am, Simon Brunning wrote: > > > > > I think Python is a little cleaner, but I'm sure you'd find Ruby fans > > who'd argue the complete opposite. > > Are you sure about that? > > There's a lot of line noise in Ruby. How are you supposed

Re: simple and fast platform independent IPC

2010-02-03 Thread Gabriel Genellina
En Wed, 03 Feb 2010 05:32:58 -0300, News123 escribió: I'm having a few python scripts all running on the same host (linux or win), which are started manually in random order. (no common parent process) Each process might be identified by an integer (1,2,3) or by a symbolic name ( 'dad' , 'mo

Re: simple and fast platform independent IPC

2010-02-03 Thread Vinay Sajip
On Feb 3, 8:32 am, News123 wrote: > Hi, > > I wondered what IPC library might be best simplest for following task? > > I'm having a few python scripts all running on the same host (linux or > win), which are started manually in random order. (no common parent process) > Each process might be ident

pyfltk ducumentation question

2010-02-03 Thread tinnews
I have just installed pyfltk version 1.1.4 on my xubuntu 9.10 system, it's working OK and a fairly trivial little program I have written is able to pop up a GUI window. However I'm now a bit stuck as the documentation seems a little sparse. For example I'm using FL_Multiline_Output and can't find

Re: simple and fast platform independent IPC

2010-02-03 Thread Joan Miller
On 3 feb, 09:34, Vinay Sajip wrote: > On Feb 3, 8:32 am, News123 wrote: > > > > > Hi, > > > I wondered what IPC library might be best simplest for following task? > > > I'm having a few python scripts all running on the same host (linux or > > win), which are started manually in random order. (no

Re: simple and fast platform independent IPC

2010-02-03 Thread News123
Hi Gabriel, I'll look at it. I wasn't aware about named pipes for windows. bye N Gabriel Genellina wrote: > En Wed, 03 Feb 2010 05:32:58 -0300, News123 escribió: > >> I'm having a few python scripts all running on the same host (linux or >> win), which are started manually in random order.

Re: Logging oddity: handlers mandatory in every single logger?

2010-02-03 Thread Jean-Michel Pichavant
The reason is that log takes an *int* as first argument that defines the logging level. You gave a string. So There is definitely a reason for it to be incorrect. That's not a reason, that's just what currently happens. I know it doesn't work, and I know why, I went and checked the code

Re: simple and fast platform independent IPC

2010-02-03 Thread Tim Golden
[News123] I wondered what IPC library might be best simplest for following task? ... xmlrpc seems to be a little heavy for such tasks. signals don't allow to exchange data a shared memory message queue would probably a good solution, but python's Multiprocessing.Queue seems to require

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Daniel Fetchinson
>>> I like seeing them in the same place as the source file, because when I >>> start developing a module, I often end up renaming it multiple times >>> before it settles on a final name. When I rename or move it, I delete >>> the .pyc file, and that ensures that if I miss changing an import, and >

Re: simple and fast platform independent IPC

2010-02-03 Thread Eden Kirin
On 03.02.2010 09:32, News123 wrote: Hi, I wondered what IPC library might be best simplest for following task? Consider using Thrift (http://incubator.apache.org/thrift/). It is multiplatform multilanguage RPC and IPC solution. I implemented it in couple of my projects and it works seamlessl

Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
Hello, I am sitting here for quite some time, but usually keep silent ;-) I use Python since 2003 both "professionally" and for my hobby projects and love it a much. I notice however, that "maintaining" existing/older python code is may be not so enjoyable task. It may be even harder than supporti

Re: simple and fast platform independent IPC

2010-02-03 Thread Joan Miller
On 3 feb, 10:54, Tim Golden wrote: > [News123] > > >>> I wondered what IPC library might be best simplest for following task? > > ... > > >>> xmlrpc seems to be a little heavy for such tasks. > > >>> signals don't allow to exchange data > > >>> a shared memory message queue would probably a good s

Re: Logging oddity: handlers mandatory in every single logger?

2010-02-03 Thread Masklinn
On 3 Feb 2010, at 11:50 , Jean-Michel Pichavant wrote: > > >>> The reason is that log takes an *int* as first argument that defines the >>> logging level. You gave a string. So There is definitely a reason for it to >>> be incorrect. >>> >> That's not a reason, that's just what currently ha

Re: python admin abuse complaint

2010-02-03 Thread John Bokma
Xah Lee writes: > (12:12:30 PM) You have been kicked by dash: (No.) Oh noes, someone is harrassing poor Xah the Usenet spammer. You have been and still are a major pain in the ass to a lot of Usenet users, and still surprised that you're not making friends. I mean, what did you want to do on IRC

Re: test -- please ignore

2010-02-03 Thread Ben Finney
kj writes: > (my replies in a different comp.lang.python thread are getting > rejected by the server; i have no problem posting to alt.test; and > i'm trying to toubleshoot the problem further.) Thank you for this explanation. It is important to know that you've tried the less obtrusive diagnost

test -- please ignore

2010-02-03 Thread kj
(my replies in a different comp.lang.python thread are getting rejected by the server; i have no problem posting to alt.test; and i'm trying to toubleshoot the problem further.) -- http://mail.python.org/mailman/listinfo/python-list

Re: simple and fast platform independent IPC

2010-02-03 Thread Paul Rubin
News123 writes: > I'm having a few python scripts all running on the same host (linux or > win), which are started manually in random order. (no common parent process) > Each process might be identified by an integer (1,2,3) or by a symbolic > name ( 'dad' , 'mom' , 'dog' ) If they are running on

Re: Dreaming of new generation IDE

2010-02-03 Thread Paul Rubin
Vladimir Ignatov writes: > I notice however, that "maintaining" existing/older python code is may > be not so enjoyable task. It may be even harder than supporting old > code written in some type of "static" languages (like Java or C++). > Surely "dynamic" nature of python comes with price. Yes,

Re: Dreaming of new generation IDE

2010-02-03 Thread Adam Tauno Williams
On Wed, 2010-02-03 at 14:10 +0300, Vladimir Ignatov wrote: > Hello, > I am sitting here for quite some time, but usually keep silent ;-) I > use Python since 2003 both "professionally" and for my hobby projects > and love it a much. > I notice however, that "maintaining" existing/older python code

Re: Dreaming of new generation IDE

2010-02-03 Thread Stefan Behnel
Paul Rubin, 03.02.2010 14:07: >> Instead of current text-oriented IDEs, it >> should be a database-centric and resemble current CAD systems > > I've never used a current CAD system, so I can't make any sense of this. > I don't see how databases would help. Just like they help in current IDEs t

Re: Logging oddity: handlers mandatory in every single logger?

2010-02-03 Thread Jean-Michel Pichavant
Masklinn wrote: On 3 Feb 2010, at 11:50 , Jean-Michel Pichavant wrote: You don't neeed to check the code for that ! It is written in the documentation. The logging module designer choose to ask for a level, not a level name, possibly because 2 different levels can have the same name.

Re: Dreaming of new generation IDE

2010-02-03 Thread Stefan Behnel
Adam Tauno Williams, 03.02.2010 14:18: > This is obvious even in the Python documentation itself where one > frequently asks oneself "Uhh... so what is parameter X supposed to be... > a string... a list... ?" > > Not knocking Python; Python is great. I maintain a rapidly growing > Python code ba

Re: Dreaming of new generation IDE

2010-02-03 Thread Jean-Michel Pichavant
Adam Tauno Williams wrote: Yes, it certainly does. Not that you'll get many Pythonistas to confess to that fact. Somehow those who brag about the readability and expressiveness of source code just cannot admit that: class.method(sting name, int count) - is *obviously* more expressive than -

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
> This is obvious even in the Python documentation itself where one > frequently asks oneself "Uhh... so what is parameter X supposed to be... > a string... a list... ?" Exactly. Often I don't need to know the exact type, but to figure out that "kind of type" it is. >> should be a database-centri

Re: How to guard against bugs like this one?

2010-02-03 Thread kj
Steve, I apologize for the snarkiness of my previous reply to you. After all, I started the thread by asking the forum for advice on how to avoid a certain kind of bugs, you were among those who gave me advice. So nothing other than thanking you for it was in order. I just let myself get carried

Re: Dreaming of new generation IDE

2010-02-03 Thread Marco Salden
On Feb 3, 12:10 pm, Vladimir Ignatov wrote: > Hello, > > I am sitting here for quite some time, but usually keep silent ;-) I > use Python since 2003 both "professionally" and for my hobby projects > and love it a much. > I notice however, that "maintaining" existing/older python code is may > be

Re: Dreaming of new generation IDE

2010-02-03 Thread Paul Rubin
Jean-Michel Pichavant writes: > class.method(string name, int count): > """Return the cap'tain's age. > >name: a string giving the name of the cap'tain daughter >count: an int giving the number of fingers left in the cap'tain > right hand > """ > > In python, attributes/parameters have no

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
> The maintenance thing may be true but for me that doesn't outweigh the > clear benefits I get from using Python i.s.o. e.g. C++: the fact that > I have much less code that is more compact and for me more directly > readable is a clear advantage when doing maintance on code I didnt > touch for a w

Re: Need help with a program

2010-02-03 Thread Nobody
On Tue, 02 Feb 2010 15:07:05 -0800, Aahz wrote: >>If you have a problem and you think that regular expressions are the >>solution then now you have two problems. Regex is really overkill for >>the OP's problem and it certainly doesn't improve readability. > > If you're going to use a quote, it w

Re: Dreaming of new generation IDE

2010-02-03 Thread Stef Mientki
> Yes, it certainly does. Not that you'll get many Pythonistas to confess > to that fact. Somehow those who brag about the readability and > expressiveness of source code just cannot admit that: > > class.method(sting name, int count) > > - is *obviously* more expressive than - > > class.method(n

Re: Dreaming of new generation IDE

2010-02-03 Thread David Cournapeau
On Wed, Feb 3, 2010 at 10:18 PM, Adam Tauno Williams wrote: > On Wed, 2010-02-03 at 14:10 +0300, Vladimir Ignatov wrote: >> Hello, >> I am sitting here for quite some time, but usually keep silent ;-) I >> use Python since 2003 both "professionally" and for my hobby projects >> and love it a much.

Re: Dreaming of new generation IDE

2010-02-03 Thread Stef Mientki
Finally I develop a feeling that strong instrumentation / tools can > bring us the best of two worlds. That I am dreaming on is an absolute > new type/class of IDE suitable for Python and potentially for other > dynamic-type languages. Instead of current text-oriented IDEs, it > should be a databa

Re: Dreaming of new generation IDE

2010-02-03 Thread Adam Tauno Williams
On Wed, 2010-02-03 at 16:23 +0100, Stef Mientki wrote: > Yes, it certainly does. Not that you'll get many Pythonistas > to confess > to that fact. Somehow those who brag about the readability > and > expressiveness of source code just cannot admit that: >

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
> I don't see what the advantage of the use of a database is in a fairly > linear hierarchical structure like python objects and modules. Imagine simple operation like "method renaming" in a simple "dumb" environment like text editor + grep. Now imagine how simple it can be if system "knows" all y

Background Zones in Pylab Plot

2010-02-03 Thread Wanderer
I would like to add background zones in pylab plots. Colored sections of the background that the curves pass through. Is this possible? My google searches don't turn up anything but maybe my search terms aren't the right ones. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Dreaming of new generation IDE

2010-02-03 Thread Stef Mientki
On 03-02-2010 16:48, Vladimir Ignatov wrote: I don't see what the advantage of the use of a database is in a fairly linear hierarchical structure like python objects and modules. Imagine simple operation like "method renaming" in a simple "dumb" environment like text editor + grep. Now ima

Re: converting XML to hash/dict/CustomTreeCtrl

2010-02-03 Thread Nobody
On Wed, 03 Feb 2010 08:07:50 +1100, Astan Chee wrote: > Sorry for being vague but here my question about converting an xml into > a dict. I found some examples online but none gives the dict/result I > want. > Which is kinda wrong. I expect the dict to have the "Space usage > summary", but it

RE: Dreaming of new generation IDE

2010-02-03 Thread banibrata.du...@gmail.com
-Original Message- From: Vladimir Ignatov Sent: 03/02/2010 7:24:26 pm Subject: Re: Dreaming of new generation IDE > This is obvious even in the Python documentation itself where one > frequently asks oneself "Uhh... so what is parameter X supposed to be... > a string... a list... ?" Exa

Re: How to guard against bugs like this one?

2010-02-03 Thread kj
In kj writes: >Steve, I apologize for the snarkiness of my previous reply to you. >After all, I started the thread by asking the forum for advice on >how to avoid a certain kind of bugs, you were among those who gave >me advice. So nothing other than thanking you for it was in order. >I just l

Re: ANN: GMPY 1.11 released

2010-02-03 Thread casevh
On Feb 2, 10:03 pm, Mensanator wrote: > On Feb 2, 12:45 am, casevh wrote: > > > > > Everyone, > > > I'm pleased to annouce the final release of GMPY 1.11. > > GMPY is a wrapper for the MPIR or GMP multiple-precision > > arithmetic library. GMPY 1.11 is available for download from: > > >http://cod

Re: Wrap a function

2010-02-03 Thread Aahz
In article , Dennis Lee Bieber wrote: > > I shall blaspheme, and suggest that maybe the language you want to >use is REXX (ooREXX or Regina). > > By default, ANY statement that can not be confused for a REXX >language statement is sent to the currently defined command handler >(Which

Re: test -- please ignore

2010-02-03 Thread Aahz
In article , kj wrote: > >I figured out the immediate reason for the failure: when replying >to *certain posts*, my newsreader omits the Newsgroups header from >the response. Why it does this is still a mystery to me, but at >least now I know what to look out for. Then again, I use the >"venera

Re: How to guard against bugs like this one?

2010-02-03 Thread Nobody
On Tue, 02 Feb 2010 10:38:53 -0800, Carl Banks wrote: >> I don't know if that's necessary. Only supporting the "foo.h" case would >> work fine if Python behaved like gcc, i.e. if the "current directory" >> referred to the directory contain the file performing the import rather >> than in the proce

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
>> Imagine simple operation like "method renaming" in a simple "dumb" >> environment like text editor + grep. Now imagine how simple it can be >> if system "knows" all your identifiers and just regenerates relevant >> portions of text from internal database-alike representation. >> > > I think ever

Trouble with os.system

2010-02-03 Thread Cpa
Hi there, I'm having some trouble with os.system on Fedora 12. I have a bunch of .tex files in tmp/ and I want to compile them. In my shell, the following commands work perfectly : 'for file in tmp/ *.tex; do pdflatex "$file"; done'. But if I use the same command using os.system(), it will compil

Re: Trouble with os.system

2010-02-03 Thread Gerald Britton
Can you post your code? On Wed, Feb 3, 2010 at 12:47 PM, Cpa wrote: > Hi there, > > I'm having some trouble with os.system on Fedora 12. > I have a bunch of .tex files in tmp/ and I want to compile them. > In my shell, the following commands work perfectly : 'for file in tmp/ > *.tex; do pdflatex

Re: Trouble with os.system

2010-02-03 Thread Cpa
Sure. import sys,re,os files2create = sys.argv[1:] os.system('mkdir tmp') # Some code to create the .tex # Compile tex files os.system('for file in tmp/*; do pdflatex "$file"; done') Pretty simple, alas. -- Cpa On 3 fév, 18:54, Gerald Britton wrote: > Can you post your code? > > > > On Wed,

Passing parameters in URL

2010-02-03 Thread Alan Harris-Reid
I have a web-page where each row in a grid has edit/delete buttons to enable the user to maintain a selected record on another page. The buttons are in the form of a link with href='/item_edit?id=123', but this string appears in the URL and gives clues as to how to bypass the correct sequence

Re: Trouble with os.system

2010-02-03 Thread Gerald Britton
It kinda worked for me but I had to change it a little: os.system('for file in /tmp/*.tex; do pdflatex "$file"; done') Maybe you're picking up other files in /tmp that are not .tex files? On Wed, Feb 3, 2010 at 12:58 PM, Cpa wrote: > Sure. > > import sys,re,os > files2create = sys.argv[1:] > o

Re: Dreaming of new generation IDE

2010-02-03 Thread Phlip
On Feb 3, 3:10 am, Vladimir Ignatov wrote: > Finally I develop a feeling that strong instrumentation / tools can > bring us the best of two worlds. That I am dreaming on is an absolute > new type/class of IDE suitable for Python and potentially for other > dynamic-type languages. Instead of curre

Re: ANN: GMPY 1.11 released

2010-02-03 Thread Mensanator
On Feb 3, 10:37 am, casevh wrote: > On Feb 2, 10:03 pm, Mensanator wrote: > > > > > > > On Feb 2, 12:45 am, casevh wrote: > > > > Everyone, > > > > I'm pleased to annouce the final release of GMPY 1.11. > > > GMPY is a wrapper for the MPIR or GMP multiple-precision > > > arithmetic library. GMPY

Re: Dreaming of new generation IDE

2010-02-03 Thread John Bokma
Vladimir Ignatov writes: > Finally I develop a feeling that strong instrumentation / tools can > bring us the best of two worlds. That I am dreaming on is an absolute > new type/class of IDE suitable for Python and potentially for other > dynamic-type languages. Instead of current text-oriented I

Re: ANN: GMPY 1.11 released

2010-02-03 Thread casevh
On Feb 3, 10:22 am, Mensanator wrote: > On Feb 3, 10:37 am, casevh wrote: > > > > > On Feb 2, 10:03 pm, Mensanator wrote: > > > > On Feb 2, 12:45 am, casevh wrote: > > > > > Everyone, > > > > > I'm pleased to annouce the final release of GMPY 1.11. > > > > GMPY is a wrapper for the MPIR or GMP

Re: Trouble with os.system

2010-02-03 Thread Cpa
No, the tmp folder only contains files, and your modification still won't work for me. By the way I have the same error if I do: files2compile = os.listdir('./tmp/') for f in files2compile: os.system('pdflatex '+f) -- Cp On 3 fév, 19:08, Gerald Britton wrote: > It kinda worked for me but I

Selenium/SauceLabs OpenSpace at Pycon

2010-02-03 Thread Raymond Hettinger
For those who are interested, the Sauce Labs team, http://saucelabs.com/about/team, is hosting two free tutorial open space sessions at Pycon in Atlanta. In the short session, people bringing their laptops should be able to record a web session in their browser, convert the recorded activity to a

Re: Dreaming of new generation IDE

2010-02-03 Thread Stef Mientki
On 03-02-2010 18:21, Vladimir Ignatov wrote: Imagine simple operation like "method renaming" in a simple "dumb" environment like text editor + grep. Now imagine how simple it can be if system "knows" all your identifiers and just regenerates relevant portions of text from internal database-alike

Re: Dreaming of new generation IDE

2010-02-03 Thread Adam Tauno Williams
On Wed, 2010-02-03 at 10:05 -0800, Phlip wrote: > On Feb 3, 3:10 am, Vladimir Ignatov wrote: > > Finally I develop a feeling that strong instrumentation / tools can > > bring us the best of two worlds. That I am dreaming on is an absolute > > new type/class of IDE suitable for Python and potential

Python-URL! - weekly Python news and links (Feb 3)

2010-02-03 Thread Gabriel Genellina
QOTW: "I think, in the spirit of the topic, they should hold it at both places at the same time." - Brian Blais, on whether the Python Concurrency Workshop, v2.0, should be in Chicago or Denver (in January!) The fastest way to consume an iterable until exhaustion: http://groups.googl

Re: converting XML to hash/dict/CustomTreeCtrl

2010-02-03 Thread Astan Chee
Nobody wrote: The code you're using expects the XML to follow a particular format, and yours doesn't. You might want to start with a fairly direct translation, e.g.: def xmldict(e): d = {} d['tag'] = e.tag d.update(e.attrib) children = map(xmldict, e) if children: d[

Re: Trouble with os.system

2010-02-03 Thread Jerry Hill
On Wed, Feb 3, 2010 at 12:58 PM, Cpa wrote: > Sure. > > import sys,re,os > files2create = sys.argv[1:] > os.system('mkdir tmp') > > # Some code to create the .tex > > # Compile tex files > os.system('for file in tmp/*; do pdflatex "$file"; done') > > Pretty simple, alas. I think your bug is in th

Re: Trouble with os.system

2010-02-03 Thread Charles-Pierre Astolfi
That was it ! What a stupid error... Thank you ! -- Cp On Wed, Feb 3, 2010 at 20:13, Jerry Hill wrote: > On Wed, Feb 3, 2010 at 12:58 PM, Cpa wrote: >> Sure. >> >> import sys,re,os >> files2create = sys.argv[1:] >> os.system('mkdir tmp') >> >> # Some code to create the .tex >> >> # Compile t

Re: How to guard against bugs like this one?

2010-02-03 Thread Steve Holden
Don't give it another thought. I'd much rather you cared than you didn't ... regards Steve kj wrote: > > Steve, I apologize for the snarkiness of my previous reply to you. > After all, I started the thread by asking the forum for advice on > how to avoid a certain kind of bugs, you were among t

Re: How to guard against bugs like this one?

2010-02-03 Thread Steve Holden
kj wrote: > In kj writes: > > >> Steve, I apologize for the snarkiness of my previous reply to you. >> After all, I started the thread by asking the forum for advice on >> how to avoid a certain kind of bugs, you were among those who gave >> me advice. So nothing other than thanking you for it

The best library to create charting application

2010-02-03 Thread mk
The application will display (elaborate) financial charts. Pygame? Smth else? dotnet? Regards, mk -- http://mail.python.org/mailman/listinfo/python-list

Re: Dreaming of new generation IDE

2010-02-03 Thread Phlip
On Feb 3, 10:57 am, Adam Tauno Williams wrote: > > Current editors suck because they can't see into the code and browse > > it - unless it's so statically typed it's painful. > > ?  I edit Python in MonoDevelop  2.2;  and I can browse my file, > classes, etc...  So I don't know what you mean by "

Re: The best library to create charting application

2010-02-03 Thread Phlip
mk wrote: The application will display (elaborate) financial charts. Pygame? Smth else? Back in the day it was Python BLT. Are you on the Web or the Desktop? -- Phlip http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html -- http://mail.python.org/mailman/listi

Re: The best library to create charting application

2010-02-03 Thread mk
Phlip wrote: mk wrote: The application will display (elaborate) financial charts. Pygame? Smth else? Back in the day it was Python BLT. Are you on the Web or the Desktop? Desktop, really (there should be some nominal web interface but the main application will be desktop) Regards, mk

Re: exec within function

2010-02-03 Thread Terry Reedy
On 2/3/2010 3:30 AM, Simon zack wrote: hi, I'm not sure how I can use exec within a function correctly here is the code i'm using: def a(): exec('b=1') print(b) a() this will raise an error, but I would like to see it outputting 1 Always **copy and paste** **complete error tracebac

Re: simple and fast platform independent IPC

2010-02-03 Thread Terry Reedy
On 2/3/2010 6:31 AM, Joan Miller wrote: I've read that Pyro is not safe. That's a fairly broad thing to say. I've read lots of things. What does "is not safe" mean, in any case? I assume you've got a valid concern in mind which is worth passing on to a would-be user, but what exactly is it? FW

Re: Dreaming of new generation IDE

2010-02-03 Thread John Bokma
Phlip writes: > On Feb 3, 10:57 am, Adam Tauno Williams > wrote: > >> > Current editors suck because they can't see into the code and browse >> > it - unless it's so statically typed it's painful. >> >> ?  I edit Python in MonoDevelop  2.2;  and I can browse my file, >> classes, etc...  So I don

Re: The best library to create charting application

2010-02-03 Thread John Bokma
mk writes: > The application will display (elaborate) financial charts. > > Pygame? Smth else? You might want to check out the book "Beginning Python Visualisation". -- John Bokma j3b Hacking & Hiking in Mexico - http://johnbokma.

Re: expy 0.5.2 released

2010-02-03 Thread Terry Reedy
On 2/3/2010 1:43 AM, Yingjie Lan wrote: Hi, expy is an expressway to extend python. in release 0.5.2, expy now supports custom exceptions, besides all built-in ones, and exception handling is made easy. for more info, see http://expy.sourceforge.net/ What Python versions does it work with?

Re: exec within function

2010-02-03 Thread Gerald Britton
I get no error: >>> def a(): ... exec('b=1') ... print(b) ... >>> a() 1 >>> On Wed, Feb 3, 2010 at 2:59 PM, Terry Reedy wrote: > On 2/3/2010 3:30 AM, Simon zack wrote: >> >> hi, >> I'm not sure how I can use exec within a function correctly >> here is the code i'm using: >> >> def a(): >>    

Re: Wrap a function

2010-02-03 Thread Dan Stromberg
Joan Miller wrote: On 28 ene, 21:40, Jonathan Gardner wrote: On Jan 28, 10:20 am, Joan Miller wrote: I've to call to many functions with the format: run("cmd") were "cmd" is a command with its arguments to pass them to the shell and run it, i.e. run("

Re: newbie qns : how do i use xmldiff?

2010-02-03 Thread Terry Reedy
On 2/3/2010 1:38 AM, sWrath swrath wrote: Hi , I am pretty new to python , and reading up on it. Basically I am trying to compare xml files . I know difflib have it but it does not work out as expected. I was looking at xmldiff , unfortunately I am not able to find documentation how to call it

Re: ANN: GMPY 1.11 released

2010-02-03 Thread Mensanator
On Feb 3, 12:36 pm, casevh wrote: > On Feb 3, 10:22 am, Mensanator wrote: > > > Historically, gmpy really didn't have alpha/beta/rc versions and > gmpy.version() just had the version "number" and didn't indicate the > status. If I change it, I'd rather go to "1.1.1rc1" or "1.2.0a0" but > that mig

Re: Wrap a function

2010-02-03 Thread Dan Stromberg
Ben Finney wrote: Dennis Lee Bieber writes: On Thu, 28 Jan 2010 11:24:28 -0800 (PST), Joan Miller: On 28 ene, 19:16, Josh Holland wrote: Check the docs on os.system(). No. I've a function that uses subprocess to run commands on the same shell and so substitute to ba

Re: Dreaming of new generation IDE

2010-02-03 Thread Robert
Vladimir Ignatov wrote: dynamic-type languages. Instead of current text-oriented IDEs, it should be a database-centric and resemble current CAD systems instead of being just "fancy text editor". Source text should be an output product of that CAD and not a "source material" itself. can you sket

Re: Dreaming of new generation IDE

2010-02-03 Thread Phlip
John Bokma wrote: > my $x = ( 5, "hello", sub {}, [], {} )[ int rand 5 ]; > > what's $x? The answer is: it depends. That's why my blog post advocated (as usual for me) developer tests. Then you either mock the rand, like all developers should, or you get what you pay for, and Principle of Least S

Re: Logging oddity: handlers mandatory in every single logger?

2010-02-03 Thread Vinay Sajip
On Feb 3, 11:36 am, Masklinn wrote: Well, Xavier, I would be the first to agree that the existing logging configuration API is not ideal. There are a number of reasons for the current ConfigParser schema used (e.g. an old GUI for configuring logging, which was there before the logging package wa

Re: exec within function

2010-02-03 Thread Peter Otten
Gerald Britton wrote: > On Wed, Feb 3, 2010 at 2:59 PM, Terry Reedy wrote: >> On 2/3/2010 3:30 AM, Simon zack wrote: >>> >>> hi, >>> I'm not sure how I can use exec within a function correctly >>> here is the code i'm using: >>> >>> def a(): >>> exec('b=1') >>> print(b) >>> >>> a() >>> >>> this w

Re: Dreaming of new generation IDE

2010-02-03 Thread John Bokma
Phlip writes: > John Bokma wrote: > >> my $x = ( 5, "hello", sub {}, [], {} )[ int rand 5 ]; >> >> what's $x? The answer is: it depends. > > That's why my blog post advocated (as usual for me) developer tests. > Then you either mock the rand, like all developers should, or you get > what you pay

Re: How to guard against bugs like this one?

2010-02-03 Thread Dan Stromberg
kj wrote: I just spent about 1-1/2 hours tracking down a bug. An innocuous little script, let's call it buggy.py, only 10 lines long, and whose output should have been, at most two lines, was quickly dumping tens of megabytes of non-printable characters to my screen (aka gobbledygook), and in th

Re: Dreaming of new generation IDE

2010-02-03 Thread John Bokma
Robert writes: > Vladimir Ignatov wrote: >> dynamic-type languages. Instead of current text-oriented IDEs, it >> should be a database-centric and resemble current CAD systems instead >> of being just "fancy text editor". Source text should be an output >> product of that CAD and not a "source mat

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Steven D'Aprano
On Wed, 03 Feb 2010 11:55:57 +0100, Daniel Fetchinson wrote: [...] >> Python does most of that for you: it automatically recompiles the >> source whenever the source code's last modified date stamp is newer >> than that of the byte code. So to a first approximation you can forget >> all about the

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
> can you sketch an example/use case more concretely? Sorry, I don't have anything written down. I just have some rough idea of implementation and some concrete features I would like to see in such system. For example: 1) Instant refactoring. No more needs for manual search/inspect/rename. Since

Re: Dreaming of new generation IDE

2010-02-03 Thread Robert Kern
On 2010-02-03 14:40 PM, Robert wrote: Vladimir Ignatov wrote: dynamic-type languages. Instead of current text-oriented IDEs, it should be a database-centric and resemble current CAD systems instead of being just "fancy text editor". Source text should be an output product of that CAD and not a "

Re: Python and Ruby

2010-02-03 Thread Jonathan Gardner
On Feb 2, 9:11 pm, John Bokma wrote: > Jonathan Gardner writes: > > I can explain, in an hour, every single feature of the Python language > > to an experienced programmer, all the way up to metaclasses, > > Either you're a hell of a talker, or I am far, far away from being an > experienced progr

Re: Dreaming of new generation IDE

2010-02-03 Thread Vladimir Ignatov
> I guess Vladimir means what's called a structure editor. The (by me) > aforementioned Synthesizer Generator is an example of such an editor > (environment). Maybe. Yes, it kind of "generator". It has (entered somehow) internal representation of target program. Then it generates code out of this

Re: Dreaming of new generation IDE

2010-02-03 Thread Steven D'Aprano
On Wed, 03 Feb 2010 08:18:40 -0500, Adam Tauno Williams wrote: > On Wed, 2010-02-03 at 14:10 +0300, Vladimir Ignatov wrote: >> Hello, >> I am sitting here for quite some time, but usually keep silent ;-) I >> use Python since 2003 both "professionally" and for my hobby projects >> and love it a mu

Re: Dreaming of new generation IDE

2010-02-03 Thread Steven D'Aprano
On Wed, 03 Feb 2010 06:42:52 -0800, Paul Rubin wrote: > One nice trick with static types is if you change > what the method does (even if its type signature doesn't change), you > can rename the method: > >class.method2(string name, int count): # change 'method' to >'method2' > > and re

Re: Dreaming of new generation IDE

2010-02-03 Thread Steven D'Aprano
On Wed, 03 Feb 2010 18:48:12 +0300, Vladimir Ignatov wrote: > Imagine simple operation like "method renaming" in a simple "dumb" > environment like text editor + grep. Now imagine how simple it can be if > system "knows" all your identifiers and just regenerates relevant > portions of text from i

Re: Dreaming of new generation IDE

2010-02-03 Thread Steven D'Aprano
On Wed, 03 Feb 2010 10:39:53 -0500, Adam Tauno Williams wrote: > On Wed, 2010-02-03 at 16:23 +0100, Stef Mientki wrote: >> Yes, it certainly does. Not that you'll get many Pythonistas >> to confess >> to that fact. Somehow those who brag about the readability and >>

Re: simple and fast platform independent IPC

2010-02-03 Thread News123
Tim Golden wrote: > >> Anyway, you have in mind that respect to speed: >> >> shared memory> named pipes> Unix domain socket> TCP socket > > True, but the OP didn't mention speed; rather simplicity. Not > saying it isn't a consideration but premature optimisation and > all that... > Yes true.

PyChecker under python's virtualenv

2010-02-03 Thread soltys
Hi Everybody, I've been doing some test on pythons' virtualenv and recently I've decided to run PyChecker. But I'm having some difficulties with importing modules available only on virtualenv by pychecker. As if it was trying to use systemwide python. I've googled about it, and found nothing in th

Re: Python and Ruby

2010-02-03 Thread Robert Kern
On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand all of Python in an hour. With all respect, talking about a subject without a reasonable chance of your audience understanding the subject afterwards is not explaining. It's

Re: Wrap a function

2010-02-03 Thread Ben Finney
Dan Stromberg writes: > Ben Finney wrote: > > It's no sin to say that Python isn't a good choice for specific > > things; and “I want to write programs by indistinguishably mixing > > statements with external system calls” is one of them, IMO > > From > http://stromberg.dnsalias.org/~dstromberg

  1   2   >