Extracting the value from Netcdf file with longitude and lattitude

2014-05-16 Thread Isaac Won
Hi, My question may be confusing. Now I would like to extract temperature values from model output with python. My model output have separate temperature, longitude and latitude variables. So, I overlap these three grid variables on one figure to show temperature with longitude and latitude thr

Google app engine database

2014-02-22 Thread glenn . a . isaac
Is there a way to make sure that whenever you're making google engine app iterations to a database that that info does not get wiped/deleted. Please advise -- https://mail.python.org/mailman/listinfo/python-list

Drawing shaded area depending on distance with latitude and altitude coordinate

2014-01-06 Thread Isaac Won
er of columns in z, and length of y must be number of rows. IF I use meshgrid for X and Y, I also get: TypeError: Inputs x and y must be 1D or 2D. I just need to draw shaded contour with distance from one point on the top of the plot of each point. If you give any idea or hint, I will really ap

Using MFDataset to combine netcdf files in python

2013-12-02 Thread Isaac Won
h_ref=np.array(Th[:]) print Th.shape I will really appreciate any help, idea, and hint. Thank you, Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: Plot a contour inside a contour

2013-11-14 Thread Isaac Won
On Thursday, November 14, 2013 2:01:39 PM UTC-8, John Ladasky wrote: > On Thursday, November 14, 2013 11:39:37 AM UTC-8, Isaac Won wrote: > > > I tried to plot one smaller contour inside of the other larger contour. > > > > Using what software? A plotting package i

Plot a contour inside a contour

2013-11-14 Thread Isaac Won
plt1) plt.show() My intention is to plot ax2 on the top of ax1 from xdist and ydist = 8 with 18 by 18 size. However, the result seems only showing ax1. I will really appreciate any help or idea. Thank you, Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: using print() with multiprocessing and pythonw

2013-11-12 Thread Isaac Gerg
Thanks for the reply Bill. The problem is the text i am getting is from a python warning message, not one of my own print() function calls. -- https://mail.python.org/mailman/listinfo/python-list

using print() with multiprocessing and pythonw

2013-11-12 Thread Isaac Gerg
can I fix my code so that the print()'s are supressed. I would hate to do a warnings.filterwarnings('ignore') because when I unit test those functions, the warnings dont appear. Thanks in advance, Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
functions which read from the file. Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:49 PM, Isaac Gerg wrote: > > > > On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > >> On 10/10/13 12:44 PM, Isaac Gerg wrote: >> >>> Sorry, I am just providing pseudo code since I the code i have is quite >>> large

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > On 10/10/13 12:44 PM, Isaac Gerg wrote: > >> Sorry, I am just providing pseudo code since I the code i have is quite >> large. >> >> As I mentioned, the code works fine when I remove the multirpcessing >&

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
example here: http://stackoverflow.com/questions/948119/preventing-file-handle-inheritance-in-multiprocessing-lib None of the solutions posted work. On Thursday, October 10, 2013 12:38:19 PM UTC-4, Piet van Oostrum wrote: > Isaac Gerg writes: > > > > > I have a function t

Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
ing on here? Thanks in advance, Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Isaac To
On Sat, Jun 29, 2013 at 9:36 AM, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: > >> >> Libraries should not call sys.exit, or raise SystemExit. Whether to quit >> or not is not the library's decision to make, that decision belongs to >> the application layer. Yes, the appli

Re: I hate you all

