Re: Design: Idiom for classes and methods that are customizable by the user?

2016-05-17 Thread Michael Selik
On Tue, May 17, 2016 at 11:18 AM Dirk Bächle wrote: > > > It's not so great to require > > that the user must explicitly ``add`` their derived class after defining > > it. Perhaps that add function could be a decorator? > > Our current API doesn't use decorators at all, since it's also aimed at >

Re: Quote of the day

2016-05-17 Thread Michael Torrie
On 05/17/2016 08:27 AM, Paul Rudin wrote: > Marko Rauhamaa writes: >> That's a long time to be without a product to sell. > > But you do have the option of building a kernel incorporating your fix > and using that. Sure as an individual end user that may be the best option. But not necessarily f

Re: for / while else doesn't make sense

2016-05-20 Thread Michael Selik
On Thu, May 19, 2016 at 1:04 PM Ian Kelly wrote: > On Thu, May 19, 2016 at 10:31 AM, Herkermer Sherwood > wrote: > > Most keywords in Python make linguistic sense, but using "else" in for > and > > while structures is kludgy and misleading. I am under the assumption that > > this was just utiliz

Re: JNLP File download and run

2016-05-20 Thread Michael Torrie
On 05/20/2016 01:30 AM, Robert Clove wrote: > Hi, > > Can someone give me pseudo code to download and JNLP file from a URL and > run it? > > Looks like a advance concept in python You could use the urllib module to download the file, then use the subprocess module to spawn the javaws executable

Re: for / while else doesn't make sense

2016-05-21 Thread Michael Selik
On Sat, May 21, 2016, 4:52 PM Erik wrote: > So I guess my question is perhaps whether Python compilers should start > to go down the same path that C compilers did 30 years ago (by starting > to include some linter functionality) > Well, there's that whole optional type hints thing. You should b

Re: Image loading problem

2016-05-22 Thread Michael Torrie
On 05/21/2016 01:55 PM, Random832 wrote: > On Sat, May 21, 2016, at 12:54, Peter Otten wrote: >> It's not your fault, there's an odd quirk in the library: you have to >> keep a reference of the PhotoImage instance around to prevent the >> image from being garbage-collected. > > Just out of curiosi

Re: numpy problem

2016-05-23 Thread Michael Selik
On Mon, May 23, 2016 at 9:12 AM wrote: > > On 23 mei 2016, at 14:19, Peter Otten <[email protected]> wrote: > > [email protected] wrote: > > > >> I've got a 2D array > >> And an array of indexes that for shows which row to keep for each column > >> of values: > >> > >> keep = np.array([2, 3, 1

Re: JNLP File download and run

2016-05-24 Thread Michael Torrie
lso subprocess (or os.startfile) to do what you want to do, including examples you can adapt. Should be just a few of lines of actual python code to start with. > > On Fri, May 20, 2016 at 9:06 PM, Michael Torrie <mailto:[email protected]>> wrote: > > On 05/20/2016 01:

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-26 Thread Michael Torrie
On 05/26/2016 11:31 AM, Sean Son wrote: > Hopefully those help in any troubleshooting steps that you all recommend to > me! > > Thank you! You could try emailing the author who's email address is listed on the project's main github page. I suspect the project itself is abandoned. Was this worki

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-26 Thread Michael Torrie
On 05/26/2016 05:57 PM, Michael Torrie wrote: > You could try emailing the author who's email address is listed on the > project's main github page. I suspect the project itself is abandoned. Ahem. That should have been whose. Sigh. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:41 AM, Sean Son wrote: > Thank you for your reply. So the error isnt due to a bug in function > itself? It is due to a possible error in the Android APK file? If that > is the case, it would take a while to figure this out. I tried contacted > the author of the project but I have

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:09 PM, Michael Torrie wrote: > On 05/27/2016 08:41 AM, Sean Son wrote: >> Thank you for your reply. So the error isnt due to a bug in function >> itself? It is due to a possible error in the Android APK file? If that >> is the case, it would take a while

Re: How can I debug silent failure - print no output

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:41 PM, Sayth Renshaw wrote: > This is my terminal and directory structure. Add more print() calls. Offhand I'd say that pq(filename=filename) is returning an empty list so that for loop is not doing anything. Hence your debugging print() calls never happen. Add sanity print()'s

Re: Efficient handling of fast, real-time hex data

