[Pmw] reusing a graph after deleting a curve

2005-03-10 Thread giacomo boffi
my question: is it possible to erase a graph, and reuse it? like in # x - compute - y g=Pmw.Blt.Graph(); g.pack() g.line_create(name,x,y) # other computing - a better y # do something to g, erasing the previous plot #[the above is the part that i cannot understand...]

Re: [Pmw] reusing a graph after deleting a curve

2005-03-16 Thread giacomo boffi
giacomo boffi [EMAIL PROTECTED] writes: my question: is it possible to erase a graph, and reuse it? like in # x - compute - y g=Pmw.Blt.Graph(); g.pack() g.line_create(name,x,y) # other computing - a better y # do something to g, erasing the previous plot #[the above is the part

tkinter+matplotlib

2006-03-27 Thread Giacomo Boffi
i have coded some progs that use the Pmw.Blt.Graph widgets, embedded in a simple Tkinter GUI , | from Tkinter import * | import Pmw | ... | frame=Frame(root) | ... | graph=Pmw.Blt.Graph(frame,...) | graph.line_create(...) | graph.pack(...) ` now i'd like to port those progs to an

[Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
i have this test program (that i already posted on it.comp.lang.python) [ test.py ] from Tkinter import * def output(s): print s def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' - '+c2).pack(side='left',expand=1,fill='both')

Re: [Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
Diez B. Roggisch de...@nospam.web.de writes: Giacomo Boffi wrote: def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' - '+c2).pack(side='left',expand=1,fill='both') Button(subframe,text='',command=lambda: output(c1+'-'+c2

Re: [Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
Giacomo Boffi giacomo.bo...@polimi.it writes: ok, i'll try again following your advice ,[ test.py ] | from Tkinter import * | | def output(s): | print s | | def create_cb(a,b): | return lambda: output(a+'-'+b) | | def doit(fr,lst): | for c1,c2 in zip(lst[::2], lst[1::2

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
Scott David Daniels scott.dani...@acm.org writes: Giacomo Boffi wrote: Giacomo Boffi giacomo.bo...@polimi.it writes: ... | def create_cb(a,b): | return lambda: output(a+'-'+b) | | def doit(fr,lst): | for c1,c2 in zip(lst[::2], lst[1::2]): | subframe=Frame(fr) | Label

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
John Posner jjpos...@optimum.net writes: def output(x,y,op): if op == : print x, ---, y elif op == : print x, ---, y else: print Operation argument error! uh, nice!, i'll adapt this to my real problem thank you John,

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
Terry Reedy tjre...@udel.edu writes: Reedy's Lambda Rule: [detailed explanation omitted] i'm beginning to _understand_ what's going on with my code Terry Jan Reedy thanks, grazie 1000 Terry, g -- Lord, what fools these mortals be! --

Re: Help with cumulative sum

2009-09-11 Thread Giacomo Boffi
Maggie la.f...@gmail.com writes: [...] else: print 'The loop is finito' do you know of it.comp.lang.python? -- Sarebbe essere un atto di pieta'. Contro i miei principi.-- whip, in IFMdI -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-17 Thread Giacomo Boffi
Vlastimil Brom vlastimil.b...@gmail.com writes: As for BLT, there is Pmw.Blt, the original is written in Tcl. doesn't work (dumps core) on debian linux bug #525860: python-pmw triggers segmentation fault in blt not that blt itself is really OK bug #524149: blt: zooming in a graph

Re: Looking for a pure Python chart drawing module

2009-09-17 Thread Giacomo Boffi
John Nagle na...@animats.com writes: gerlos wrote: John Nagle ha scritto: I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Giacomo Boffi
Piet van Oostrum p...@cs.uu.nl writes: Chris Withers ch...@simplistix.co.uk (CW) wrote: CW John Nagle wrote: That's a wrapper for Antigrain (http://www.antigrain.com/;), which is a C++ library. I'm trying hard to avoid dependencies on binary libraries with limited support. Builds exist

Re: Python -- floating point arithmetic

2010-07-08 Thread Giacomo Boffi
Zooko O'Whielacronx zo...@zooko.com writes: I'm starting to think that one should use Decimals by default and reserve floats for special cases. would you kindly lend me your Decimals ruler? i need to measure the sides of the triangle whose area i have to compute --

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-11 Thread Giacomo Boffi
Martin v. Loewis mar...@v.loewis.de writes: If you use the bdist_wininst, bdist_msi, or bdist_rpm distutils commands, you get packages which support uninstallations very well. bdist_deb? -- Vorrei andare a lavorare in Sicilia, a max 15 km dal mare. Con chi devo parlare? Col capomafia

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-16 Thread Giacomo Boffi
Baba raoul...@gmail.com writes: Hi Mel, indeed i thought of generalising the theorem as follows: If it is possible to buy n, n+1,~, n+(x-1) sets of McNuggets, for some x, then it is possible to buy any number of McNuggets = x, given that McNuggets come in x, y and z packs. so with

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-17 Thread Giacomo Boffi
Paul Rubin no.em...@nospam.invalid writes: Baba raoul...@gmail.com writes: exercise: given that packs of McNuggets can only be bought in 6, 9 or 20 packs, write an exhaustive search to find the largest number of McNuggets that cannot be bought in exact quantity. Is that a homework problem?

Re: Recommend Commercial graphing library

2010-04-08 Thread Giacomo Boffi
Grant Edwards inva...@invalid.invalid writes: If it's 2D data, you don't need to use a 3D graph. if it's tabular data, you don't need an uber-histogram -- giampippetto, coso, come si chiama? ah si` MMAX ha scritto: Tra il trascendente e l'interpretazione prevalente del dato come assioma ne