2013-04-05 Thread Isaac To
You underestimated the arrogance of Python. Python 3 tab doesn't map to 4 spaces. It doesn't map to any number of spaces. Tabs and spaces are completely unrelated. If you have a function having the first indentation level with 4 (or any number of) spaces, the next line starting not with 4 space

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-09 Thread Isaac To
In general, it is hard for any process to return the memory the OS allocate to it back to the OS, short of exiting the whole process. The only case that this works reliably is when the process allocates a chunk of memory by mmap (which is chosen by libc if it malloc or calloc a large chunk of memo

Putting the loop inside of loop properly

2013-03-01 Thread Isaac Won
mulated to m1. However, it doesn't work and fpsd values in and out of the last loop are totally different. My question is clear? Any help or questions would be really appreciated. Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
Thank you Ulich for reply, What I really want to get from this code is m1 as I told. For this purpose, for instance, values of fpsd upto second loop and that from third loop should be same, but they are not. Actually it is my main question. Thank you, Isaac On Friday, March 1, 2013 6:00:42 AM

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > > for columns in ( raw.strip().split() for raw in f ): > > > while d <335: > > > > Note

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
Thank you, Chris. I just want to acculate value from y repeatedly. If y = 1,2,3...10, just have a [1,2,3...10] at onece. On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > >

Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
try to make my triple nested loop working. My code would be: c = 4 y1 = [] m1 = [] std1 = [] while c <24: c = c + 1 a = [] f.seek(0,0) for columns in ( raw.strip().split() for raw in f ): a.append(columns[c])

Re: Import redirects

2013-02-11 Thread Isaac To
On Mon, Feb 11, 2013 at 8:27 PM, Oscar Benjamin wrote: > On 11 February 2013 06:50, Isaac To wrote: > > Except one thing: it doesn't really work. If I `import foo.baz.mymod` > now, > > and if in "bar.baz.mymod" there is a statement `import bar.baz.depmod`, &

Import redirects

2013-02-10 Thread Isaac To
I have a package (say "foo") that I want to rename (say, to "bar"), and for compatibility reasons I want to be able to use the old package name to refer to the new package. Copying files or using filesystem symlinks is probably not the way to go, since that means any object in the modules of the p

About a value error called 'ValueError: A value in x_new is below the interpolation range'

2013-02-05 Thread Isaac Won
h1, p1, 'o') plt.xlabel('Distance(km)') plt.ylabel('Correlation coefficient') plt.grid(True) plt.show() --- For any help or advice, I will really appreciate. Best regards, Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 10:51:43 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 14:57, Isaac Won wrote: > > > On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: > > >> On 23 January 2013 14:28, Isaac Won wrote: > > >> &g

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 14:28, Isaac Won wrote: > > > On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > > > > > > To Oscar > > > My actual error message is: >

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 2:55:14 AM UTC-6, Ulrich Eckhardt wrote: > Am 23.01.2013 05:06, schrieb Isaac Won: > > > I have tried to use different interpolation methods with Scipy. My > > > code seems just fine with linear interpolation, but shows memory > > >

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 08:55, Ulrich Eckhardt > > > > > Am 23.01.2013 05:06, schrieb Isaac Won: > > > > > >> I have tried to use different interpolation methods with Scipy. My &

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 08:55, Ulrich Eckhardt > > wrote: > > > Am 23.01.2013 05:06, schrieb Isaac Won: > > > > > >> I have tried to use different interpolation methods with Scipy. My &

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Tuesday, January 22, 2013 10:06:41 PM UTC-6, Isaac Won wrote: > Hi all, > > > > I have tried to use different interpolation methods with Scipy. My code seems > just fine with linear interpolation, but shows memory error with quadratic. I > am a novice for python. I wil

Memory error with quadratic interpolation

2013-01-22 Thread Isaac Won
The number of data is 31747. Thank you, Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: avoding the accumulation of array when using loop.

2013-01-02 Thread Isaac Won
On Wednesday, January 2, 2013 5:54:18 PM UTC-6, Dave Angel wrote: > On 01/02/2013 05:21 PM, Isaac Won wrote: > > > Hi all, > > > > > > Thanks to Hans, I have had a good progress on my problem. > > > > > > Followings are Hans's Id

avoding the accumulation of array when using loop.

2013-01-02 Thread Isaac Won
. Do you guys have any idea? I will really appreciate ant help and idea. Thanks, Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about nested loop

2012-12-31 Thread Isaac Won
On Monday, December 31, 2012 6:59:34 AM UTC-6, Hans Mulder wrote: > On 31/12/12 11:02:56, Isaac Won wrote: > > > Hi all, > > > I am a very novice for Python. Currently, I am trying to read continuous > > > columns repeatedly in the form of array.

Re: Question about nested loop

2012-12-31 Thread Isaac Won
On Monday, December 31, 2012 5:25:16 AM UTC-6, Gisle Vanem wrote: > "Isaac Won" wrote: > > > > > while c < 10: > > >c = c + 1 > > > > > >for columns in ( raw.strip().split() for raw in f ): > > > > &

Question about nested loop

2012-12-31 Thread Isaac Won
m more? I really appreciate any help. Thank you, Isaac -- http://mail.python.org/mailman/listinfo/python-list

Komodo, Python

2012-06-15 Thread Isaac@AU
I just started learning python. I have komodo2.5 in my computer. And I installed python2.7. I tried to write python scripts in komodo. But every time I run the code, there's always the error: Traceback (most recent call last): File "C:\Program Files\ActiveState Komodo 2.5\callkomodo\kdb.py", l

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

2010-07-06 Thread Alan G Isaac
don't see how). 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 Isaac -- http://mail.python.org/mailman/listinfo/python-list

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

2010-07-06 Thread Alan G Isaac
ible. But create it however you wish. (Note than numpy arrays have a fixed length; create a Python list if you wish to append to it.) Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

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

