Re: Plot problem.. ?? No sign at all

2010-07-15 Thread Johan Grönqvist
Hi Ritchy, This is the first time I am doing this, but it's a standard response given on lists like this. 2010-07-13 18:17, Ritchy lelis skrev: This is how looks like the flash residue transference function that i was talking about... http://www.iadc.ca/Imran_ADC_tutorial_files/image048.gif

Re: how to install all python plugins

2010-07-15 Thread Johan Grönqvist
2010-07-15 18:18, Daniel Fetchinson skrev: If you mean all python packages that are available through the package manager of ubuntu, then you'll need to search the entire list of available packages using ubuntu's package manager, pick out the ones that have 'python' in their names (presumably, t

Re: Plot problem.. ?? No sign at all

2010-07-11 Thread Johan Grönqvist
2010-07-11 02:12, Ritchy lelis skrev: On 7 jul, 08:38, Johan Grönqvist wrote: About the plot draw it's a curve that it's a set of points wich it's the result of the comput of the Vref and Vi together. I don't know if i had to make a break instruction (like in other's

Re: Plot problem.. ?? No sign at all

2010-07-07 Thread Johan Grönqvist
2010-07-06 19:18, Ritchy lelis skrev: On 6 jul, 17:29, Alan G Isaac wrote: Unfortunately I cannot make sense of the code you posted. Provide a detailed description in words (or psuedocode) of what you are trying to accomplish. Be very careful and detailed is you want a useful response. Alan I

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: Manuel Graune writes: Just as an additional example, let's assume I'd want to add the area of to circles. [...] which can be explained to anyone who knows basic math and is not at all interested in python. Third attempt. The markup now includes tagging of different parts

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: Thanks for your reply. The output should 1) show manually selected python code and comments (whatever I think is important), 2) show selected results (final and intermediate) and 3) *not* show python code that for someone only interested in the calculation and the results

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: To clarify, I just start an editor, write a file that might look something like this: -snip- code=""" a = 1 b = 2 c = 3 result = a + b """ exec(code) print(code) print("result =\t", result) print("result + c =\t", result + c) -snip-- and feed thi

Re: How to know locals of script without running it

2009-10-27 Thread Johan Grönqvist
Nadav Chernin skrev: Is there a way to know locals of the script without running it? As I interpret the question, I believe there is. I think Pylint does what you want. I have no idea how it does it, or how certain it can be to find all locals, but it may give you a place to start looking.

Re: pylab/matplotlib large plot memory management - bug? or tuning parameter needed?

2009-10-20 Thread Johan Grönqvist
bdb112 skrev: Summary: It is not straightforward to avoid memory leaks/consumption in pylab. If we define x = arange(1e6) # adjust size to make the increment visible, yet fast enough to plot # then repetition of plot(x,hold=0) # consumes increasing memory according to ubuntu system monitor

Re: Creating a local variable scope.

2009-09-19 Thread Johan Grönqvist
Sean DiZazzo skrev: I would do something like this: class Namespace(object): ... pass ... n = Namespace() n.f = 2 n.g = 4 print f Traceback (most recent call last): File "", line 1, in ? NameError: name 'f' is not defined print n.f 2 I like this solution. This also minimizes the ex

Re: Creating a local variable scope.

2009-09-19 Thread Johan Grönqvist
Gabriel Genellina skrev: En Fri, 18 Sep 2009 10:55:47 -0300, Johan Grönqvist escribió: Summarizing the answers, it seems that I will try to follow three suggestions: 3) If I define a few values intended to be used very locally, delete those after use. Why bother? Unless they'r

Re: Creating a local variable scope.

2009-09-18 Thread Johan Grönqvist
Thanks for all replies. First, two general comments, and then my conclusions: I did not intend to ask for new features, but my interest was in writing readable code that works in python 2.5, although I may upgrade to 2.6 soon. Also, what I gave was intended as a minimal example, and not a com

Re: Shebang line problems and python

2009-09-16 Thread Johan Grönqvist
Blaine skrev: I'm not sure if there is a Ctrl+Z in here... but, here's the output: bla...@attila ~/tmp $ hexdump shebang-test 000 2123 752f 7273 622f 6e69 702f 7479 6f68 010 0a6e 6d69 6f70 7472 7320 7379 730a 7379 020 732e 6474 756f 2e74 7277 7469 2865 4822 030 6c65 6f6c 202c 6f7

Creating a local variable scope.

2009-09-11 Thread Johan Grönqvist
Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham = (a[eggs], b[spam]) -- The essence is tha