Re: Function error

2014-06-14 Thread John Ladasky
On Saturday, June 14, 2014 11:17:50 AM UTC-7, sandhyaran...@gmail.com wrote: > I am new to python, pls help me to resolve the below error > > > > > > >>> def fib(n): > > ... """Print a Fibonacci series up to n.""" > > File "", line 2 > > """Print a Fibonacci series up to n.""" > >

Re: Simple question

2014-08-23 Thread John Ladasky
On Saturday, August 23, 2014 6:10:29 AM UTC-7, explode...@gmail.com wrote: > Can some one explain why this happens: > > True, False = False, True > > print True, False > > False True Shush! That's one of Python's most closely-guarded secrets! Every politician on Earth will want to learn to p

Re: bicyclerepairman python24 windows idle :(

2014-09-04 Thread John Ladasky
On Thursday, September 4, 2014 1:52:37 PM UTC-7, Ned Batchelder wrote: > This seems like enough of a non-sequitur that I wonder if you posted it > in the wrong place? Maybe someone is trying out a new chatbot program? -- https://mail.python.org/mailman/listinfo/python-list

Re: Teaching Python

2014-09-29 Thread John Ladasky
I am actually teaching Python as a side job. My students have ranged from eighth graders, up to a Silicon Valley hardware engineer who had no coding experience, but who needed to do some test engineering. My wife is an elementary school teacher. We occasionally talk about age-appropriate lear

Accessing matplotlib-users discussion group?

2011-09-14 Thread John Ladasky
Hi folks, Apologies if this is a bit off-topic, but there must be another Pythoneer out there who can help me navigate my current problem. I'm working with matplotlib, the Python graphing package. I need to ask some questions about it, and the place to ask those questions would appear to be the

Re: how to make a nested list

2011-09-15 Thread John Ladasky
Stef, Are your bottom-level lists always of length 2? If so, then you could use an array, instead of a list of lists. Python ships with a module called array, but it doesn't allow you to put non-numeric types into arrays, and it looks like you want the NoneType. I use the popular numpy module,

multiprocessing.Pool, its queue, and pre-emption

2011-09-15 Thread John Ladasky
Suppose that I have a multi-core computer with N CPU's, and I create a multiprocessing.Pool in Python 2.6 with N-1 Processes. (My rationale for choosing N-1 Processes was discussed here: http://groups.google.com/group/comp.lang.python/browse_frm/thread/65ba3ccd4be8228c) Then I use Pool.map_async(

Re: Accessing matplotlib-users discussion group?

2011-09-15 Thread John Ladasky
Hate to bump this, but... I found Sourceforge's IRC, and tried to ask for help there, and it doesn't look like I can get any help until business hours tomorrow. Anyone? -- http://mail.python.org/mailman/listinfo/python-list

Re: multiprocessing.Pool, its queue, and pre-emption

2011-09-15 Thread John Ladasky
On Sep 15, 3:14 pm, Chris Angelico wrote: > On Fri, Sep 16, 2011 at 6:52 AM, John Ladasky wrote: > > Suppose that I have a second, parallelizable, long-running task T2 > > that I want to address in REAL TIME when the need arises.  Using Pool, > > is there a way for me to in

Re: multiprocessing.Pool, its queue, and pre-emption

2011-09-15 Thread John Ladasky
Ah. Now, see? Having the right vocabulary helps. Searching for "priority queue" brings up this discussion from back in January: http://groups.google.com/group/comp.lang.python/browse_frm/thread/b69aeced28634898 Now, this discussion refers to a PriorityPool class which doesn't appear to be a sta

Re: multiprocessing.Pool, its queue, and pre-emption

2011-09-15 Thread John Ladasky
On Sep 15, 1:52 pm, John Ladasky wrote: > I've been snooping around inside Pool, and I would guess that what I > want to do is to manipulate Pool._inqueue, which is a > multiprocessing.queues.SimpleQueue object.  I haven't found any > documentation for SimpleQueue.  It ap

Re: Accessing matplotlib-users discussion group?

2011-09-17 Thread John Ladasky
On Sep 16, 10:29 am, Martin Schöön wrote: > On 2011-09-15, John Ladasky wrote: > > > Hate to bump this, but... I found Sourceforge's IRC, and tried to ask > > for help there, and it doesn't look like I can get any help until > > business hours tomorrow.  Anyone

Re: multiprocessing.Pool, its queue, and pre-emption

2011-09-17 Thread John Ladasky
Hey, this pretty easy hack appears to work! [code] from multiprocessing.pool import Pool, RUN, MapResult, mapstar class PriorityPool(Pool): def map_async_nowait(self, func, iterable, chunksize=None, \ callback=None): """ Same as map_async(), except uses put_nowait()

Re: Python bug in Windows 8--report now, or later?

2011-09-17 Thread John Ladasky
On Sep 17, 2:20 pm, Chris Angelico wrote: > I would consider reporting it as a bug in Windows 8, not a bug in Python. > > Chris Angelico +1, beat me to it. :^) -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphing

2011-09-22 Thread John Ladasky
I'm using matplotlib and I'm happy with it. Quick plotting is easy using the pyplot interface, which resembles the popular software package MATLAB. As your ambitions grow, matplotlib has many sophisticated tools waiting for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating equally-spaced floats with least rounding error

2011-09-24 Thread John Ladasky
On Sep 24, 6:53 am, Steven D'Aprano wrote: > I'm trying to generate a sequence of equally-spaced numbers between a lower > and upper limit. Given arbitrary limits, what is the best way to generate a > list of equally spaced floats with the least rounding error for each point? > > For example, supp

Simplest way to resize an image-like array

2011-09-30 Thread John Ladasky
Hi folks, I have 500 x 500 arrays of floats, representing 2D "grayscale" images, that I need to resample at a lower spatial resolution, say, 120 x 120 (details to follow, if you feel they are relevant). I've got the numpy, and scipy, and matplotlib. All of these packages hint at the fact that the

Re: Simplest way to resize an image-like array

2011-10-01 Thread John Ladasky
On Sep 30, 11:54 pm, Dennis Lee Bieber wrote: >         How difficult would it be to convert the "array" to a PIL image? I'm > fairly certain PIL has operations to rescale images. Yes, I considered this approach -- but I have a lot of arrays to resample, and I didn't want to further slow what is

Re: Simplest way to resize an image-like array

2011-10-01 Thread John Ladasky
On Sep 30, 1:51 pm, Jon Clements wrote: > Is something like > http://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imresize.html > any use? There we go! That's the kind of method I was seeking. I didn't think to look outside of scipy.interpolate. Thanks, Jon. -- http://mail.python.

Re: Simplest way to resize an image-like array

2011-10-06 Thread John Ladasky
On Oct 1, 2:22 am, John Ladasky wrote: > On Sep 30, 1:51 pm, Jon Clements wrote: > > > Is something like > >http://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imresi... > > any use? > > There we go!  That's the kind of method I was seeking.  

Re: Usefulness of the "not in" operator

2011-10-10 Thread John Ladasky
On Oct 8, 5:01 am, Steven D'Aprano wrote: > Who like that second one speaks? Yoda his name is. Programs in Forth he must. -- http://mail.python.org/mailman/listinfo/python-list

Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-17 Thread John Ladasky
On Oct 14, 7:32 pm, alex23 wrote: > You can do this right now with Python 3.2+ and concurrent.futures: > > from concurrent.futures import ThreadPoolExecutor You may have finally sold me on struggling through the upgrade from Python 2.6! I've been doing reasonably well with the Multiprocessing m

Re: Philosophical Python: 2*b or not 2*b

2011-10-27 Thread John Ladasky
On Oct 27, 1:11 am, Andreas Neudecker wrote: > Any more philsophical Python code out there? That is the question. -- http://mail.python.org/mailman/listinfo/python-list

What exactly is "pass"? What should it be?

2011-11-17 Thread John Ladasky
Hi folks, I'm trying to write tidy, modular code which includes a long-running process. From time to time I MIGHT like to check in on the progress being made by that long-running process, in various ways. Other times, I'll just want to let it run. So I have a section of code which, generally

Re: What exactly is "pass"? What should it be?

2011-11-17 Thread John Ladasky
On Thursday, November 17, 2011 6:45:58 PM UTC-8, Chris Rebert wrote: > Seems fine to me (good use of the null object pattern), although I > might define _pass() to instead take exactly 1 argument, since that's > all you ever call report() with in your example. Oops, I over-simplified the calls to

Re: What exactly is "pass"? What should it be?

2011-11-17 Thread John Ladasky
On Thursday, November 17, 2011 8:34:22 PM UTC-8, Dennis Lee Bieber wrote: > On Thu, 17 Nov 2011 18:18:11 -0800 (PST), John Ladasky > declaimed the following in > gmane.comp.python.general: > > def _pass(*args): > > pass > > > This is the equi

Multiprocessing bug, is my editor (SciTE) impeding my progress?

2011-12-06 Thread John Ladasky
Hi, folks, Back in 2002, I got back into programming after a nine-year hiatus. I needed a new programming language, was guided to Python 2.2, and was off to the races. I chose the SciTE program editor, and I have been using it ever since. I'm now using Python 2.6 on Ubuntu Linux 10.10. My prog

Re: why is bytearray treated so inefficiently by pickle?

2011-12-06 Thread John Ladasky
On a related note, pickling of arrays of float64 objects, as generated by the numpy package for example, are wildly inefficient with memory. A half-million float64's requires about 4 megabytes, but the pickle file I generated from a numpy.ndarray of this size was 42 megabytes. I know that numpy ha

Re: Clever hack or code abomination?

2011-12-06 Thread John Ladasky
On Dec 1, 12:21 am, Chris Angelico wrote: > On Thu, Dec 1, 2011 at 2:15 PM, Roy Smith wrote: > That's a self-contained piece of code.If I came upon it, I'd probably > copy and paste it to IDLE, see what it comes up with, and proceed from > there. +1. That was going to be my comment exactly. -

Re: Multiprocessing bug, is my editor (SciTE) impeding my progress?

2011-12-06 Thread John Ladasky
Thanks, Marco. I've noticed that the matplotlib reference manual recommends ipython. I haven't been clear what its advantages are, but if interacting with multiprocessing correctly is one of them, I'll try it. If ipython does everything that IDLE does and more, why is IDLE still shipped with Pyth

Re: Multiprocessing bug, is my editor (SciTE) impeding my progress?

2011-12-06 Thread John Ladasky
On Dec 6, 1:42 pm, Terry Reedy wrote: > On 12/6/2011 2:13 PM, John Ladasky wrote: > > Exception in thread Thread-1: > > Traceback (most recent call last): > >    File "/usr/lib/python2.6/threading.py", line 532, in > > __bootstrap_inner > >    

Re: Multiprocessing bug, is my editor (SciTE) impeding my progress?

2011-12-09 Thread John Ladasky
Thanks once again to everyone for their recommendations, here's a follow-up. In summary, I'm still baffled. I tried ipython, as Marco Nawijn suggested. If there is some special setting which returns control to the interpreter when a subprocess crashes, I haven't found it yet. Yes, I'm RTFM. As

Multiprocessing bug, is information ever omitted from a traceback?

2011-12-09 Thread John Ladasky
Hi folks, A tangent off of this thread: http://groups.google.com/group/comp.lang.python/browse_frm/thread/751b7050c756c995# I'm programming in Python 2.6 on Ubuntu Linux 10.10, if it matters. I'm trying to track down a multiprocessing bug. Here's my traceback. All lines of code referenced in th

Re: Multiprocessing bug, is information ever omitted from a traceback?

2011-12-10 Thread John Ladasky
On Dec 9, 9:00 pm, Terry Reedy wrote: > On 12/9/2011 6:14 PM, John Ladasky wrote: > > >http://groups.google.com/group/comp.lang.python/browse_frm/thread/751... > > > I'm programming in Python 2.6 on Ubuntu Linux 10.10, if it matters. > > It might, as many bugs have

Re: Multiprocessing bug, is information ever omitted from a traceback?

2011-12-10 Thread John Ladasky
On Dec 10, 10:38 am, Andrew Berg wrote: > On 12/10/2011 11:53 AM, John Ladasky wrote:> Why did you specify Python > 2.7.2, instead of the 2.7.6 version that is > > being offered to me by Ubuntu Software Center?  Does it matter? > > There is no Python 2.7.6. I think you have

Upgraded Ubuntu -> 11.10, Python -> 2.7.2. Now psyco doesn't work?

2011-12-20 Thread John Ladasky
I'm chasing down a bug that I think may be in my own code. But a fellow Pythoneer suspected that I might actually be looking at a bug in Python itself. http://groups.google.com/group/comp.lang.python/browse_thread/thread/f4b5843e2b06d1a6 Because I was using Python 2.6.6, and I was told that only

Re: Upgraded Ubuntu -> 11.10, Python -> 2.7.2. Now psyco doesn't work?

2011-12-20 Thread John Ladasky
On Dec 20, 4:08 pm, Jerry Hill wrote: > From the psyco homepage (http://psyco.sourceforge.net/) "Python 2.7 > is unsupported so far. Anyone interested in porting Psyco to it is > welcome. I started the work in a branch but it needs finishing." > That's the most recent news item on the home page,

Re: Multiprocessing bug, is information ever omitted from a traceback?

2011-12-28 Thread John Ladasky
I hope that the interested parties who offered me help will remember this thread title. It has been a few weeks. After fussing around with an alternate installation of Python 2.7.2 on top of Ubuntu Linux 10.04, I decided it would be easier to upgrade to Ubuntu 11.10, for which Python 2.7.2 is the

Re: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS ?????????

2012-01-03 Thread John Ladasky
On Jan 3, 7:40 am, BV wrote: > MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS Q0. Why do thousand-line religious posts appear in comp.lang.python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Opinion on best practice...

2013-02-08 Thread John Ladasky
On Tuesday, February 5, 2013 5:55:50 PM UTC-8, Steven D'Aprano wrote: > To do anything meaningful in bash, you need to be an expert on > passing work off to other programs... [snip] > If you took the Zen of Python, > and pretty much reversed everything, you might have the Zen of Bash: I have to

Re: TypeError: 'float' object is not iterable

2013-03-14 Thread John Ladasky
On Thursday, March 14, 2013 3:12:11 AM UTC-7, Ana Dionísio wrote: > for b in range (len(t_amb)): > a=8 > for d in t_amb[b]: > a=a+1 > sheet.write(a,b+1,d) > > The error appear in "for d in t_amb[b]:" and I don't understand why. Can you > help me? It looks to me like you

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread John Ladasky
On Monday, April 1, 2013 8:30:56 AM UTC-7, Pierre O'Dee wrote: > Guido went on to say that he's now working on a new language > called Giddy-up-and-Go which will take the worst features of C++, > Java, and French combined with elements of both PHP and Klingon > syntax. He said that this new endeav

JIT compilers for Python, what is the latest news?

2013-04-04 Thread John Ladasky
I'm revisiting a project that I haven't touched in over a year. It was written in Python 2.6, and executed on 32-bit Ubuntu 10.10. I experienced a 20% performance increase when I used Psyco, because I had a computationally-intensive routine which occupied most of my CPU cycles, and always rec

Re: JIT compilers for Python, what is the latest news?

2013-04-05 Thread John Ladasky
On Thursday, April 4, 2013 7:39:16 PM UTC-7, MRAB wrote: > Have you looked at Cython? Not quite the same, but still... I'm already using Numpy, compiled with what is supposed to be a fast LAPACK. I don't think I want to attempt to improve on all the work that has gone into Numpy. -- http://ma

Re: JIT compilers for Python, what is the latest news?

2013-04-05 Thread John Ladasky
On Friday, April 5, 2013 1:27:40 AM UTC-7, Chris Angelico wrote: > 1) Can you optimize your algorithms? Three days of processing is... a LOT. Neural network training. Yes, it takes a long time. Still, it's not the most tedious code I run. I also do molecular-dynamics simulations with GROMACS,

Re: JIT compilers for Python, what is the latest news?

2013-04-05 Thread John Ladasky
On Friday, April 5, 2013 10:32:21 AM UTC-7, Ian wrote: > That doesn't seem to follow from your original post. Because Numpy is > a C extension, its performance would not be improved by psyco at all. What about the fact that Numpy accommodates Python's dynamic typing? You can pass arrays of int

Keyboard interrupts, Idle vs. SciTE

2006-11-02 Thread John Ladasky
Hi there. The following minimal code in Python 2.3.4 works under Idle v. 1.0.3, but not under SciTE v. 1.66: from time import sleep try: while True: sleep(0.25) print ".", except KeyboardInterrupt: print "\nKeyboard interrupt received. Exiting program.\n\n" Under SciTE,

Re: Keyboard interrupts, Idle vs. SciTE

2006-11-03 Thread John Ladasky
Thanks for the SciTE info, Neil. Yes, it was silly of me to forget to state that I'm using Win32. Normally, when I post to comp.lang.python, I remember to include that fact... :^P +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Ladasky Home Solar, Inc.: blowing sunshine up your

Re: Keyboard interrupts, Idle vs. SciTE

2006-11-03 Thread John Ladasky
Thanks Robert, I just poked around and found a PythonWin web page: http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/pywin32/html/pythonwin/readme.html >From other links it appears that SciTE was based on PythonWin, and not the other way around. For people coding in other languages besides

Numeric + wxPython, can't understand a bug...

2007-04-27 Thread John Ladasky
Hi, folks, This probably has to do with Numeric and not with wxPython, but I mention both for completeness. My OS: Win2000 Python: 2.3.4 wx: 2.6.1.0, Unicode version Numeric: 23.8 Here's the minimal code: height = 50 width = 60 L = [] for y in r

Re: Numeric + wxPython, can't understand a bug...

2007-04-28 Thread John Ladasky
On Apr 27, 9:40 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > wx.Point objects are being recognized as sequences by array(). Consequently, > reshape() thinks you are trying to reshape a (height*width, 2) array into a > (height, width) array. You might want to create an empty (height, width) > PyObj

Re: Porn Addiction Solutions?

2008-10-10 Thread John Ladasky
On Oct 8, 12:30 pm, [EMAIL PROTECTED] wrote: > On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > > Any suggestions? Sure -- my suggestion is to post in relevant newsgroups! Rec.music.hip-hop, comp.lang.python, comp.lang.ruby, and alt.comp.freeware are not appropriate places for your inquiries. Alt.su

How to examine the inheritance of a class?

2008-10-23 Thread John Ladasky
Hello again! Suppose that I have several subclasses which inherit from a base class, thus: class Foo(object): class Spam1(Foo): class Spam2(Foo): class Spam3(Foo): etc. The list of subclasses is not fully defined. It is supposed to be extensible by the user. Many methods will differ betwee

Re: How to examine the inheritance of a class?

2008-10-23 Thread John Ladasky
I forgot to add -- though I suspect it should not matter -- I'm using Python 2.5.1 on Ubuntu Linux 8.04. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to examine the inheritance of a class?

2008-10-23 Thread John Ladasky
On Oct 23, 6:56 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > In __bases__, e.g. Spam1.__bases__, which would be (,). > In practice, you probably just want to use if isinstance(some_obj, > Foo): which will be true for SpamN instances. Thank you, Chris. Class.__bases__ is exactly what I wante

Re: How to examine the inheritance of a class?

2008-10-23 Thread John Ladasky
On Oct 23, 6:59 pm, "James Mills" <[EMAIL PROTECTED]> wrote: > Developer. NOT User. For the foreseeable future, this program is for my use only. So the developer and the user are one and the same. And, thank you, __bases__ is what I was looking for. Though Chris Mills also pointed out that isi

Import, site packages, my modules, Windows vs. Linux

2008-06-03 Thread John Ladasky
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. I have copies of these files in the same directory as the main program I happen to be working on at the ti

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-04 Thread John Ladasky
On Jun 3, 6:52 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > John Ladasky <[EMAIL PROTECTED]> writes: > > I want to know what is the *recommended* way to integrate my own > > personal modules with Python. Thanks! > > You want the 'distutils' documenta

Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread John Ladasky
Hi folks, I've played around with neural nets for a while. I wrote my own slow, pure-Python NN package. I knew that there were Python NN packages out there -- but I couldn't really understand their features and documentation at first, not without some hands-on experience. I haven't yet solved a

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-08-03 Thread John Ladasky
Thanks to everyone who replied. I haven't chosen a definite direction for my project yet. But you have given me some good leads. Google Books offers previews of many pages of John Koza's book, published in the early 1990's. I'm reading through the preview pages, with the idea of purchasing a mo

Re: Newbie wxPython questions.

2006-04-07 Thread John Ladasky
[EMAIL PROTECTED] wrote: > I am also a newbie and learning like you are. I was wondering if do you > know any wxPython forum just for GUIs ? > Good luck with your project and hope that some guru helps us out. If you are reading this via Usenet, you can subscribe to the newsgroup comp.soft-sys.wxw

Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread John Ladasky
Hello everyone, I've posted this same question over on ubuntuforums.org, so I'm trying to get help in all of the logical places. I'm running Ubuntu Linux 8.04 (Hardy) on a fairly new x86 box, with two hard disks in a software RAID 1 configuration. Hardy comes with Python 2.5 as a standard packag

Re: Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread John Ladasky
Thanks, Benjamin, I am getting a handle on this. I've written my own Python modules before, and have installed them using distutils. So I know that procedure. I just downloaded the Numpy 1.4.0 tarball, and I succeeded in installing it. A program I wrote which depends on numpy ran successfully f

Re: Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-25 Thread John Ladasky
On Jan 24, 3:52 pm, Christian Heimes wrote: > By the way you mustn't install your own Python with "make install", use > "make altinstall"! Your /usr/local/bin/python binary masks the original > python command in /usr/bin. You should remove all /usr/local/bin/py* > binaries that do not end with 2.

Re: WxPython upgrade trouble on Ubuntu 8.04

2010-01-25 Thread John Ladasky
Hi Mike, Thanks, I forgot that wxPython-users is distinct from comp.soft- sys.wxwindows. I'll give it a try. -- http://mail.python.org/mailman/listinfo/python-list

Re: Concept of God in islam

2009-10-10 Thread John Ladasky
On Oct 10, 12:25 pm, omer azazi wrote: > Sorry for not sending anything related to this group but it might be > something new to you. [198 lines deleted] Reported to GMail admins for spam. -- http://mail.python.org/mailman/listinfo/python-list

Re: Some syntactic sugar proposals

2010-11-16 Thread John Ladasky
On Nov 14, 11:30 pm, alex23 wrote: > On Nov 15, 4:39 pm, Dmitry Groshev wrote: > > >     if x in range(a, b): #wrong! > > Only in Python 3.x, it's perfectly valid in Python 2.x. To achieve the > same in Python 3.x, try: > >     if x in list(range(a, b,)): # BUT SEE MY COMMENT BELOW > > > it feels

Re: Is Unladen Swallow dead?

2010-11-17 Thread John Ladasky
On Nov 16, 2:30 pm, laspi wrote: >Is Unladen Swallow dead? No, it's just resting. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python use growing fast

2011-01-14 Thread John Ladasky
On Jan 10, 1:43 pm, Alice Bevan–McGregor wrote: > On 2011-01-10 13:02:09 -0800, MRAB said: > > Wikipedia is a Wiki; everyone is free to contribute and correct mistakes. > >         - Alice. Except for some of us. I tried to make a correction to a chemistry Wikipedia entry several months back. I

Re: Overlap in python

2009-08-06 Thread John Ladasky
On Aug 4, 3:21 pm, Jay Bird wrote: > Hi everyone, > > I wanted to thank you all for your help and *excellent* discussion.  I > was able to utilize and embed the script by Grigor Lingl in the 6th > post of this discussion to get my program to work very quickly (I had > to do about 20 comparisons pe

Re: How do I insert a menu item in an existing menu.

2009-08-30 Thread John Ladasky
You might want to direct your wxPython questions to the dedicated wxPython newsgroup. It's Google-only, and thus not part of the Usenet hierarchy. But it's the most on-topic newsgroup you will find. http://groups.google.com/group/wxpython-users I attempted to crosspost this article to wx-python

numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
Hi folks, I am aware that numpy has its own discussion group, which is hosted at gmane. Unfortunately, I can't seem to get in to gmane today. In any case, I'm not sure whether I have a problem with numpy, or with my understanding of the Python pickle module, so I'm posting here. I am pickling n

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
Hi Robert, Thanks for the quick reply. On Sep 13, 1:22 pm, Robert Kern wrote: > The problem is that you are trying to use "is" to compare by Python object > identity. Except for dtype=object arrays, the object identities of the > individual elements that you extract from numpy arrays are never

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
On Sep 13, 4:17 pm, Carl Banks wrote: > On Sep 13, 3:18 pm, John Ladasky wrote: > > > In my leisure time, I would like to dig deeper into the issue of why > > object identities are not guaranteed for elements in numpy arrays... > > with elements of type "float",

Re: How find all childrens values of a nested dictionary, fast!

2010-11-05 Thread John Ladasky
On Nov 4, 10:21 am, de...@web.de (Diez B. Roggisch) wrote: > macm writes: >     for value in d.values(): >         if isinstance(value, dict): I'm not a Python guru, but... do you care that you're breaking duck typing here? I've had other programmers warn me against using isinstance() for this

Re: Exception Handling in Python 3

2010-11-05 Thread John Ladasky
On Oct 29, 8:53 am, rantingrick wrote: > I am the programmer, and when i say to my interpretor "show this > exception instead of that exception" i expect my interpretor to do > exactly as i say or risk total annihilation!! I don't want my > interpreter "interpreting" my intentions and then doing

Re: { '0':'c->c->a' ,'1':'a->b->a' .........}

2010-11-07 Thread John Ladasky
Hi Chris, I may have time to look at the rest of your code later. For now I just want to comment on one line: On Nov 7, 12:24 pm, chris wrote: >     elem=['a','b','c'][i] The string type, just like the list type, is a sequence type. So strings have all the standard sequence methods. You coul

Re: functions, list, default parameters

2010-11-08 Thread John Ladasky
On Nov 1, 7:30 pm, Lawrence D'Oliveiro wrote: > In message <20101021235138.609fe...@geekmail.invalid>, Andreas Waldenburger > wrote: > > > While not very commonly needed, why should a shared default argument be > > forbidden? > > Because it’s safer to disallow it than to allow it. That's why Java

Re: getting the center of mass of each part of a molecule

2017-05-16 Thread John Ladasky
On Monday, May 15, 2017 at 10:23:12 PM UTC-7, qasi...@gmail.com wrote: > @Cameron: > Thanks, I will try what you suggest. I am not sure that I'll tackle it > because I am new to python. I teach programming to people with varying levels of expertise, from middle-school students to working profess

Re: getting the center of mass of each part of a molecule

2017-05-16 Thread John Ladasky
On Monday, May 15, 2017 at 7:23:52 PM UTC-7, jeanbi...@gmail.com wrote: > What may make this tricky is that the vinyl group can rotate at the point > where it attaches to the benzene ring so the full molecule may not lie in a > plane. But the OP has coordinates for each atom which are used in th

Re: getting the center of mass of each part of a molecule

2017-05-18 Thread John Ladasky
On Thursday, May 18, 2017 at 3:55:01 AM UTC-7, qasi...@gmail.com wrote: > @jladasky and @Gregory: > > 3) Divide the ligand molecule into two parts (except for ligand heavy atom > closest to the COM of the whole ligand) based on the COM previously > calculated. OK, now I agree with Gregory Ewin

Re: os.walk the apostrophe and unicode

2017-06-24 Thread John Ladasky
On Saturday, June 24, 2017 at 12:07:05 PM UTC-7, Rod Person wrote: > Hi, > > I'm working on a program that will walk a file system and clean the id3 > tags of mp3 and flac files, everything is working great until the > follow file is found > > '06 - Todd's Song (Post-Spiderland Song in Progress).

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread John Ladasky
On Tuesday, June 27, 2017 at 9:24:07 AM UTC-7, Sam Chats wrote: > https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 OK, that's cheating a bit, using Numpy. It's a nice little program, but it leverages a huge, powerful lib

Re: How to build a simple neural network in 9 lines of Python code

2017-06-29 Thread John Ladasky
On Tuesday, June 27, 2017 at 12:34:46 PM UTC-7, Marko Rauhamaa wrote: > John Ladasky : > > OK, that's cheating a bit, using Numpy. It's a nice little program, > > but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a lib

Re: How to build a simple neural network in 9 lines of Python code

2017-06-29 Thread John Ladasky
On Tuesday, June 27, 2017 at 7:28:58 PM UTC-7, Steve D'Aprano wrote: > On Wed, 28 Jun 2017 06:22 am, Marko Rauhamaa wrote: > > > You saw the APL example, right? APL's standard runtime/library contains > > most of Numpy functionality because that's what APL has been designed > > for. > > > > Is th

<    1   2   3