2010-07-05 Thread Alan G Isaac
xt line V0 = ... #create an array plt.plot(V0) plt.show() hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: improving IDLE

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! On Jun 25, 12:46 pm, Alan G Isaac wrote: Did you open an issue?http://bugs.python.org/ On 6/25/2010 4:26 PM, rantingrick wrote: If *I* open an issu

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
vior" is supposed to mean. Mutable objects like a list will generally modify in place. Immutable objects of course will not. An IntVar is mutable. You have given no reason for it not to handle ``+=`` in an unsurprising fashion. It is not an int. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

value of: None is None is None

2010-06-25 Thread Alan G Isaac
Surprising for a moment, if you don't immediatelyrecognize it as a chained comparison. (Just sharing.) Alan Isaac None is None is None True (None is None) is None False None is (None is None) False -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue? http://bugs.python.org/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
2 is temp) (5, True) Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

best way to increment an IntVar?

2010-06-23 Thread Alan G Isaac
Of course one can do myintvar.set(myintvar.get()+1) but surely there is a better way? I'm surprsied that myintvar += 1 is not allowed. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

ttk Scale: missing attributes

2010-06-23 Thread Alan G Isaac
Tkinter's Scale widget had a `label` and a `resolution` attribute. These appear to be missing from the Ttk Scale widget. Is there a reason? These were important attributes. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANNC] pynguin-0.8 python turtle graphics application

2010-06-09 Thread Alan G Isaac
are working with Gregor Lingl to make turtle.py even better. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

modify XMP data (Python/Windows)

2010-06-05 Thread Alan G Isaac
use on Windows. I found Chilkat's XMP library http://www.chilkatsoft.com/python-xmp.asp but it is not open source and I found no encouraging reviews. Is there a Python package providing functinonality comparable to Image::ExifTool (perl)? Thanks, Alan Isaac -- http://mail.python.org/ma

Re: documentation bug? (format spec mini language)

2010-05-12 Thread Alan G Isaac
On 5/11/2010 5:05 PM, Terry Reedy wrote: http://bugs.python.org/issue8691 Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
On 5/11/2010 3:19 PM, MRAB wrote: You usually want numbers to be right-aligned so that the decimal points line up when writing a columns of them. Yes. I'm not questioning the wisdom of the implementation, just the documentation of it. Thanks, Alan -- http://mail.python.org/mailman/listinfo/

documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
10.5f') ' 3.2' >>> format(3.2,'<10.5f') '3.20000 ' Am I somehow misreading the documentation? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: python b.python 8 works on XP but not on Vista?

2010-03-06 Thread Isaac Gouy
On Mar 6, 6:50 pm, Steven D'Aprano wrote: > On Sat, 06 Mar 2010 21:10:02 -0500, sstein...@gmail.com wrote: > > On Mar 6, 2010, at 8:23 PM, Isaac Gouy wrote: > > >> On Mar 6, 4:53 pm, Chris Rebert wrote: > >>> On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy

Re: python b.python 8 works on XP but not on Vista?

2010-03-06 Thread Isaac Gouy
On Mar 6, 4:53 pm, Chris Rebert wrote: > On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy wrote: > > On Mar 6, 4:02 pm, Chris Rebert wrote: > >> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy wrote: > >> > At the command prompt: > > >> >   python

Re: python b.python 8 works on XP but not on Vista?

2010-03-06 Thread Isaac Gouy
On Mar 6, 4:02 pm, Chris Rebert wrote: > On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy wrote: > > At the command prompt: > > >   python b.py 8 > > works fine on both XP and Vista > > >   python b.python 8 > > works on XP (and Linux) > > > but on Vista

python b.python 8 works on XP but not on Vista?

2010-03-06 Thread Isaac Gouy
At the command prompt: python b.py 8 works fine on both XP and Vista python b.python 8 works on XP (and Linux) but on Vista python b.python 8 ImportError: No module named b ? -- http://mail.python.org/mailman/listinfo/python-list

Need bluez/python ( PyBluez) method to access BlueZ data- Please Help!

2010-03-02 Thread Isaac
the D-Bus API and can directly access the BlueZ file system to get this parsed data. Can PyBlueZ do this? If not, any suggestions would be immensely appreciated. Thanks! Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: change an exception's message and re-raise it

