Re: Lists: why is this behavior different for index and slice assignments?

2008-04-21 Thread Michael Torrie
John Salerno wrote: > So the question is, when you assign an empty list to an index, why does > it insert an empty list, but when you assign an empty list to a slice, > it simply deletes the slice? I would say this is consistent behavior because a list slice is also a list itself. Whereas a lis

Re: Problems replacing \ with \\

2008-04-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Hi... > > Here's a weird problem...I'm trying to escape a bunch of data to put > into a database. Is it possible to use the database API and prepared statements to avoid having to go through this exercise? Also, most database APIs work natively in unicode, so creating

library to do easy shell scripting in Python

2008-04-23 Thread Michael Torrie
Recently a post that mentioned a recipe that extended subprocess to allow killable processes caused me to do some thinking. Some of my larger bash scripts are starting to become a bit unwieldy (hundreds of lines of code). Yet for many things bash just works out so well because it is so close to t

Re: Problem using copy.copy with my own class

2008-04-23 Thread Michael Torrie
Jeffrey Barish wrote: > Marc 'BlackJack' Rintsch wrote: >> Please simplify the code to a minimal example that still has the problem >> and *show it to us*. It's hard to spot errors in code that nobody except >> you knows. > > Here it is: > > import copy > > class Test(int): > def __new__(cl

Re: Zope/DTML Infuriating...

2008-05-01 Thread Michael Torrie
Jens wrote: > - Why is it, when primitive data types seem to be objects (similar to > javascript), that type casting is done through build-in functions > rather than methods, e.g. String.toInt('5') or '5'.toInt() or x = > Integer.fromString('5'). Mainly because it's much cleaner to do it the pytho

Re: Zope/DTML Infuriating...

2008-05-01 Thread Michael Torrie
Michael Torrie wrote: > The second example, x = Integer.fromString('5') demonstrates a huge > weakness in Java. Ahem. Javascript. Sorry. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stream I/O to a java applet (os.popen?)

2008-05-01 Thread Michael Torrie
Cody Woolaver wrote: > This is all done at the terminal though and i need to have it done through a > python file. I'm aware that i will have to use os.popen but am unfamiliar > with how it works. You'll probably want to look at the subprocess module, which replaces the old os.popen stuff. It's

Re: Finally had to plonk google gorups.

2008-05-02 Thread Michael Torrie
Shawn Milochik wrote: > How does one "plonk" stuff from Google Groups? Specifically, how > can this be done in Gmail? Set up a filter that looks for some phrase in the mail headers that identifies messages originating from google groups. Gmail's filters are fairly flexible. I'd probably just hav

Re: Finally had to plonk google gorups.

2008-05-02 Thread Michael Torrie
Mensanator wrote: > On May 2, 9:53 am, Michael Torrie <[EMAIL PROTECTED]> wrote: >> Shawn Milochik wrote: >>> How does one "plonk" stuff from Google Groups? Specifically, how >>> can this be done in Gmail? >> Set up a filter that looks for s

Re: Why don't generators execute until first yield?

2008-05-07 Thread Michael Torrie
Martin Sand Christensen wrote: > Why don't > generators follow the usual eager evaluation semantics of Python and > immediately execute up until right before the first yield instead? A great example of why this behavior would defeat some of the purpose of generators can be found in this amazing PD

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Have a look at this: > -123**0 > -1 > > > The result is not correct, because every number (positive or negative) > raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). No python is correct. you're expression parses this way, when converted to a li

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
Ahem... That should have been: (negate (pow 123 0)) Using parenthesis to indicate precedence order of ops: -(123 ^ 0) The "-" you are using is not part of the number. It's a unary operator that negates something. In normal order of operations, it has a much lower priority than power. Your p

Re: The del statement

2008-05-09 Thread Michael Torrie
George Sakkis wrote: > I think you're trying to imply that it is consistent with setting a > value (same with getting). I guess what bugs me about "del" is that > it's a keyword and not some universally well-known punctuation. Do you > you feel that Python misses a "pop" keyword and respective > ex

Re: Module python-magic on/for Windows?

2008-05-11 Thread Michael Torrie
Larry Hale wrote: > Now I *presume* my problem (at this point) is that I need to have > libmagic named as "magic1.dll" -wherever- this module is looking for > it. I'm just not sure, let alone if this is true, WHERE Python/ > modules expect to find such things. > > Also, which version(s)/file(s) s

Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Michael Torrie
On 02/27/2016 11:13 AM, wrong.addres...@gmail.com wrote: > On Saturday, 27 February 2016 18:08:36 UTC+2, Dietmar Schwertberger >> As of today, there's no Python GUI builder comparable to VB 6. > Thanks for stating this clearly. Everyone here has been trying to > show me various ways to do the kind