2016-05-31 Thread Michael Torrie
On 05/31/2016 06:20 PM, [email protected] wrote: > So, how can I take the byte sequence <0x01 0x02 0x03 0x04 0x05 0x06 > \n> that Serial.readline() returns to me, and QUICKLY turn it into > three integer values, 258, 772, and 1286? Better yet, can I write > these bytes directly into an array (numpy

Re: [Q] ImportError by __import__() on Python >= 3.4

2016-06-02 Thread Michael Selik
On Thu, Jun 2, 2016 at 10:06 AM Makoto Kuwata wrote: > os.mkdir(name) > with open(name + "/__init__.py", 'w') as f: > f.write("X=1") > f.flush() > > Please give me any advices or hints. > This wasn't your question, but you don't need to flu

Re: 2d matrix into Nx3 column data

2016-06-02 Thread Michael Selik
On Thu, Jun 2, 2016 at 4:57 AM Anup reni wrote: > i would like to transform this: > > -1 0-0.8 0.64 -0.36-0.4 0.16 -0.84 > 0.0 0 -1.00 > 0.4 0.16 -0.84 > 0.8 0.64 -0.36 > > to something like this: > > x y result > id1 -0.8 -10.642 -0.8 0 -0.363

Re: Multiple inheritance, super() and changing signature

2016-06-02 Thread Michael Selik
On Thu, Jun 2, 2016 at 4:26 AM Lawrence D’Oliveiro wrote: > On Wednesday, June 1, 2016 at 8:02:14 AM UTC+12, Ben Finney wrote: > > (Note that ‘__init__’ is not a constructor, because it operates on the > > *already constructed* instance, and does not return anything. > > Believe it or not, that *

Re: Don't put your software in the public domain

2016-06-03 Thread Michael Torrie
On Jun 3, 2016 04:57, "Steven D'Aprano" wrote: > (1) If the GPL licence is valid, then they are in breach of the licence > terms, the licence is revoked, and they are not legally permitted to > distribute or use the software; > > (2) If, as some people insist, the GPL licence is not valid, then th

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Michael Selik
On Fri, Jun 3, 2016 at 10:41 AM Ian Kelly wrote: > On Fri, Jun 3, 2016 at 8:06 AM, Nagy László Zsolt > wrote: > > There is still something I don't get: how to create cooperative classes > > when some base classes share some of the parameters? > > Why do they need to share the same parameter? >

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Michael Selik
On Fri, Jun 3, 2016 at 11:58 AM Sayth Renshaw wrote: > That totally makes sense I was just double checking, had hoped I could > create a variable assign it to a list and append in one stroke. > In fact you can! It's called a "list comprehension" pyqFiles = [pq(my_dir + filename) for filenam

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Michael Selik
On Fri, Jun 3, 2016 at 12:01 PM Nagy László Zsolt wrote: > > Is the problem that the attribute or parameter has the same name in > both base classes, but has different meanings in each? > If they had different meanings, a simple rename would solve the problem. > Sometimes finding a good name ain

Re: Operator precedence problem

2016-06-05 Thread Michael Torrie
On 06/05/2016 10:05 AM, Uri Even-Chen wrote: > My suggestion: Never write expressions, such as 2 ** 3 ** 2 or even 2 * 4 > + 5, without parentheses. Always add parentheses - 2 ** (3 ** 2) (or (2 ** > 3) **2) or (2 * 4) + 5 (or 2 * (4 + 5)). I can understand using parenthesis when operator precede

Re: Everything good about Python except GUI IDE?

2016-06-05 Thread Michael Torrie
On 03/02/2016 03:36 PM, Marko Rauhamaa wrote: > Requirements for what I have in mind: > > 1. It would have to be and feel like real Python. > > 2. External commands should be available as callable Python functions. > > 3. Functions/commands should return streams. (Generators, maybe?) > > 4.

Re: Everything good about Python except GUI IDE?

2016-06-05 Thread Michael Torrie
On 06/05/2016 10:01 PM, Michael Torrie wrote: > I've thought about this before and even tried my hand at creating a nice > library for doing this sort of thing with Python. Generators seem like > a natural analog for the shell pipes. However there is one big problem > with them

Re: Would like to see python script output

2016-06-06 Thread Michael Selik
On Mon, Jun 6, 2016 at 3:12 AM Archana Sonavane wrote: > I have ganglia python script, i would like to see output of each code > block. > > Could you please guide. I don't have any idea about python. > Do you know how to run a Python script? Have you read through the Python tutorial? https://do

Re: Anyone know a donation app codebase?

2016-06-06 Thread Michael Selik
On Sun, Jun 5, 2016 at 3:26 PM Ben Finney wrote: > Albert writes: > > > Thank you for your answer Ben, > > You're welcome. Please note that top-posting is poor etiquette for > discussions; instead, interleave your response like a written dialogue. > See https://en.wikipedia.org/wiki/Posting_styl

Re: Taking two and more data frames and extracting data on unique keys in python

2016-06-06 Thread Michael Selik
On Sun, Jun 5, 2016 at 7:05 AM Danish Hussain wrote: > Please me know if clarification is needed. > Could you clarify what your question is? Did you encounter an error while coding the solution? -- https://mail.python.org/mailman/listinfo/python-list

Re: [Q] ImportError by __import__() on Python >= 3.4

2016-06-06 Thread Michael Selik
On Thu, Jun 2, 2016 at 10:06 AM Makoto Kuwata wrote: > I have a trouble around __import__(). > The docs for __import__ strongly recommend that you use importlib instead https://docs.python.org/3.5/library/importlib.html#importlib.import_module The docs for ``importlib.import_module`` suggest th

Re: reshape and keep x,y,z ordering

2016-06-07 Thread Michael Selik
On Tue, Jun 7, 2016 at 7:31 AM Heli wrote: > Hello, > I have a question regarding reshaping numpy array. > > I either have a 1D array that I need to reshape to a 3D array or a 3D > array to reshape to a 1d numpy array. > > In both of these cases it is assumed that data follows x,y,z ordering. > a

Re: Recommendation for GUI lib?

2016-06-07 Thread Michael Torrie
Accidentally didn't reply to the list... On 06/07/2016 03:45 PM, Roland Koebler via Python-list wrote: > You can also try Qt (http://qt.io), and one of its Python-bindings. > But I was never happy with Qt and think some GUI-concepts of GTK+ are much > better than the ones of Qt, and I like Glade m

Re: [Q] ImportError by __import__() on Python >= 3.4

2016-06-08 Thread Michael Selik
By the way, why choose to write, import, and delete modules? I'd think exec'ing code would be sufficient. On Wed, Jun 8, 2016, 5:52 AM Makoto Kuwata wrote: > On Tue, Jun 7, 2016 at 7:28 AM, Michael Selik > wrote: > >> On Thu, Jun 2, 2016 at 10:06 AM Makoto Kuwat

Re: Possible PEP - two dimensional arrays?

2016-06-08 Thread Michael Torrie
On 06/07/2016 06:17 PM, Harrison Chudleigh wrote: > I was programming a computer game and found that while 1D arrays can be > created using the module array, there is no module for two-dimensional > arrays, unlike languages like C. Currently, the closest thing Python has to > a 2D array is a dictio

Re: UserList - which methods needs to be overriden?

2016-06-09 Thread Michael Selik
On Thu, Jun 9, 2016 at 5:07 AM Nagy László Zsolt wrote: > I would like to create a collections.UserList subclass that can notify > others when the list is mutated. > Why not subclass MutableSequence instead? The ABC will tell you which methods to override (the abstract ones). The mixin methods r

Re: Tie dictionary to database table?

2016-06-09 Thread Michael Selik
On Thu, Jun 9, 2016 at 9:10 AM justin walters wrote: > It looks like you might be looking for an ORM. Have you checked out > sqlalchemy? > An ORM might be overkill. If you just want a persistent dictionary, just use the shelve module. https://docs.python.org/3/library/shelve.html -- https://mai

Re: which library has map reduce and how to use it for this case

2016-06-09 Thread Michael Selik
I like using Yelp's mrjob module (https://github.com/Yelp/mrjob) to run Python on Hadoop. On Thu, Jun 9, 2016 at 2:56 AM Ho Yeung Lee wrote: > [... a bunch of code ...] If you want to describe a map-reduce problem, start with the data. What does a record of your input data look like? Then thi

Re: how to solve memory

2016-06-09 Thread Michael Torrie
On 06/09/2016 06:58 PM, meInvent bbird wrote: > Do you have a question for the list? If so, please state what it is, and describe what you are doing and what isn't working. If you can boil it down to a dozen lines of run-able, self-contained code that illustrates the problem, that is helpful too

Re: UserList - which methods needs to be overriden?

2016-06-10 Thread Michael Selik
On Fri, Jun 10, 2016 at 9:18 AM Michael Selik wrote: > > > On Fri, Jun 10, 2016, 4:05 AM Nagy László Zsolt > wrote: > >> 2016.06.10. 0:38 keltezéssel, Michael Selik írta: >> >> On Thu, Jun 9, 2016 at 5:07 AM Nagy László Zsolt >> wrote: >> >

Re: UserList - which methods needs to be overriden?

2016-06-10 Thread Michael Selik
On Fri, Jun 10, 2016, 4:05 AM Nagy László Zsolt wrote: > 2016.06.10. 0:38 keltezéssel, Michael Selik írta: > > On Thu, Jun 9, 2016 at 5:07 AM Nagy László Zsolt > wrote: > >> I would like to create a collections.UserList subclass that can notify >> others when the list

Re: which library has map reduce and how to use it for this case

2016-06-10 Thread Michael Selik
On Thu, Jun 9, 2016, 9:11 PM Ho Yeung Lee wrote: > input are these six operators, output is finding full column of 27 > elements add together is 54 > > i got memory error when searching this, > > i have difficulty in understanding map reduce and transforming my program > into map reduce problem >

Re: which library has map reduce and how to use it for this case

2016-06-11 Thread Michael Selik
> > On Friday, June 10, 2016 at 10:04:09 PM UTC+8, Michael Selik wrote: > > You'll need to explain the problem in more detail. Instead of talking > about operators and columns, what is the actual, real-world problem? On Sat, Jun 11, 2016 at 2:21 AM meInvent bbird wro

Re: for / while else doesn't make sense

2016-06-12 Thread Michael Selik
On Sun, Jun 12, 2016 at 6:11 AM Steven D'Aprano < [email protected]> wrote: > - run the for block > - THEN unconditionally run the "else" block > Saying "unconditionally" is a bit misleading here. As you say, it's conditioned on completing the loop without break/return/raise. -

Re: loading trees...

2016-06-12 Thread Michael Selik
On Sun, Jun 12, 2016 at 3:01 PM Fillmore wrote: > What's my best way to achieve this? > What are your criteria for "best"? > The idea is that I'll receive a bit of data, determine which tree is > suitable for handling it, and dispatch the data to the right tree for > further processing. > How

Re: base64.b64encode(data)

2016-06-13 Thread Michael Torrie
On 06/12/2016 11:16 PM, Steven D'Aprano wrote: > "Safe to transmit in text protocols" surely should mean "any Unicode code > point", since all of Unicode is text. What's so special about the base64 > ones? > > Well, that depends on your context. For somebody who cares about sending > bits over a p

Re: Conversion: execfile --> exec

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016, 10:36 AM Rustom Mody wrote: > On Monday, June 13, 2016 at 7:41:33 PM UTC+5:30, MRAB wrote: > > On 2016-06-13 14:24, Long Yang wrote: > > > The python 2.x command is as following: > > > --- > > > info = {} > > > execfile(join('chaco', '__init__.py'), i

Re: Overriding methods inherited from a superclass with methods from a mixin

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 12:01 AM wrote: > I haven't used Python for some time so I don't feel confident to judge > Yet, you are clearly judging the code you pasted as not OK. Perhaps you guys could help me either convincing me that the bpaste code is > OK > It would be helpful for you to expla

Re: Conversion: execfile --> exec

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 1:51 PM Rustom Mody wrote: > looks (to me) like an intent to import the package chaco with no locals > and globals -- Just guessing of course > And without creating a module object. I suppose that means it doesn't get cached in sys.modules either. Not sure if that's a fea

Re: Overriding methods inherited from a superclass with methods from a mixin

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 2:46 PM wrote: > Thank you for your replies. I don't know if I'm quoting you correctly, I'm > quite confused with Google Groups... not sure if it's a "forum", something > like a mailing list, or both... or neither. > Mailing list. A "forum" in the metaphorical sense, not

Re: for / while else doesn't make sense

2016-06-13 Thread Michael Selik
On Sun, Jun 12, 2016 at 10:16 PM Steven D'Aprano wrote: > On Mon, 13 Jun 2016 04:44 am, Michael Selik wrote: > > > On Sun, Jun 12, 2016 at 6:11 AM Steven D'Aprano < > > [email protected]> wrote: > > > >> - run the for block

Re: Overriding methods inherited from a superclass with methods from a mixin

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 7:46 PM wrote: > I ... am making an effort to get used to the rtl order as quickly as > possible. > Funny, you keep saying right-to-left. I think the issue is you think the parent class is more important. Fight the power! Youth revolt! In Python, the children are in contr

Re: for / while else doesn't make sense

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 10:46 PM Steven D'Aprano wrote: > On Tue, 14 Jun 2016 09:45 am, Michael Selik wrote: > > On Sun, Jun 12, 2016 at 10:16 PM Steven D'Aprano > > wrote: > >> On Mon, 13 Jun 2016 04:44 am, Michael Selik wrote: > >> > O

Re: for / while else doesn't make sense

2016-06-15 Thread Michael Selik
On Wed, Jun 15, 2016, 10:28 AM Rustom Mody wrote: > Where did the question of "break can be written as goto" come from? > Stephen said the "else" in for-else was "unconditional". He argued that neither the presence nor absence of a break should be considered a condition, because we don't conside

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Michael Torrie
On 06/15/2016 08:57 AM, Jussi Piitulainen wrote: > Marko Rauhamaa writes: >> And nothing in alister's answer suggests that. > > Now *I'm* surprised. He simply said, here's a regex that can parse the example string the OP gave us (which maybe looked a bit like HTML, but like you say, may not be),

Re: Method Chaining

2016-06-16 Thread Michael Selik
On Thu, Jun 16, 2016 at 10:53 PM Lawrence D’Oliveiro wrote: > Example from , > concisely expressing a complex drawing sequence: > > (g > .move_to((p1 + p2a) / 2) > .line_to(p1 + (p2 - p1) * frac) > .line_to((p1

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016 at 5:31 AM Steven D'Aprano wrote: > (g.move_to((p1 + p2a) / 2) > .line_to(p1 + (p2 - p1) * frac) > .line_to((p1 + p1a) / 2) > .stroke() > ) > > the parens and indentation more clearly mark this chunk of code as a > unit. I prefer reserving indentation for where they

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016, 6:42 PM Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 1:35:06 AM UTC+12, Michael Selik wrote: > > > The chained version looks like each method is returning a modified > > copy. > > As opposed to a modified original? > Correct. Read

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016, 6:44 PM Michael Selik wrote: > > > On Fri, Jun 17, 2016, 6:42 PM Lawrence D’Oliveiro > wrote: > >> On Saturday, June 18, 2016 at 1:35:06 AM UTC+12, Michael Selik wrote: >> >> > The chained version looks like each method is returning a

Re: PyCon Keynote

2016-06-18 Thread Michael Torrie
On 06/18/2016 03:20 PM, Chris Angelico wrote: > On Sun, Jun 19, 2016 at 7:14 AM, Quivis wrote: >> On Thu, 09 Jun 2016 12:53:37 -0700, Ethan Furman wrote: >> >>>https://www.youtube.com/watch?v=bSfe5M_zG2s >> >> Good example of how not to do a presentation. Embarrassing. >> I turned it off after

Re: PyCon Keynote

2016-06-18 Thread Michael Torrie
On 06/18/2016 04:33 PM, Michael Torrie wrote: > On 06/18/2016 03:20 PM, Chris Angelico wrote: >> On Sun, Jun 19, 2016 at 7:14 AM, Quivis wrote: >>> On Thu, 09 Jun 2016 12:53:37 -0700, Ethan Furman wrote: >>> >>>>https://www.youtube.com/watch?v=bSfe5M_zG2

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/17/2016 05:52 PM, Chris via Python-list wrote: > Any suggestions for a good open source text editor for the Mac out > there? For now, I am going to stick with vim. Good choice. -- https://mail.python.org/mailman/listinfo/python-list

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/18/2016 06:12 PM, Lawrence D’Oliveiro wrote: > On Sunday, June 19, 2016 at 11:07:23 AM UTC+12, Michael Torrie > wrote: >> >> On 06/17/2016 05:52 PM, Chris via Python-list wrote: >>> >>> Any suggestions for a good open source text editor for the Mac &g

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/18/2016 06:50 PM, Michael Torrie wrote: > On 06/18/2016 06:12 PM, Lawrence D’Oliveiro wrote: >> But not vi/vim. It only lets you place your cursor *on* a character, >> not *in-between* characters. That’s why you need two separate >> insertion commands, insert-before and

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/18/2016 06:12 PM, Lawrence D’Oliveiro wrote: > Pull up any old GUI-based editor you like, for example Windows > (shudder) Notepad. If there are N characters in your file, then the > insertion point can be placed at N + 1 positions: in-between two > adjacent characters, or before the first cha

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/18/2016 08:51 PM, Lawrence D’Oliveiro wrote: > On Sunday, June 19, 2016 at 2:09:31 PM UTC+12, Michael Torrie wrote: >> It was later on that they figured out the N+1 thing you mentioned by >> ignoring the character cells: >> >> 0 1 2 3 4 5 6 7 8 9 10 >> H E

Re: best text editor for programming Python on a Mac

2016-06-18 Thread Michael Torrie
On 06/18/2016 08:51 PM, Lawrence D’Oliveiro wrote: > On Sunday, June 19, 2016 at 2:09:31 PM UTC+12, Michael Torrie wrote: >> It was later on that they figured out the N+1 thing you mentioned >> by ignoring the character cells: >> >> 0 1 2 3 4 5 6 7 8 9 10 H E L L O

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Michael Torrie
On 06/19/2016 04:41 AM, Pete Forman wrote: > Both emacs and vim are powerful tools in the hands of experienced users > but I would recommend neither to someone starting out who is just > looking for a code-aware editor. In any case this doesn't matter here because the original poster already said

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Michael Torrie
On 06/19/2016 01:34 AM, Lawrence D’Oliveiro wrote: > On Sunday, June 19, 2016 at 7:13:26 PM UTC+12, Christian Gollwitzer wrote: > >> Am 19.06.16 um 02:12 schrieb Lawrence D’Oliveiro: >> >>> But not vi/vim. It only lets you place your cursor *on* a character, >>> not *in-between* characters. >> >>

Re: Method Chaining

2016-06-19 Thread Michael Torrie
On 06/19/2016 09:01 AM, Ethan Furman wrote: > On 06/19/2016 04:56 AM, Joonas Liik wrote: >> On 18 June 2016 at 23:47, Ethan Furman wrote: >>> On 06/18/2016 07:05 AM, Joonas Liik wrote: > the leading dot does not resolve the ambiguity that arises from: with ob_a: with ob_b

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Michael Torrie
On 06/19/2016 10:20 AM, Rustom Mody wrote: > Yes the OP said he was using vim > And he could not handle a unicode encoding issue I missed that part! I somehow thought the unicode issues were coming from his use of the built-in Mac text editor. In any case, I have never had unicode problems with v

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Michael Torrie
On 06/19/2016 12:06 PM, Christian Gollwitzer wrote: > Am 19.06.16 um 18:20 schrieb Rustom Mody: >> I gave an emacs solution to the issue not because I find editor-wars engaging >> but because I dont know how to do *this* with vi. >> I'd be surprised if vi actually cant do these: >> 1. Look under th

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Michael Torrie
On 06/19/2016 03:21 PM, Quivis wrote: > On Sat, 18 Jun 2016 20:26:36 -0400, Joel Goldstick wrote: > >> that it is on every linux system > > No, it isn't! I can be *installed* on every Linux system, but that a > whole other can of worms. True vim is not. But vi should be. I'm not aware of any L

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Michael Torrie
On 06/21/2016 06:10 AM, Tal Zion wrote: > So how does this magic work? We developed a new compiler platform called > Bridge. At the heart of Bridge is the Bridge Extensible Code > Representation (BECR). Code in any language is parsed into an AST and is > then translated to the BECR. The BECR sup

Re: Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Michael Selik
On Tue, Jun 21, 2016, 10:14 AM Terry Reedy wrote: > On 6/21/2016 3:34 AM, Ari Freund via Python-list wrote: > > I'd like to run this idea by the community to see if it's PEP worthy and > > hasn't been already rejected. > > > There was a recent (last couple of months?) discussion on python-ideas >

Re: while Loops

2016-06-21 Thread Michael Torrie
On 06/21/2016 09:50 PM, Elizabeth Weiss wrote: > i=1 > while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 since > 4 +1=5? > > Thanks for your help! If you trace the execution through in your m

Setting up Python WinXP

2016-06-22 Thread Michael Smolen
Folks: I can't wait to start programming with Python. However, I am having difficulty installing on my XP operating system. I downloaded Python-3.4.5ci as that seems like the version that will run on my operating system. The latest version will not as per mention on the website. I downloaded the

Zachary, Iremen, and BartC

2016-06-22 Thread Michael Smolen
Thanks!!! With your advice and suggestions I finally got Python installed. I used windows x86 MS Installer and it worked with three clicks. Thanks again, and again, and mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Is signed zero always available?

2016-06-22 Thread Michael Selik
On Wed, Jun 22, 2016 at 4:53 PM Christopher Reimer < [email protected]> wrote: > > On Jun 22, 2016, at 7:59 AM, Grant Edwards > wrote: > > > >> On 2016-06-22, Random832 wrote: > >>> On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: > >>> > >>> Is that guaranteed by Python, or just

Re: Setting up Python WinXP

2016-06-23 Thread Michael Smolen
this time. Progress is great until it passes you long ago, then you just have to stay afloat. Gulp, gulp, gulp... thanks. mike - Original Message - From: "Zachary Ware" To: Cc: "Michael Smolen" <[email protected]> Sent: Wednesday, June 22, 2016 11:19 AM Subje

Re: how to python to use virtual memory?

2016-06-24 Thread Michael Torrie
On 06/24/2016 08:44 PM, Dennis Lee Bieber wrote: > I don't know how Linux handles swap disk -- Windows normally sets the > swap space to ~2X physical memory (for small RAM -- my 12GB system has a > 12GB swap and suggests 18GB). Linux typically uses a user-set swap partition. The old rule of

Re: Proposal: named return values through dict initialization and unpacking

2016-06-26 Thread Michael Selik
On Tue, Jun 21, 2016 at 9:41 PM Steven D'Aprano wrote: > On Tue, 21 Jun 2016 05:34 pm, Ari Freund wrote: > > var3, var1, var2 = **d > > But I don't want to use the key names your function uses. I want to > use names which makes sense for my application > Note that my dict unpacking synt

Re: Assignment Versus Equality

2016-06-26 Thread Michael Torrie
On 06/26/2016 12:47 PM, Christopher Reimer wrote: > I started writing a BASIC interpreter in Python. The rudimentary version > for 10 PRINT "HELLO, WORLD!" and 20 GOTO 10 ran well. The next version > to read each line into a tree structure left me feeling over my head. So > I got "Writing Compil

Getting back into PyQt and not loving it.

2016-06-26 Thread Michael Torrie
I'm starting to question the advice I gave not long ago to for new users to consider the Qt toolkit with Python. I just did a little project porting a simple graphical user interface from GTK+ to Qt (PyQt4 for now as that's what I have installed). For the most part it worked out pretty well. It'

Re: Getting back into PyQt and not loving it.

2016-06-26 Thread Michael Torrie
On 06/26/2016 07:05 PM, llanitedave wrote: > Not sure that wxPython is really any different in that respect, and > Tkinter doesn't feel Pythonic to me, either -- considering how it's > Tk at heart. So what's the alternative? There really is no good > Python-based GUI tool, and that's a shame. Gu

Re: Language improvement: Get more from the `for .. else` clause

2016-06-27 Thread Michael Selik
On Mon, Jun 27, 2016 at 12:53 AM Victor Savu wrote: > capture the [StopIteration] value in the `else` statement of the `for` loop > I'm having trouble thinking of a case when this new feature is necessary. Can you show a more realistic example? -- https://mail.python.org/mailman/listinfo/python

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Michael Torrie
On 06/27/2016 12:44 AM, Lawrence D’Oliveiro wrote: > On Monday, June 27, 2016 at 6:16:01 PM UTC+12, John Ladasky wrote: > >> Between the Py3 requirement and the need to work with all major OS's, I >> decided to learn PyQt and not GTK+. > > GTK+ is available for Python 3. > > No doubt it will wo

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Michael Torrie
On 06/27/2016 02:14 PM, [email protected] wrote: > On Sunday, June 26, 2016 at 5:45:18 PM UTC-4, Michael Torrie wrote: >> >> Qt's a fantastic toolkit, and the most mature of any of them, and the >> most portable, but man the bindings are not Pythonic at all. > >

Re: Question on compiling on linux

2016-06-27 Thread Michael Torrie
On 06/27/2016 08:28 PM, Steven D'Aprano wrote: > On Tue, 28 Jun 2016 10:01 am, Dennis Lee Bieber wrote: > >> The Outlook style works well in a business environment where the >> recipient is likely the original sender of the quoted text, and doesn't >> need the context -- the quoted copy is just a

Re: Iteration, while loop, and for loop

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 8:41 AM Elizabeth Weiss wrote: > I do not understand the second code. What is counter? > It looks like someone wanted to make a loop induction variable. https://en.wikipedia.org/wiki/Induction_variable > Why do we use this code if we can use the simpler for loop? > You

Re: Iteration, while loop, and for loop

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 9:34 AM BartC wrote: > On 28/06/2016 14:15, Michael Selik wrote: > > On Tue, Jun 28, 2016 at 8:41 AM Elizabeth Weiss > wrote: > > > >> I do not understand the second code. What is counter? > >> > > > > It looks like

Re: Iteration, while loop, and for loop

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 9:26 AM Joseph Lee wrote: > > -Original Message- > From: Michael Selik > Sent: Tuesday, June 28, 2016 6:16 AM > > MS: You should not. Use the first version, it's much better. Python > for-loops are preferable to while-loops. > >

Re: fastest way to read a text file in to a numpy array

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 9:51 AM Heli wrote: > Is even reading the file in to numpy array the best method or there are > better approaches? > What are you trying to accomplish? Summary statistics, data transformation, analysis...? -- https://mail.python.org/mailman/listinfo/python-list

Re: fastest way to read a text file in to a numpy array

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 10:08 AM Hedieh Ebrahimi wrote: > File 1 has : > x1,y1,z1 > x2,y2,z2 > > > and file2 has : > x1,y1,z1,value1 > x2,y2,z2,value2 > x3,y3,z3,value3 > ... > > I need to read the coordinates from file 1 and then interpolate a value > for these coordinates on file 2 to the

Re: Sharing package data across files

2016-06-28 Thread Michael Selik
On Tue, Jun 28, 2016 at 3:21 PM wrote: > I'm trying to create a package in which the constituent files share some > state. Apparently, I don't understand scopes, namespaces, and package > semantics as well as I thought I did. Here's the directory structure for a > simplified example: > >exa

Re: Language improvement: Get more from the `for .. else` clause

2016-06-29 Thread Michael Selik
On Wed, Jun 29, 2016 at 7:11 AM Victor Savu wrote: > Please let me know if you are interested in a more concrete case such as a > domain-specific application (I can think of progress bars, logging, > transfer rate statistics ...). > Yes, please. I'd like to compare the proposed syntax against th

Re: sample chatting apps in pyqt

2016-06-30 Thread Michael Torrie
On 06/30/2016 07:45 AM, tommy yama wrote: > Hi all, > > Let me post my question here > Has anyone installed and run any of sample chat apps in pyqt? > > Although I've tried to install and run sample scripts in pyqt once, the > error said pyqt must be reinstalled. If you paste the error message h

Re: Creating a calculator

2016-06-30 Thread Michael Torrie
On 06/30/2016 09:08 PM, Elizabeth Weiss wrote: > while True: > print("Options:") > print("Enter 'add' to add two numbers") > print("Enter 'subtract' to subtract two numbers") > print("Enter 'multiply' to multiply two numbers") > print("Enter 'divide' to divide two numb

Structure of program development

2016-07-04 Thread Michael Smolen
Folks: I am new to this programming adventure. I've gotten past the introductory chapters in 'How to..." books and now want to start developing a much more complicated program that I will use repeated for different applications. When I worked in Perl there was an option to write a program in a

Re: Structure of program development

2016-07-04 Thread Michael Torrie
On 07/04/2016 01:50 PM, BartC wrote: > On 04/07/2016 17:55, Chris Warrick wrote: > >>> A second question of the basic design. If I write a program, can I move it >>> to a computer that is without any Python software, or does that machine >>> have to download the Python software? Does Python prod

Re: Making Classes Subclassable

2016-07-04 Thread Michael Selik
On Mon, Jul 4, 2016, 4:36 AM Lawrence D’Oliveiro wrote: > On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: > > --> "type(obj)" or "obj.__class__" (there are small differences) > > give you the type/class of "obj". > > When would it not be the same? > Old-style classes. > -- https://

Re: Need help compiling Python-devel

2016-07-05 Thread Michael Torrie
On 07/05/2016 10:35 AM, TM wrote: > This option is not straight forward. There are too many dependencies. > Easier in Linux not so easy in AIX. > > Is it possible to copy the python executable (ie the code below)? > # cp -p python python-devel What is this python-devel thing? You said you wanted

Re: the best online course

2016-07-06 Thread Michael Torrie
On 07/06/2016 06:50 PM, Lawrence D’Oliveiro wrote: >> I want to be easy and not bored so i can learn python. > > There is no Royal Road, nothing is going to be handed to you on a plate. Seconded. If he gets bored easily, he will not be very successful at learning Python or any other programming

<    6   7   8   9   10   11   12   13   14   15   >