2009-12-31 Thread Alan G Isaac
On 12/31/2009 7:30 PM, Steven D'Aprano wrote: The message attribute is deprecated from Python 2.6 and will print a warning if you try to use it. http://bugs.python.org/issue6844 fwiw, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-18 Thread Alan G Isaac
ons handle this fine without the odd (to non perlers) handling of backslashes in replacement. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-18 Thread Alan G Isaac
On 12/17/2009 7:59 PM, Rhodri James wrote: "re.compile('a\\nc')" passes a sequence of four characters to re.compile: 'a', '\', 'n' and 'c'. re.compile() then does it's own interpretation: 'a' passes through as is, '\' flags an escape which combined with 'n' produces the newline character (0x0a),

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
wing? A string replacement is not just "converted" as described in the documentation, essentially it is compiled? But that cannot quite be right. E.g., \b will be a back space not a word boundary. So then the question arises again, why isn't '\\' a backslash? Just becau

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
Alan G Isaac wrote: >>> re.sub('abc', r'a\nb\n.c\a','123abcdefg') == re.sub('abc', 'a\\nb\\n.c\\a','123abcdefg') == re.sub('abc', 'a\nb\n.c\a','123abcdefg') True Why are the

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
51, in sub return _compile(pattern, 0).sub(repl, string, count) File "C:\Python26\lib\re.py", line 273, in _subx template = _compile_repl(template, pattern) File "C:\Python26\lib\re.py", line 260, in _compile_repl raise error, v # invalid expression sre_constants.error: bogus escape (end of line) Why is this the proper handling of what one might think would be an obvious substitution? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
tting the raw string via a function produces a different result than providing it directly. If this is really the way things ought to be, I'd appreciate a clear explanation of why. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-17 Thread Alan G Isaac
On 10/16/2009 8:16 PM, Terry Reedy wrote: The fact that two or three people who agree on something agree on the thing that they agree on confirms nothing. On 10/17/2009 7:03 PM, Terry Reedy wrote: If you disagree with this, I think *you* are being silly. Well, ... Alan G Isaac wrote: Of

Re: restriction on sum: intentional bug?

2009-10-17 Thread Alan G Isaac
is useful to to combine them: sum(pathlst,path()). Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
Alan G Isaac gmail.com> writes: So of course join is better, as originally noted, but that does not constitute a reason to intentionally violate duck typing. On 10/16/2009 1:03 PM, Benjamin Peterson wrote: As Stephen pointed out, duck typing is not an absolute. I do not recall any

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
On 10/16/2009 8:16 PM, Terry Reedy wrote: The fact that two or three people who agree on something agree on the thing that they agree on confirms nothing. One could just as well argue that summing anything but numbers is semantically incoherent, not correct. Certainly, my dictionary points in tha

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
is a wart: an error is raised despite correct semantics. Ugly! Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
On 10/16/2009 3:40 PM, Tim Chase wrote: What's always wrong is giving me an *error* when the semantics are perfectly valid. Exactly. Which is why I expected this to be fixed in Python 3. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
Alan G Isaac schrieb: I expected this to be fixed in Python 3: sum(['ab','cd'],'') Traceback (most recent call last): File "", line 1, in TypeError: sum() can't sum strings [use ''.join(seq) instead] Of course it is not a good

restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
ould work, should it not? Naturally, '' + 'ab' + 'cd' 'abcd' Why doesn't duck typing apply to `sum`? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Alan G Isaac
Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: python memory use

2009-09-30 Thread Isaac Gouy
On Sep 30, 7:38 am, Gary Robinson wrote: > The chart > athttp://shootout.alioth.debian.org/u32q/benchmark.php?test=all〈=ja...is very > interesting to me because it shows CPython using much less memory than Java > for most tests. > > I'd be interested in knowing whether anybody can share info ab

Re: Programming ideas?

2009-09-20 Thread Alan G Isaac
You could learn a lot of Python contributing to docutils or bibstuff, and if you write papers or presentations, it may pay off directly. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Alan G Isaac
Alan G Isaac wrote: There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. On 9/16/2009 12:33 AM, John Nagle wrote: "The package is a wrapper around Tkinter". It runs Tkinter in a separate thread and sends commands to it.

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Alan G Isaac
to display them. But really, Matplotlib is both cross platform and great. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: string interpolation mystery in Python 2.6

2009-09-12 Thread Alan G Isaac
quot;%s %s" % (u'foo', C()) u'foo [unicode]' I.e., as soon as a Unicode element is interpolated into a string, further interpolations automatically request Unicode via __unicode__, if it exists. Pretty subtle ... Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
>>> unicode(e) u"(2, 'No such file or directory')" >>> str(e) "[Errno 2] No such file or directory: 'flooble'" >>> u'%s' % e u"(2, 'No such file or directory')&quo

Re: Use python to execute a windows program