Re: creating zipfile with symlinks

2016-03-04 Thread Michael Torrie
On 03/04/2016 05:18 AM, Larry Martell wrote: > Unfortunately very slow - around 8 minutes to zip a 7GB dir using the > command line zip vs. 13 seconds with the python zipfile module. And likely Python's zipfile is just giving up and storing the file without compression. What does unzip -v say abo

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-08 Thread Michael Torrie
On 03/07/2016 05:45 PM, Chris Angelico wrote: > On Tue, Mar 8, 2016 at 11:22 AM, BartC wrote: >> >> (Is a byte string the same as a byte array? Is a byte array the same as an >> array.array? If I remove this line from my code, where 'data' has just been >> read from a file: >> >>data=array.arr

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-08 Thread Michael Torrie
On 03/07/2016 11:34 AM, BartC wrote: > (I'm quite pleased with my version: smaller, faster, works on all the > Pythons, supports all 3 colour formats and no decoding bugs that I'm > aware of, and it's the first Python program I've written that does > something useful.) I think you should be com

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-11 Thread Michael Torrie
On 03/11/2016 03:24 PM, BartC wrote: > On 11/03/2016 21:59, Mark Lawrence wrote: >> On 11/03/2016 18:57, BartC wrote: > >> def test(): >> s="" >> for i in range(1000): >> s+="*" >> print (len(s)) >> >> test() > >> The minor snag that you might like to correct with your

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Michael Torrie
On 03/14/2016 08:43 AM, BartC wrote: > But how do you pass 'a' itself? > > Perhaps you can say: > >f('a') > > and f can do some sort of lookup, if it knows the caller's context, for > such a name and retrieve the value that way. But that's rather > heavy-handed, and f can't distinguish bet

Re: How to waste computer memory?

2016-03-18 Thread Michael Torrie
On 03/18/2016 02:26 AM, Jussi Piitulainen wrote: > I think Julia's way of dealing with its strings-as-UTF-8 [2] is more > promising. Indexing is by bytes (1-based in Julia) but the value at a > valid index is the whole UTF-8 character at that point, and an invalid > index raises an exception. This

Re: How to waste computer memory?

2016-03-19 Thread Michael Torrie
On 03/19/2016 02:38 AM, Steven D'Aprano wrote: > On Sat, 19 Mar 2016 01:30 pm, Random832 wrote: > >> On Fri, Mar 18, 2016, at 20:55, Chris Angelico wrote: >>> On Sat, Mar 19, 2016 at 9:03 AM, Marko Rauhamaa wrote: Also, special-casing '\0' and '/' is lame. Why can't I have "Results 1/20

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-22 Thread Michael Torrie
On 03/22/2016 06:59 AM, BartC wrote: > I'm not sure I follow. Your solution to dealing with the scenarios > raised by Steven D'Aprano is to: > > (1) Not bother with exceptions at all inside the function Correct, if your function is not equipped to handle this exceptional circumstance and do the

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Michael Torrie
On 03/21/2016 06:43 AM, BartC wrote: > On 21/03/2016 12:08, Ned Batchelder wrote: >> On Sunday, March 20, 2016 at 9:15:32 PM UTC-4, BartC wrote: >>> >>> A tokeniser along those lines in Python, with most of the bits filled >>> in, is here: >>> >>> http://pastebin.com/dtM8WnFZ >>> >> >> Bart, we get

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Michael Torrie
On 03/24/2016 04:18 PM, Mark Lawrence wrote: > On 24/03/2016 19:54, BartC wrote: >> On 24/03/2016 18:10, Steven D'Aprano wrote: >>> On Fri, 25 Mar 2016 12:01 am, BartC wrote: >> >>> >>> Then those numbers are pointless. >> >> Yes, they would need some adjustment to do this stuff properly. > > Plea

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-26 Thread Michael Torrie
On 03/26/2016 05:37 AM, Ned Batchelder wrote: > [...] > Has anyone ever said to you, "Thanks, Thomas! Lots of people were giving > me answers, but they were all so kind and polite about it, I couldn't > see what they were saying. Finally, your blunt direct manner got > through to me, so now I und

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-26 Thread Michael Torrie
On 03/26/2016 11:49 AM, Michael Torrie wrote: > Well said, Ned, and a good reminder for me, and I suspect all of us, to > considering how we communicate. It's our nature to think problems lie ^^ Sigh. Consider. And proof read. > with everyone else but us (as witne

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-28 Thread Michael Torrie
On 03/28/2016 06:44 PM, Steven D'Aprano wrote: > http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ I have the same problem as the writer. Working in Python makes me really dislike working in any other language! -- https://mail.python.org/mailman/listinf

Re: [beginner] What's wrong?

2016-04-02 Thread Michael Torrie
Mark, your messages are showing up to the list as being from "python," at least on my email. Any reason for this? -- https://mail.python.org/mailman/listinfo/python-list

Re: PyQt4

2016-04-03 Thread Michael Torrie
On 04/03/2016 12:57 PM, Muhammad Ali wrote: > > Hi, > > How can we confirm that either PyQt4 is already installed on LInux machine > or not? > > Please suggest commands to confirm the already existence of PyQt4 in the > machine. Ideally you make a distribution-specific package of the binary

From email addresses sometimes strange on this list - was Re: [beginner] What's wrong?

2016-04-04 Thread Michael Torrie
On 04/04/2016 08:04 AM, Mark Lawrence via Python-list wrote: > On 02/04/2016 23:49, Michael Torrie wrote: >> Mark, your messages are showing up to the list as being from "python," >> at least on my email. Any reason for this? >> > > Assuming that you're

Re: From email addresses sometimes strange on this list - was Re: [beginner] What's wrong?

2016-04-04 Thread Michael Torrie
On 04/04/2016 04:58 PM, Chris Angelico wrote: > O That probably explains it. It's because of Yahoo and mailing > lists. Yahoo did stuff that breaks stuff, so Mailman breaks stuff > differently to make sure that only Yahoo people get messed up a bit. > It means their names and addresses get

Re: Python garbage collection: not releasing memory to OS!

2016-04-15 Thread Michael Torrie
On 04/15/2016 04:25 AM, cshin...@gmail.com wrote: > The input was a 4MB file. Even after returning from the 'fileopen' > function the 4MB memory was not released. I checked htop output while > the loop was running, the resident memory stays at 14MB. So unless > the process is stopped the memory sta

Re: Fraud

2016-04-16 Thread Michael Torrie
On 04/16/2016 04:21 PM, Erik wrote: > On 16/04/16 23:02, Joel Goldstick wrote: >>> On Sun, Apr 17, 2016 at 3:12 AM, Mel Drosis via Python-list >>> wrote: My phone my accounts my home network have all been affected because of someone using coding from Python and Linux and GitHub and

Re: Guido sees the light: PEP 8 updated

2016-04-17 Thread Michael Torrie
On 04/17/2016 10:13 AM, Dennis Lee Bieber wrote: > On Sat, 16 Apr 2016 21:59:01 -0400, Random832 > declaimed the following: > >> >> I heard Windows 10 is going to finally fix this, anyway. > > Probably by removing the old CLI window completely and making everyone > learn PowerShell ISE Or

Re: QWERTY was not designed to intentionally slow typists down

2016-04-17 Thread Michael Torrie
On 04/17/2016 07:39 PM, Steven D'Aprano wrote: > Even though QWERTY wasn't designed with touch-typing in mind, it's > interesting to look at some of the weaknesses of the system. It is almost > as if it had been designed to make touch-typing as inefficient as > possible :-) Just consider the home k

Re: How much sanity checking is required for function inputs?

2016-04-23 Thread Michael Torrie
On 04/23/2016 07:45 PM, Christopher Reimer wrote: > I had to confront all the bad habits I brought over Java and change my > code to be more Pythonic. This is where I started having fun, learning > the tricks and collapsing multi-line code into a single line code. I've > learned more about Pytho

Re: How much sanity checking is required for function inputs?

2016-04-23 Thread Michael Torrie
On 04/23/2016 08:32 PM, Christopher Reimer wrote: > That's the other problem I'm running into. Building a chess engine is a > big project. This is probably bigger than the Java XML parser I built > from scratch for a college project. I can't seem to find any information > on how to build bigger

Re: How much sanity checking is required for function inputs?

2016-04-23 Thread Michael Torrie
On 04/23/2016 09:41 PM, Christopher Reimer wrote: > I never wanted to learn Java in the first place. My community college > couldn't afford to renew the Microsoft site license, which local > employers required to learn C/C++ in MS Visual Studio, and all flavors > of Java got taught for the progr

Re: Scraping email to make invoice

2016-04-24 Thread Michael Torrie
On 04/24/2016 12:58 PM, CM wrote: > 1. INPUT: What's the best way to scrape an email like this? The > email is to a Gmail account, and the content shows up in the email as > a series of basically 6x7 tables (HTML?), one table per PO > number/task. I know if the freelancer were to copy and paste the

Re: what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread Michael Torrie
On 04/25/2016 08:13 AM, oyster wrote: > so, what produces this difference between py2 and py3 in nature? is > there more examples? where can I find the text abiut his difference? One thing I see is that both your py2 and py3 examples are treating print as a function. It's only a function in Py3.

Re: Scraping email to make invoice

2016-04-25 Thread Michael Torrie
On 04/25/2016 08:39 AM, Grant Edwards wrote: > Your normal gmail password is used for IMAP. Actually, no, unless you explicitly tell Google to allow "less-secure" authentication. Otherwise you are required to set up a special, application-specific password. https://support.google.com/accounts/an

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

2016-04-27 Thread Michael Torrie
On 04/27/2016 07:12 PM, Christopher Reimer wrote: > class Piece(object): > def __init__(self, color, position, state=None): > if state is None: > self._state = { > 'class': self.__class__.__name__, > 'color': color, > 'fi

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

2016-04-27 Thread Michael Torrie
On 04/27/2016 08:49 PM, Christopher Reimer wrote: > On 4/27/2016 7:00 PM, Michael Torrie wrote: >> I am guessing that the reason you are storing state as it's own >> dictionary is so that you can pass the state itself to the constructor? > > Someone said it was bad to

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

2016-04-27 Thread Michael Torrie
On 04/27/2016 10:06 PM, Christopher Reimer wrote: > On 4/27/2016 8:52 PM, Michael Torrie wrote: >> In fact if it were me I would save game state to some kind of ini file, >> which would mean manually going through each object and writing out the >> relevant data to the ini

Re: Need help understanding list structure

2016-05-02 Thread Michael Torrie
On 05/02/2016 04:33 PM, moa47...@gmail.com wrote: > Yes, that does help. You're right. The author of the library I'm > using didn't implement either a __str__ or __repr__ method. Am I > correct in assuming that parsing a large text file would be quicker > returning pointers instead of strings? I've

Re: Fastest way to retrieve and write html contents to file

2016-05-02 Thread Michael Torrie
On 05/02/2016 01:37 AM, DFS wrote: > So python matches or beats VBScript at this much larger file. Kewl. If you download something large enough to be meaningful, you'll find the runtime speeds should all converge to something showing your internet connection speed. Try downloading a 4 GB file, f

Re: After a year using Node.js, the prodigal son returns

2016-05-05 Thread Michael Torrie
On 05/04/2016 02:59 AM, Steven D'Aprano wrote: > A year ago, Gavin Vickery decided to move away from Python and give > Javascript with Node.js a try. Twelve months later, he has written about his > experiences: > > > http://geekforbrains.com/post/after-a-year-of-nodejs-in-production Very inter

Re: Python PygLatin

2016-05-09 Thread Michael Torrie
On 05/08/2016 04:21 AM, Cai Gengyang wrote: > This is a long > road ahead, but I believe it is worth it because the power of a new > technology does eventually translate into money. If this is your prime motivation, I think you'll be very disappointed. A good programmer certainly can make a good

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-12 Thread Michael Torrie
On 05/12/2016 03:12 AM, alister wrote: > On Tue, 10 May 2016 19:40:02 -0400, DFS wrote: > >> Sometimes I try to be a funny smart-aleck and it doesn't work. > > this is the problem everyone is having with your post, you acknowledge > that it doesn't work so why keep trying. > > I too can fall gu

Re: Average calculation Program *need help*

2016-05-12 Thread Michael Torrie
On 05/12/2016 10:22 PM, Jake Kobs wrote: > On Thursday, May 12, 2016 at 10:48:08 AM UTC-5, Jake Kobs wrote: >> Hello all, I have been struggling with this code for 3 hours now and I'm >> still stumped. My problem is that when I run the following code: >> ---

Re: Average calculation Program *need help*

2016-05-12 Thread Michael Torrie
On 05/12/2016 11:03 PM, Jake Kobs wrote: > Im not sure how to move it inside the for loop. I've been working on > this small problem for like 4 hours lol. I'm sorry it's so frustrating. Sounds like you haven't got down some of the most basic fundamentals yet. In Python, things that should happen

Re: Fw: Question about issue with opening Python

2016-05-13 Thread Michael Torrie
On 05/13/2016 07:05 AM, christopher.amor...@mail.citytech.cuny.edu wrote: > I downloaded an older version of Python and for about an hour it was > working, but started to get the same error message I received when > using the latest version of Python. You'll have to tells us what the error was tha

Re: Fw: Question about issue with opening Python

2016-05-13 Thread Michael Torrie
On 05/13/2016 07:47 AM, christopher.amor...@mail.citytech.cuny.edu wrote: > Hello, > > Thank you for your reply. It says "IDLE's subprocess didn't make > connection. Either IDLE can't start a subprocess or personal firewall > software is blocking the connection." It worked after the first hour > o

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: 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: 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: 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:torr...@gmail.com>> 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, jlada...@itu.edu 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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: 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, codewiz...@gmail.com 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: 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

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: 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

<    1   2   3   4   5   6   7   8   9   10   >