Re: python as pen and paper substitute

2010-04-08 Thread Giacomo Boffi
Manuel Graune manuel.gra...@koeln.de writes: Hello everyone, I am looking for ways to use a python file as a substitute for simple pen and paper calculations. search(embedded calc mode) if manuel in emacs_fellows_set or sys.exit(1) -- http://mail.python.org/mailman/listinfo/python-list

Re: python as pen and paper substitute

2010-04-09 Thread Giacomo Boffi
Manuel Graune manuel.gra...@koeln.de writes: Giacomo Boffi giacomo.bo...@polimi.it writes: Manuel Graune manuel.gra...@koeln.de writes: Hello everyone, I am looking for ways to use a python file as a substitute for simple pen and paper calculations. search(embedded calc mode) if manuel

Re: Generating a rainbow?

2010-04-13 Thread Giacomo Boffi
Tobiah t...@rcsreg.com writes: I'm having a difficult time with this. I want to display a continuous range of hues using HTML hex representation (#RRGGBB). How would I go about scanning through the hues in order to make a rainbow? if you mean real rainbows when you say rainbow, as

[pylint] why pylint wants only capitals identifiers?

2010-04-19 Thread Giacomo Boffi
i have this code def example(a): return lambda b: a+b+1 fun = example(10) k_1 = fun(7) ... and pylint tells me [...] C: 4: Invalid name fun (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$) C: 5: Invalid name k_1 (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$) [...] afaict, [A-Z_][A-Z0-9_]*

Re: [pylint] why pylint wants only capitals identifiers?

2010-04-19 Thread Giacomo Boffi
Jean-Michel Pichavant jeanmic...@sequans.com writes: Giacomo Boffi wrote: i have this code def example(a): return lambda b: a+b+1 fun = example(10) k_1 = fun(7) ... and pylint tells me [...] C: 4: Invalid name fun (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$) C: 5: Invalid

Re: [pylint] why pylint wants only capitals identifiers?

2010-04-19 Thread Giacomo Boffi
Giacomo Boffi giacomo.bo...@polimi.it writes: However, given you example, you should not insert code execution at you module level, unless it's required only at the module import. I dont know what is your module module? this was not well specified in my OP, but i'd rather speak of a script

Re: if, continuation and indentation