2009-09-11 Thread Alan G Isaac
Does the Windows application offer a COM interface? http://oreilly.com/catalog/pythonwin32/chapter/ch12.html http://sourceforge.net/projects/pywin32/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
error report is produced both times. So this is a Python 2.6 change. Clues? Bug or feature? I'm going to hazard a guess that there was an undocumented (in What's New) change to the __unicode__ method of BaseException. Thanks, Alan Isaac .. [1] Following is the rst file to process

Re: incorrect DeprecationWarning (patch needed)

2009-09-08 Thread Alan G Isaac
On 9/5/2009 5:50 PM, Alan G Isaac wrote: I've filed a bug report: http://bugs.python.org/issue6844 This is now an accepted bug with a patch request. Can someone on this list please assist with a patch? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
I've filed a bug report: http://bugs.python.org/issue6844 Sadly the Twisted developers apparently did not file a bug report when they were bitten by this ... Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
creams on "unPythonic" on this list would be deafening. I am not sure how best to deprecate dependence on the Python 2.5 mistake, but this is not it. And I know at least one important library that is affected. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
Alan G Isaac wrote: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception._

incorrect DeprecationWarning?

2009-09-04 Thread Alan G Isaac
:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception.__init__(self) ... self.msg = message ... e = My

Re: Select column from a list

2009-08-28 Thread Alan G Isaac
asked but ... >>> rows = [(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)] >>> cols = map(None,*rows) >>> cols [(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)] Now you can have any "column" you want. Alan Isaac PS You can also use imap if you prefer not to create

Re: flatten a list of list

2009-08-16 Thread Alan G Isaac
On 8/16/2009 5:47 AM Terry apparently wrote: > Is there a simple way (the pythonic way) to flatten a list of list? > rather than my current solution: > new_list=[] > for l in list_of_list: > new_list.extend(l) new_list = list(xi for lst in list_of_list for xi in lst)

Re: random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
> On Aug 15, 12:49 pm, Alan G Isaac wrote: >> Quotinghttp://docs.python.org/3.1/library/random.html#random.gauss: >> Gaussian distribution. mu is the mean, and sigma is the >> standard deviation. This is slightly faster than the >> normalvariate() funct

random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
have some offsetting disadvantage. What is it? Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
On 8/14/2009 1:09 PM Steven D'Aprano apparently wrote: > Try this instead: > from operator import getitem reduce(getitem, (2, 1, 0), lst) > 'aaa' reduce(getitem, (2, 1, 0, 0), lst) > 'a' > > operator.getitem is less ugly too. Yes, that's better. Thanks, Alan -- http://mail.pytho

retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
7;*len(tpl)%tpl). It works but seems rather ugly. I kind of like reduce(list.__getitem__, tpl, lst) but the reliance on reduce remains controversial enough to see i removed from the Python 3 built-ins ... Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: csv.DictWriter.write_header()

2009-08-14 Thread Alan G Isaac
> On Aug 13, 1:15 pm, Alan G Isaac wrote: >> I do not understand the reason for your silly, sarcastic response. On 8/13/2009 7:58 AM John Machin apparently wrote: > Duck typing: ask a silly question, get a silly answer. Maybe if you learned to be a more generous reader, fewer que

Re: csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
> On Aug 13, 6:45 am, Alan G Isaac wrote: >> Given a csv.DictWriter instance `dw` >> I think it would be nice to be able to >> say dw.write_header() >> instead of >> dw.writer.writerow(dw.fieldnames) >> >> Good idea? On 8/12/2009 10:24 PM John Mac

csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
Given a csv.DictWriter instance `dw` I think it would be nice to be able to say dw.write_header() instead of dw.writer.writerow(dw.fieldnames) Good idea? Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Isaac Gouy
On Jul 21, 10:09 pm, Raffael Cavallaro wrote: > On 2009-07-21 19:06:02 -0400, Neil Hodgson > said: > > >    Python uses native threads. > > So it can be teh-slowness on all ur cores! > > > > The global interpreter lock doesn't

Re: invoke method on many instances

2009-07-22 Thread Alan G Isaac
>>> On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: >>>> def apply2(itr, methodname, *args, **kwargs): >>>> f = operator.methodcaller(methodname, *args, **kwargs) >>>> for item in itr: >>>> f(item) >> On 7/1

Re: are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
> * Alan G Isaac [2009-07-19 13:48:16 +]: >> Are user defined classes hashable? >> (The classes; *not* the instances!) >> I'm inclined to guess it will be hashed by id and this is >> OK. On 7/19/2009 10:07 AM Nicolas Dandrimont apparently wrote: > Y

are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
ks for any insights, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   >