2010-06-04 Thread Giacomo Boffi
HH henri...@gmail.com writes: if (width == 0 and height == 0 and color == 'red' and emphasis == 'strong' or highlight 100): raise ValueError(sorry, you lose) if (width == 0 and height == 0 and color == 'red' and emphasis ==

Re: Plotting in batch with no display

2010-06-08 Thread Giacomo Boffi
Hans Georg Schaathun h.schaat...@surrey.ac.uk writes: : import matplotlib : matplotlib.use('agg') : import pylab : pylab.plot([1, 3, 5]) : fig = file('foo.png', 'wb') : pylab.savefig(fig, format='png') : fig.close() Raster graphics is not good enough

Re: Plotting in batch with no display

2010-06-08 Thread Giacomo Boffi
Giacomo Boffi giacomo.bo...@polimi.it writes: Hans Georg Schaathun h.schaat...@surrey.ac.uk writes: : import matplotlib : matplotlib.use('agg') : import pylab : pylab.plot([1, 3, 5]) : fig = file('foo.png', 'wb') : pylab.savefig(fig, format='png

Re: Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-30 Thread Giacomo Boffi
Terry Reedy tjre...@udel.edu writes: On 11/28/2010 3:47 PM, pyt...@bdurham.com wrote: I had planned on subclassing Tkinter.Toplevel() using property() to wrap access to properties like a window's title. After much head scratching and a peek at the Tkinter.py source, I realized that all

Re: Should there be a 'core' python install?

2011-01-20 Thread Giacomo Boffi
Martin P. Hellwig martin.hell...@dcuktec.org writes: Yep when I started looking much more at other toolkits, I started to like Tkinter more and more. Maybe its simplicity, maybe the good design of Tk, -- BOMBED BY AIRCRAFT. SINKING. U-824. --

Re: Problems of Symbol Congestion in Computer Languages

2011-02-18 Thread Giacomo Boffi
Chris Jones cjns1...@gmail.com writes: [...] most any software of note appears to have come out of cultures where English is either the native language, or where the native language is either relatively close to English... i do acknowledge your most, but how do you spell Moon in Portuguese?

Re: Problems of Symbol Congestion in Computer Languages

2011-02-18 Thread Giacomo Boffi
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: A dedicated concatenation operator would have avoided that mess. I don't quite agree that the mess is as large as you make out, but yes, more operators would be useful. am i wrong, or | is still available? -- l'amore e' un

Re: Help with python functions?

2013-09-24 Thread giacomo boffi
kjaku...@gmail.com writes: def temp(T, from_unit, to_unit): conversion_table = {('c', 'k'):lambda x: x + 273.15, ('c', 'f'):lambda x: (x * (9.0/5)) + 32, ('k', 'c'):lambda x: x - 273.15, ('k', 'f'):lambda x: (x *

Re: Handling 3 operands in an expression without raising an exception

2013-09-29 Thread giacomo boffi
Νίκος nikos.gr...@gmail.com writes: IF it can also be written in one-line def f(x,n,w):return(lambda y=f(x[::2],n/2,w[::2]),z=f(x[1::2],n/2,w[::2]):reduce(lambda x,y:x+y,zip(*[(y[k]+w[k]*z[k],y[k]-w[k]*z[k]) for k in range(n/2)])))()if n1 else x -- anch'io la penso come me, ma

Re: Handling 3 operands in an expression without raising an exception

2013-09-29 Thread giacomo boffi
Joel Goldstick joel.goldst...@gmail.com writes: On Sun, Sep 29, 2013 at 11:28 AM, giacomo boffi pec...@pascolo.net wrote: Νίκος nikos.gr...@gmail.com writes: IF it can also be written in one-line def f(x,n,w):return(lambda y=f(x[::2],n/2,w[::2]),z=f(x[1::2],n/2,w [::2

Re: Handling 3 operands in an expression without raising an exception

2013-09-29 Thread giacomo boffi
giacomo boffi pec...@pascolo.net writes: it.comp.python oops, it.comp.LANG.python -- I do desire we may be better strangers. -- https://mail.python.org/mailman/listinfo/python-list

Re: ASCII and Unicode

2013-12-07 Thread giacomo boffi
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Ironically, your post was not Unicode. [...] Your post was sent using a legacy encoding, Windows-1252, also known as CP-1252 i access rusi's post using a NNTP server, and in his post i see Content-Type: text/plain; charset=UTF-8

Re: ASCII and Unicode

2013-12-08 Thread giacomo boffi
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Sat, 07 Dec 2013 17:05:34 +0100, giacomo boffi wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Ironically, your post was not Unicode. [...] Your post was sent using a legacy encoding, Windows-1252, also

Re: Python solve problem with string operation

2014-01-16 Thread giacomo boffi
Nac Temha nacctte...@gmail.com writes: Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 How can I do without

Re: Python solve problem with string operation

2014-01-16 Thread giacomo boffi
giacomo boffi pec...@pascolo.net writes: % python a.py 34131237 % cat a.py i=3443331123377;n=0 while n+1!=len(i):i,n=(i[:n]+i[n+1:],n) if i[n+1]==i[n] else (i,n+1) print i % python a.py 34131237 % -- for Nikos -- https://mail.python.org/mailman/listinfo/python-list

[pyplot] using f1=figure(1)

2011-03-28 Thread Giacomo Boffi
i executed the following interactions and i remained disappointed $ python Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. from pylab import * f1=figure(1) f2=figure(2) f1 matplotlib.figure.Figure object at

Re: [pyplot] using f1=figure(1)

2011-03-28 Thread Giacomo Boffi
Blockheads Oi Oi breamore...@yahoo.co.uk writes: I don't know why but this works fine. f1=figure(1) plot(sin(linspace(0,10)),figure=f1) f2=figure(2) plot(cos(linspace(0,10)),figure=f2) show() it works as well (with a proper t...) plot(sin(t);figure(2);plot(cos(t));show() because that's

Re: [pyplot] using f1=figure(1)

2011-04-04 Thread Giacomo Boffi
eryksun () eryk...@gmail.com writes: figure(fig1.number) plot(...) that's already much better than figure(1);...;figure(2);... Alternatively, you can use the plot methods of a particular axes: fig1 = figure() ax1 = axes() fig2 = figure() ax2 = axes()

Re: Fun python 3.2 one-liner

2011-04-04 Thread Giacomo Boffi
Chris Angelico ros...@gmail.com writes: def f(x,n,w): return x if n==1 else\    (lambda x0=f(x[::2],n/2,w[::2]),\            x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\                                      zip(*[(x0[k]+w[k]*x1[k],\                                            

Re: Convert AWK regex to Python

2011-05-16 Thread Giacomo Boffi
J jnr.gonza...@googlemail.com writes: cat logs/pdu_log_fe.log | awk -F\- '{print $1,$NF}' | awk -F\. '{print $1,$NF}' | awk '{print $1,$4,$5}' | sort | uniq | while read service command status; do echo Service: $service, Command: $command, Status: $status, Occurrences: `grep $service

Re: Hello and sorry for disturbing !

2014-05-27 Thread giacomo boffi
Rustom Mody rustompm...@gmail.com writes: For ubuntu you should need nothing for python. In other words python should run on a basic ubuntu installation. From the shell just type python and the interpreter should start. For more specialized work there are dozens (maybe hundreds?) of

PMW+BLT on windows, any chance?

2012-01-30 Thread Giacomo Boffi
on my linux box i have a small python program that draws some 2-d line graphs in a window aside a graphical interface to change the problem data as you may have guessed from the subject line, the gui widgets are done with help from PMW [1], and the graps are done by the PMW - BLT[2] interface

Re: PyGeo

2010-08-31 Thread Giacomo Boffi
L lamlb...@optusnet.com.au writes: also the PyGeo readme text mentions Numerical python (I think it means Numeric, but I also have NumPy installed) afaict, Numerical python is numpy --- if you look at pygeo home page, the reference to Numerical python is a link to numpy home page on the

Re: [Tutor] Arguments from the command line

2010-09-09 Thread Giacomo Boffi
Dennis Lee Bieber wlfr...@ix.netcom.com writes: FORTRAN just differentiates by having the main file start with PROGRAM random_name whereas subfiles are all either (or both) SUBROUTINE another_name(args) FUNCTION that_other_name(args) no

Re: How Python works: What do you know about support for negative indices?

2010-09-10 Thread Giacomo Boffi
Ben Finney ben+pyt...@benfinney.id.au writes: Raymond Hettinger pyt...@rcn.com writes: It doesn't seem to be common knowledge when and how a[x] gets translated to a[x+len(x)]. So, here's a short info post on how Python supports negative indices for sequences. Thanks for this. Could you

Re: [Tutor] Arguments from the command line

2010-09-10 Thread Giacomo Boffi
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: In message 8662yfklzu@aiuole.stru.polimi.it, Giacomo Boffi wrote: Dennis Lee Bieber wlfr...@ix.netcom.com writes: FORTRAN just differentiates by having the main file start with PROGRAM random_name whereas subfiles are all

Re: [Tutor] Arguments from the command line

2010-09-13 Thread Giacomo Boffi
Dennis Lee Bieber wlfr...@ix.netcom.com writes: On Fri, 10 Sep 2010 12:25:17 +0200, Giacomo Boffi giacomo.bo...@polimi.it declaimed the following in gmane.comp.python.general: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: In message 8662yfklzu@aiuole.stru.polimi.it

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Giacomo Boffi
harryos oswald.ha...@gmail.com writes: hi I have 2 lists of numbers,say x=[2,4,3,1] y=[5,9,10,6] I need to create another list containing z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] I did not want to use numpy or any Array types.I tried to implement this in python .I tried the following

Re: cmd.exe on WIndows - problem with displaying some Unicode characters

2014-08-04 Thread giacomo boffi
Wiktor look@signature.invalid writes: I'm not starting from scratch. I'm using packages 'termcolor', 'colorama' and 'colorconsole' the 'urwid' package could be useful for similar projects but cite requires Linux, OSX, Cygwin or other unix-like OS/cite so I guess it's of no use for you...

Re: while loop - multiple condition

2014-10-14 Thread giacomo boffi
Tim Chase python.l...@tim.thechases.com writes: On 2014-10-12 22:16, Marko Rauhamaa wrote: is equivalent with while ans.lower()[0] != 'y': ans = input('Do you like python?') And still better improved with while ans[:1].lower() != 'y': ans = input('Do you like

Re: [OT] spelling colour / color was Re: Toggle

2014-10-18 Thread giacomo boffi
duncan smith buzzard@invalid.invalid writes: [...] It was the top / bottom of the [TV] programme that I didn't immediately get, because I was thinking of a timeline running left to right (perhaps rather than the script used by the presenters). is it just me that thinks of a timeline running

Re: Question about PANDAS

2014-10-20 Thread giacomo boffi
Ryan Shuell ryanshu...@gmail.com writes: Thanks guys.  I just feel frustrated that I can't do something useful. I had read many of your messages in the recent past, and I'm under the impression that your frustration has more to do with Python the Infrastructure rather than Python the Language

Re: I am out of trial and error again Lists

2014-10-23 Thread giacomo boffi
Rustom Mody rustompm...@gmail.com writes: [As best as I can make out the OP is not using the standalone interpreter nor idle nor (the many options like) python-interpreter-inside-emacs nor ipython nor ... but CodeSkulptor http://www.codeskulptor.org/] CodeSkulptor has been mentioned

Re: I am out of trial and error again Lists

2014-10-23 Thread giacomo boffi
Seymore4Head Seymore4Head@Hotmail.invalid writes: Because most of the practice I am getting is not using Python. I use Codeskulptor. Seymore, it's been months that you're struggling with python, if you happen to own a computer could you please take the time to install python on it and

Re: I am out of trial and error again Lists

2014-10-24 Thread giacomo boffi
ERRATA CORRIGE: many different circumstances, by the very, very helpful folks of clp. many different circumstances, by the very, very helpful folks of clpy -- sapete contare fino a venticinque? Olimpia Milano Jugoplastika Split Partizan Beograd Roberto Premier Duska Ivanovic Zarko Paspalj --

Re: I am out of trial and error again Lists

2014-10-27 Thread giacomo boffi
Rustom Mody rustompm...@gmail.com writes: What would you say to a person who - Buys a Lambhorgini I'd say: Don't buy a Lambhorgini from that nice guy you met at a party, but buy a Lamborghini by an authorized dealer ;-) -- I was a kid when Lamborghini launched the Miura! --

Re: What does zip mean?

2014-11-10 Thread giacomo boffi
On 11/09/2014 11:44 AM, satishmlm...@gmail.com wrote: What does zip return in the following piece of code? To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the bag you have two

Re: What does zip mean?

2014-11-13 Thread giacomo boffi
Grant Edwards invalid@invalid.invalid writes: No, you don't. That's not how a zipper works. Each tooth from side A, isn't bound with one from side B. It's bound with _two_ of them from side B. And each of those is in turn bound with an additional tooth from side A, and so on... In your

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-13 Thread giacomo boffi
Clayton Kirkwood c...@godblessthe.us writes: Although I suspect for a price you could bring all of your professional programming jobs to somebody here, but I think you would pay out more than you would make. s/ here/ else/ and your assumption can be falsified --

Re: Validating Entry in tkinter

2011-07-27 Thread Giacomo Boffi
Saul Spatz saul.sp...@gmail.com writes: In tcl/tk an Entry widget can be set to validate its contents with the validate option. [...] Can one do something like this in tkinter? i read the thread and nobody mentioned the python mega widget (Pmw) toolkit, from whose docs i quote the following

Re: CSV to matrix array

2013-04-13 Thread giacomo boffi
Ana Dionísio anadionisio...@gmail.com writes: Hello! I have a CSV file with 20 rows and 12 columns and I need to store it as a matrix. array=numpy.array([row for row in csv.reader(open('Cenarios.csv'))]) NB: i used array= as in your sample code, BUT --

Re: Python discussed in Nature

2015-02-15 Thread giacomo boffi
Chris Angelico ros...@gmail.com writes: On Sat, Feb 14, 2015 at 6:40 AM, John Ladasky john_lada...@sbcglobal.net wrote: The default font that the Geany program editor uses on my Ubuntu system renders everything I've tried. When I look up that font in Geany's Preferences menu, it is called,