Re: [Tutor] Notepad++ question

2012-06-07 Thread Marc Tompkins
On Thu, Jun 7, 2012 at 12:41 AM, Alan Gauld wrote: > This is almost certainly down to mixing tabs and spaces. > You can mix them in a file but not within a block. (And > even then I would recommend sticking to just one style) > Some editors make it worse by autoindenting with a mixture > of tabs a

Re: [Tutor] Finding palindromes in a list

2012-06-08 Thread Marc Tompkins
On Fri, Jun 8, 2012 at 5:10 PM, Mike Nickey wrote: > def compareElements(wordList): >for item in wordList(): >if item == item.reversed(): >print item >else: >next(item) > > reversed() is not a string method. To reverse a string, try something like this

Re: [Tutor] get columns from txt file

2012-07-13 Thread Marc Tompkins
On Thu, Jul 12, 2012 at 11:36 PM, susana moreno colomer < susana...@hotmail.com> wrote: > Hi! > I am trying this, but still I get 6 numbers per cell. The only one > difference is that I get a comma between numbers instead an space. > I am opening the document also with excel > Many thanks, > Susa

Re: [Tutor] get columns from txt file

2012-07-13 Thread Marc Tompkins
Reply to the group, please! On Fri, Jul 13, 2012 at 2:09 AM, susana moreno colomer < susana...@hotmail.com> wrote: > > Hi! > I am sorry, but still I don't get it! > I am trying with this (the code is attached) > > csv_out=csv.writer(open('out1.csv', 'wb'), delimiter=' ', > quoting=csv.QUOTE_ALL,

Re: [Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Marc Tompkins
On Thu, Jul 5, 2012 at 9:30 AM, Prinn, Craig wrote: > ** ** ** ** ** ** > > I am trying to convert an EBCIDIC file to ASCII, when the records are > fixed length I can convert it fine, I have some files that are coming in as > variable length records, is there a way to convert the file in Python? I

Re: [Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Marc Tompkins
helps, and I don't know what you'd need to move forward. Good luck! > > ** ** > -- > > *From:* Marc Tompkins [mailto:marc.tompk...@gmail.com] > *Sent:* Friday, July 13, 2012 3:30 PM > *To:* Prinn, Craig > *Cc:* tutor@python.

Re: [Tutor] finally without try or except

2012-07-30 Thread Marc Tompkins
On Mon, Jul 30, 2012 at 9:56 AM, Tino Dai wrote: > Hi! > > Is there anyway to execute a block of code at the end of a program in > 2.6 regardless of what happened before eg exiting normally or died because > of an exception? > I was thinking about maybe a free standing finally code block or

Re: [Tutor] running more than one python program at the same time

2012-08-28 Thread Marc Tompkins
On Tue, Aug 28, 2012 at 3:30 PM, Benjamin Fishbein wrote: > Hello, > I wrote a program that I want to have running 24/7. But the problem is > that I also want to write and run other programs. I'm using Idle and it > won't let me run more than one script at a time. Do you know if there's a > way to

Re: [Tutor] running more than one python program at the same time

2012-08-29 Thread Marc Tompkins
On Tue, Aug 28, 2012 at 7:35 PM, Steven D'Aprano wrote: In Windows, that is the DOS prompt -- either cmd.com or command.exe, I > never remember which one is which. I'm pretty sure that was intentional, but just in case... In MS-DOS/PC-DOS, and in 16-bit versions of Windows (up to Windows 98/Me,

Re: [Tutor] How to send email from a gmail a/c using smtp when port 587(smtp) is blocked

2012-09-11 Thread Marc Tompkins
On Tue, Sep 11, 2012 at 2:44 PM, ashish makani wrote: > Folks, > > some more context so people presume we are spammers :) > > These emails are automated diagnostic emails sent to a group of a few > admins, so we get notified when a python heartbeat script, detects a > failure in things like n/w co

Re: [Tutor] How to send email from a gmail a/c using smtp when port 587(smtp) is blocked

2012-09-11 Thread Marc Tompkins
On Tue, Sep 11, 2012 at 3:27 PM, ashish makani wrote: > Marc, > your 3rd point, > >> you could establish a VPN tunnel to some server outside of the >> university's network and send from port 587 on THAT machine. Complicated, >> weird, and not horribly secure. Bu

[Tutor] Fwd: "ImportError: _strptime not supported"

2012-10-02 Thread Marc Tompkins
Forgot to send to the list. Grrr. -- Forwarded message -- From: Marc Tompkins Date: Tue, Oct 2, 2012 at 3:32 PM Subject: Re: [Tutor] "ImportError: _strptime not supported" To: aklei...@sonic.net On Tue, Oct 2, 2012 at 3:19 PM, wrote: > > The following c

Re: [Tutor] bin to dec conversion puzzlement

2015-04-20 Thread Marc Tompkins
On Apr 20, 2015 6:56 AM, "Jim Mooney" wrote: > > I can't seem to get my head around this 'simple' book example of > binary-to-decimal conversion, which goes from left to right: > > B = '11011101' > I = 0 > while B: > I = I * 2 + int(B[0]) > B = B[1:] > > print(I) > >>> 221 > > My thought w

Re: [Tutor] Pun panic, was Re: calling a method directly

2015-04-21 Thread Marc Tompkins
On Tue, Apr 21, 2015 at 7:09 AM, Martin A. Brown wrote: > And, I dairy not chase this pun any further > No - keep milking it. It gets butter all the time. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Is there a way to store and later use comparison operators (<, <=, =, >=, >) ?

2015-04-29 Thread Marc Tompkins
On Wed, Apr 29, 2015 at 1:10 PM, boB Stepp wrote: > Python 2.4.4, Solaris 10. > > I have some functions that I believe I could collapse into a single > function if I only knew how: > > def choose_compare(operator, value0, value1, pass_color, fail_color): > """ > Perform the comparison ind

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread Marc Tompkins
On Aug 10, 2015 12:17 PM, "David Rock" wrote: > Yeah, BS is more accurate (although BS says Delete on my keyboard). > Gotta love consistency :-) I'm guessing you use a Mac, then...? Whenever I have to use a Mac keyboard, the lack of a Delete/relabeling of the Backspace key drives me nuts. The e

Re: [Tutor] Dave Angel

2015-08-18 Thread Marc Tompkins
Thank you very much - and thanks to Dave for his contributions over the years. On Tue, Aug 18, 2015 at 1:49 AM, Alan Gauld wrote: > Many members of the list will remember Dave Angel as a regular and active > participant over many years. However, Dave has not been active on the list > for a littl

Re: [Tutor] pip install in a virtualenv *without* internet?

2015-08-19 Thread Marc Tompkins
On Wed, Aug 19, 2015 at 9:18 AM, Alex Kleider wrote: > I guess if you 'never' have an internet connection what I'm trying to do > won't work, > but I'm addressing a different use case: I have connectivity in some > environments > but would like to be able to do a pip install at times when there

Re: [Tutor] About using list in a function

2015-08-19 Thread Marc Tompkins
On Wed, Aug 19, 2015 at 10:25 AM, Alan Gauld wrote: > On 19/08/15 17:09, Michelle Meiduo Wu wrote: > >> Hi there, >> I'm trying to use List in a function. But it doesn't work. Here are >> sample code not work: ---def >> getResult():ls = []ls= ls.append(

Re: [Tutor] About using list in a function

2015-08-19 Thread Marc Tompkins
On Wed, Aug 19, 2015 at 11:36 AM, Emile van Sebille wrote: > On 8/19/2015 11:20 AM, Marc Tompkins wrote: > >> (Every couple of weeks, despite my repeated >> attempts to stop TBird from auto-updating, I find that they've got a new >> version and can't connect.

Re: [Tutor] Creating lists with definite (n) items without repetitions

2015-09-06 Thread Marc Tompkins
On Fri, Sep 4, 2015 at 7:28 AM, marcus lütolf wrote: > I should probably tell you the real task are a series (maximum ~ 301) > lists in which real names of people are assigned to the items/letters for > 2 people(golfers) can be in the same list(flight) only once for an > extended period of tim

[Tutor] Beginner: Socket object and packets

2015-12-05 Thread Marc Eymard
s an actual blank line in the received packet: '\n\n' in data The statement 'any_string in data' works fine with any character except the double line drop i.e. '\n\n'. Attached full script for your consideration. Thanks in advance for your guidance, Marc __

Re: [Tutor] Newbie question: programs not printing

2016-03-10 Thread Marc Tompkins
On Thu, Mar 10, 2016 at 5:33 AM, Patrick Craine wrote: > >>> x = int(raw_input('Enter an integer: ')) > if x%2 == 0: > print 'Even' > else: > print 'Odd' > if x%3 != 0: > print 'And not divisible by 3' > Enter an integer: 3 > >>> > > It could be your email program that's messing with your indenta

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-25 Thread Marc Tompkins
On Oct 25, 2016 3:07 PM, "Ed Troy" wrote: >I get an error message: > edward@ubuntu:~$ python LED_model_utf8.py LED_IV.txt > Traceback (most recent call last): > File "LED_model_utf8.py", line 4, in > import matplotlib.pyplot as plt > ImportError: No module named matplotlib.pyplot > That la

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Marc Tompkins
On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar wrote: > I had sent the following message to Anaconda Support: > > I have just installed anaconda3-4.3.0 and upgraded Spyder to v-3.1.3. > > When I open Spyder and run a python script that has run perfectly in a > previous version of Spyder I g

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Marc Tompkins
On Mon, Feb 27, 2017 at 12:52 PM, Stephen P. Molnar wrote: > On 02/27/2017 02:29 PM, Marc Tompkins wrote: > >> On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar >> mailto:s.mol...@sbcglobal.net>> wrote: >> >> I had sent the following message to Ana

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread Marc Tompkins
On Thu, Jan 17, 2013 at 10:11 PM, Gayathri S wrote: > >>> import numpy as np > >>> import matplotlib.pyplot as plt > >>> import mlpy > >>> np.random.seed(0) > >>> mean,cov,n=[0,0],[[1,1],[1,1.5]],100 > >>> x=np.random.multivariate_normal(mean,cov,n) > >>> pca.learn(x) > Traceback (most recent call

Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Marc Tompkins
On Tue, Jan 29, 2013 at 9:19 PM, Benjamin Fishbein wrote:Then it said: > > You can also use easy_install, or if you have no Python package manager > available at all, you can just grab the single file > virtualenv.py and > run it with py

Re: [Tutor] building a website with python

2013-04-09 Thread Marc Tompkins
On Tue, Apr 9, 2013 at 2:54 PM, Prasad, Ramit wrote: > Your hosting solution (needs) to support Python, and I do not believe all > hosts support Python. You > should double check with whatever host you choose. > Almost all commercial web hosts offer limited Python support (running as an Apache mo

Re: [Tutor] Sys.argv read parameters

2013-04-17 Thread Marc Tompkins
On Wed, Apr 17, 2013 at 1:03 PM, Danny Yoo wrote: > ## > ## double: string -> string > def double(x): > return x + x > > > ## For example, a blast from the past: > print "The Noid says: " + double("pizza") > ## > I'm sorry, but this is a bug.

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread Marc Tompkins
On Wed, Apr 24, 2013 at 9:36 PM, eryksun wrote: > .py files need to be associated with %windir%\py.exe. NO! %windir% means "the directory where Windows is installed", usually (but not always) C:\Windows. You're saying that there needs to be a py.exe in the Windows directory - this is absolute

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread Marc Tompkins
On Thu, Apr 25, 2013 at 12:51 AM, eryksun wrote: > On Thu, Apr 25, 2013 at 3:41 AM, Marc Tompkins > wrote: > > On Wed, Apr 24, 2013 at 9:36 PM, eryksun wrote: > >> > >> .py files need to be associated with %windir%\py.exe. > > > > > > NO! > &

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread Marc Tompkins
On Thu, Apr 25, 2013 at 5:40 AM, boB Stepp wrote: > One thing that no one has addressed so far is why when I put quotes > around my input, as in 'boB', the program does run in the command > prompt. > Remember that input(), in Python 2, executes what's passed to it. If your input is boB, then Py

Re: [Tutor] Making a Primary Number List generator

2013-05-13 Thread Marc Tompkins
On Mon, May 13, 2013 at 4:01 PM, Daniel Magruder wrote: > Dear Dave, > I am using python 2. > I am still confused as what return does. What does it mean if a function > returns True to the caller? What is the caller? > You've defined a function - isodd - but it doesn't automatically execute. It

Re: [Tutor] Making a Primary Number List generator

2013-05-13 Thread Marc Tompkins
On Mon, May 13, 2013 at 5:13 PM, Marc Tompkins wrote: > In fact, you could shorten your isodd() function to: > > def isodd(candidate): > >return candidate%2 !=0: > and it would function identically. > Sorry - that should be > def isodd(candidate): >

Re: [Tutor] Making a Primary Number List generator

2013-05-14 Thread Marc Tompkins
On Tue, May 14, 2013 at 1:51 AM, Alan Gauld wrote: > On 14/05/13 00:01, Daniel Magruder wrote: > > I am still confused as what return does. >> > > This isn't a direct response to Alan, but to something the OP expressed many, many messages ago... The OP expressed some confusion between what a fun

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 2:26 AM, Steven D'Aprano wrote: I assumed Marc was talking hypothetically. A print function *could* > return a result, even if Python's print function does not. > > Actually, I was mixing up my memory of an overloaded print() function with Python

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 1:02 PM, Alan Gauld wrote: > On 15/05/13 16:51, Marc Tompkins wrote: > > Actually, I was mixing up my memory of an overloaded print() function >> > > And C's printf() returns the number of chars printed. > I actually wish python had follow

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 3:43 PM, Oscar Benjamin wrote: > On 15 May 2013 22:21, Marc Tompkins wrote: > > On Wed, May 15, 2013 at 1:02 PM, Alan Gauld > > wrote: > >> > >> And C's printf() returns the number of chars printed. > >> I actually wish

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 3:52 PM, Marc Tompkins wrote: > I was thinking along the lines of an optional parameter ("verbose" or > something similar), so print() would supply a return value if you asked it > to but keep stumm if you didn't. > After I hit Send, I tho

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 4:14 PM, Oscar Benjamin wrote: > I don't really understand what the reason for having the information > is. Would it return the number of characters written or the number of > bytes? > It's absolutely useless in an interactive session, or any time that print() is printing

Re: [Tutor] Making a Primary Number List generator

2013-05-15 Thread Marc Tompkins
On Wed, May 15, 2013 at 5:07 PM, Steven D'Aprano wrote: > Guido's time machine strikes again. > > > py> import sys > py> sys.stdout.write('NOBODY expects the Spanish Inquisition!\n') > NOBODY expects the Spanish Inquisition! > 40 > > > The write() method of file objects in Python 3 return the num

Re: [Tutor] Word Jumble - Chpt4 (Explanation)

2013-05-16 Thread Marc Tompkins
On Thu, May 16, 2013 at 1:03 PM, Arvind Virk wrote: import random > > WORDS = ('python','jumble','easy','difficult','lower','high') > word = random.choice(WORDS) > correct = word > jumble = "" > > while word: > position = random.randrange(len(word)) > jumble += word[position] > word =

Re: [Tutor] Python Idle Crashing

2013-05-17 Thread Marc Tompkins
On Fri, May 17, 2013 at 12:35 PM, Prasad, Ramit wrote: > Forwarding to the list as I believe the reply was mistakenly sent only to > me. > Grr. Sorry about that! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-22 Thread Marc Tompkins
On Tue, May 21, 2013 at 11:25 PM, Bod Soutar wrote: > On 22 May 2013 07:20, Jim Mooney wrote: > >> Keep the try block small. For example if it's for a call to > >> open(filename, "r") the only possible errors (assuming correct syntax) > >> are NameError for using an undefined variable and IOErro

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-22 Thread Marc Tompkins
On Wed, May 22, 2013 at 9:50 AM, boB Stepp wrote: > I guess I'll pick the first alternative. However, this brings to mind > my biggest gripe as a user of software, particularly here at work > where the programmer obviously has no medical background: cryptic > error messages that might be meaningf

Re: [Tutor] keyboard interrupt

2013-05-22 Thread Marc Tompkins
On Wed, May 22, 2013 at 12:47 PM, Jim Mooney wrote: > I made a simple ear frequency-tester, but I don't want it to go on > forever, so I tried stopping it when I pressed a key, as below, but > that doesn't work. I did check out keyboard interrupts but they seem > unnecessarily complex just to sto

Re: [Tutor] keyboard interrupt

2013-05-22 Thread Marc Tompkins
On Wed, May 22, 2013 at 1:30 PM, Jim Mooney wrote: > On 22 May 2013 13:24, Jim Mooney wrote: > >> I've not used it myself, but I believe the KeyboadInterrupt is only > >> generated by one _specific_ keypress. You mentioned that you pressed a > key > >> - did you try Control-C? > > > > Actually,

Re: [Tutor] keyboard interrupt

2013-05-24 Thread Marc Tompkins
On Thu, May 23, 2013 at 3:52 PM, Steven D'Aprano wrote: > On 24/05/13 06:37, Jim Mooney wrote: > >> Apparently Wing isn't as savvy as IDLE when it comes to communicating >>> with the subprocess. I've only searched for about a minute, but >>> apparently the way this works in Wing is to "Restart She

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Marc Tompkins
On Fri, May 24, 2013 at 7:19 PM, Steven D'Aprano wrote: You can edit *other* people's questions and answers??!??!?? > > What. The. Hell. The idea is to build an authoritative information resource (in particular, the goal is that the accepted answer to any given question will become the primary r

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Marc Tompkins
On Sun, May 26, 2013 at 6:17 AM, eryksun wrote: > On Sun, May 26, 2013 at 4:34 AM, Steven D'Aprano > wrote: > > > > So these edits aren't default-deny, but default-accept? Worse and worse. > > It shows who made the edit and when they edited it, which links to the > revision history. When a quest

Re: [Tutor] when is a generator "smart?"

2013-06-02 Thread Marc Tompkins
On Sun, Jun 2, 2013 at 9:56 AM, Jim Mooney wrote: > I still sometimes type input instead of that annoying raw_input and get a > weird error. Here's a nifty tip to get around that - and to eliminate one more thing you'd have to change later, if you switch back to 3. Put this near the top of yo

Re: [Tutor] recursion surprise

2013-06-08 Thread Marc Tompkins
On Sat, Jun 8, 2013 at 4:52 PM, Jim Mooney wrote: > Well, I thought > > if num > 10: > return num > > Was a return statement. Num does become > 10. You mean I need more than > one? > It is, and you actually have more than one. All functions return None, unless you explicitly spec

Re: [Tutor] Value Error

2013-06-12 Thread Marc Tompkins
On Wed, Jun 12, 2013 at 3:31 PM, Dave Angel wrote: > >>> cmath.sqrt(float((math.e **(i * math.pi)).real)) > 1j > Sh*t just got real. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li

Re: [Tutor] unstring

2013-06-18 Thread Marc Tompkins
On Tue, Jun 18, 2013 at 6:41 PM, Jim Mooney wrote: > Is there a way to unstring something? That is str(object) will give me > a string, but what if I want the original object back, for some > purpose, without a lot of foofaraw? > Unless you're storing them in a dictionary and the string is the ke

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Marc Tompkins
On Mon, Jun 24, 2013 at 3:48 PM, Matt D wrote: > > def __init__(self, data): > > wx.PyEvent.__init__(self) > > # this line *binds* this class to a certain type of event, > > wxDATA_EVENT > > self.SetEventType (wxDATA_EVENT) > > # and this is the actual data >

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Marc Tompkins
On Tue, Jun 25, 2013 at 6:12 PM, Steven D'Aprano wrote: > Why do you want to see rubbish like that inside your log file? Surely > something like this is better? > > log.write("data = %r" % data) > > which will give you a line like this: > > data = {'a': None, 'b': 42} > > > in your log, which is

Re: [Tutor] Repeat Until Dead

2013-06-26 Thread Marc Tompkins
On Wed, Jun 26, 2013 at 11:23 AM, Jack Little wrote: > In a combat system, how would I have a certain raw_input repeat until the > enemy is dead? > Sounds like a classic case for a "while" loop. ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] Typing 'h', 'e', 'l', 'p', 'Enter' in a window

2013-06-26 Thread Marc Tompkins
On Wed, Jun 26, 2013 at 1:45 PM, kdarroud wrote: > In our Windows machine, we have several windows open. > Using Python, how can I type 'h', 'e', 'l', 'p', 'Enter' in a specific > window that is open? > In general, Python out-of-the-box doesn't know about OS-specific things like interacting with

Re: [Tutor] Saving Progress

2013-07-04 Thread Marc Tompkins
On Thu, Jul 4, 2013 at 12:25 AM, Dave Angel wrote: > On 06/27/2013 11:16 AM, Jack Little wrote: > >> Is there a way to save a players progress in a game using python without >> any modules >> >> Jack >> >> > If you organize the game in such a way that a relatively few variables > holds the state,

Re: [Tutor] custom error classes: how many of them does one need?

2013-07-08 Thread Marc Tompkins
On Mon, Jul 8, 2013 at 1:51 PM, Albert-Jan Roskam wrote: > haha, I hadn't even noticed the 'speling eror'. I was just thinking 'what > the heck is a desert spoon'? ;-) > Many years ago, I saw this painted on the side of a pie shop: "My favorite people are the people of the dessert", said Lawrenc

Re: [Tutor] converting string to text

2013-07-10 Thread Marc Tompkins
On Wed, Jul 10, 2013 at 3:45 AM, Dave Angel wrote: > > Get rid of the BOM from the data file, and it'll work fine. You don't > specify what version of Python you're using, so I have to guess. But > there's a utf-8 BOM conversion of a BOM at the beginning of that file, and > that's not numeric.

Re: [Tutor] Reading numbers from a text file

2013-07-10 Thread Marc Tompkins
On Wed, Jul 10, 2013 at 1:41 AM, Phil wrote: > Thank you for reading this. > > Kububtu 13.04 Python 3 > > I'm attempting to read a configuration file that will restore my program > to the state that it was in when it was closed. Ideally the config file > would be human readable. > > Python actual

Re: [Tutor] New Python 3.3.2 Install Fails to Start-Up

2013-07-10 Thread Marc Tompkins
On Wed, Jul 10, 2013 at 10:27 AM, Alan Gauld wrote: > On 08/07/13 06:43, Nathan Schlaffer wrote: > > Second, I tried to run my Python programs today via IDLE but when I >> checked the Edit Menu I couldn't find a Run Menu >> > > IDLE has two modes: Shell and Edit. Shell mode is an interactive P

Re: [Tutor] A slight bug in IDLE

2013-07-14 Thread Marc Tompkins
On Sun, Jul 14, 2013 at 4:18 PM, Jim Mooney wrote: > I prefer import antigravity , but then I lose the rest of the day ;') > Pretty sure that comes from sampling everything in the medicine cabinet for comparison... ___ Tutor maillist - Tutor@python.o

Re: [Tutor] A slight bug in IDLE

2013-07-15 Thread Marc Tompkins
On Sun, Jul 14, 2013 at 7:38 PM, Jim Mooney wrote: > I am seriously considering the subway tour of North America: > http://xkcd.com/1196/large/ > I rather like the Anagram Tube Map: http://www.anagramtubemap.pwp.blueyonder.co.uk/ ___ Tutor maillist -

Re: [Tutor] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sat, Jul 20, 2013 at 4:37 PM, Jim Mooney wrote: > If only Bill Gates hadn't chosen '\', which is awkward to type and > hard to make compatible - but I think he figured his wonderful DOS > would be a Unix-killer, reign supreme, and there would be no > compatibility problem. All I can say to tha

Re: [Tutor] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sun, Jul 21, 2013 at 7:41 PM, Jim Mooney wrote: > On 21 July 2013 18:18, Marc Tompkins wrote: > > > But back in the late 1970s, no way in Hell did Gates see Linux on the > > horizon. He saw CP/M, and the choices that he (and MS in general) made > at > > th

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 10:47 AM, Jim Mooney wrote: I forgot about TREE. But figured piping C:\Python27>tree /f > pytree.txt > might be illuminating. I piped since it took forever to print because I > have python(x,y). Unfortunately, I got tiny numbers and A with umlauts > instead of the nice path

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:30 AM, Jim Mooney wrote: > On 22 July 2013 11:26, Marc Tompkins wrote: > >> >> >> >> If you haven't already read it, may I suggest Joel's intro to Unicode? >> http://www.joelonsoftware.com/articles/Unicode.html >>

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:57 AM, Jim Mooney wrote: > I had a bad feeling I'd end up learning Unicode ;') > >> >> >> It's not as painful as you might think! Try it - you'll like it! >> Actually, once you start getting used to working in Unicode by default, >> having to deal with programs that are

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
e character code associated with it. If you insist on parsing the output of TREE (instead of letter Python do things in a modern, Unicode-aware way), here's how I would do it: inFileName = "/Users/Marc/Desktop/rsp/tree.txt" with open(inFileName, 'r') as inFile:

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 1:55 PM, Jim Mooney wrote: > On 22 July 2013 13:45, Marc Tompkins wrote: > >> >> inFileName = "/Users/Marc/Desktop/rsp/tree.txt" >> with open(inFileName, 'r') as inFile: >> inString = inFile.read().decode(

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:00 PM, Jim Mooney wrote: > so I should just walk the python27 tree and write my own box drawing > chars? Or is there a more global alternative to DOS box-drawing chars to > illustrate a tree structure, other than graphic processing? > You could do worse... Again, my is

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:34 PM, eryksun wrote: > > Just to clarify, tree isn't completely Unicode naive. It writes > Unicode to the console, presuming you're using a font that supports > it, such as Consolas. > Interesting! Indeed - I just moved my test Cyrillic file to a different folder (so

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 3:22 PM, Jim Mooney wrote: > On 22 July 2013 14:11, Marc Tompkins wrote: > >> >> One way to deal with this is to specify an encoding: >> newchar = char.decode('cp437').encode('utf-8') >> > > Works fine, but I

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 6:13 PM, Dave Angel wrote: > On 07/22/2013 02:27 PM, Jim Mooney wrote: > >> Okay, I'm getting there, but this should be translating A umlaut to an old >> DOS box character, according to my ASCII table, but instead it's print >> small 'u': >> >> def main(): >> zark = '

Re: [Tutor] object size in python is in what units?

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 12:09 AM, Jim Mooney wrote: > I've noticed that when I create a number of objects from a class, one > after another, they're at different IDs, but the IDs all appear to be > equidistant, so that they all appear to have the same size. But what does > that size represent? is

Re: [Tutor] object size in python is in what units?

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 1:13 AM, Marc Tompkins wrote: > As an experiment, I added a couple of extra methods and attributes to the > Kronk class, but it didn't change anything - IDs still incremented by 40 > each time. eryksun will no doubt chime in to tell us exactly how ob

Re: [Tutor] object size in python is in what units?

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 1:17 AM, Jim Mooney wrote: > On 23 July 2013 00:40, Steven D'Aprano wrote: > >> >> No no no, a thousand times no!!! IDs are just numeric IDs, that is all, >> like your social security number or driver's licence number. Don't think of >> them as having any meaning at all, e

Re: [Tutor] close, but no cigar

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 7:46 AM, Steven D'Aprano wrote: > This is not quite as silly as saying that an English E, a German E and a > French E should be considered three distinct characters, but (in my > opinion) not far off it. > I half-agree, half-disagree. It's true that the letter "E" is used

Re: [Tutor] unichr not working as expected

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 12:31 PM, Dave Angel wrote: > The three distributed version control systems I know of are: >git, mercurial, and bazaar > Not to overplay my Joel Spolsky fanboiism, but are you aware of Kiln from Fog Creek? It started out as an enterprise-friendly wrapper around Mercu

Re: [Tutor] Can anyone explain this

2013-08-07 Thread Marc Tompkins
On Fri, Aug 2, 2013 at 4:33 PM, Amandeep Behl wrote: > Can anyone explain this code below: > > > import sys > import os > > if __name__ == '__main__': > sys.path.insert(0, "..") > else: > sys.path.insert(0, os.path.join( > os.path.split(__file__)[0], '..')) > When you run this

Re: [Tutor] How to access a method defined in one class from another class (which is a thread) in Python3?

2013-08-08 Thread Marc Tompkins
On Thu, Aug 8, 2013 at 7:15 PM, Joel Goldstick wrote: > On Thu, Aug 8, 2013 at 9:52 PM, SM wrote: > > > > > OP is me? Not sure what it stands for, but I am a 'she' :) > > FYI (For you information) OP means Original Poster. Although people > do refer to names in replies here, the term OP is used

Re: [Tutor] dbus.Array to string

2013-08-13 Thread Marc Tompkins
On Tue, Aug 13, 2013 at 8:59 AM, Amit Saha wrote: > What does it mean (and will it always work?) when I don't specify any > encoding: > > >>> bytearray(ssid).decode() > u'BigPond679D85' > If you don't specify an encoding, then the default encoding is used; as you point out a bit later, your loc

Re: [Tutor] To find the least number divisible by all numbers from 1-20

2013-08-13 Thread Marc Tompkins
On Tue, Aug 13, 2013 at 9:45 AM, #PATHANGI JANARDHANAN JATINSHRAVAN# < jatinshr...@e.ntu.edu.sg> wrote: > Hello All, > > Sorry for the earlier mail without subject. I was in a hurry so I missed > that > > I am solving problem number 5 in project euler. I think my solution > seems logically corre

Re: [Tutor] class data member and objects of class in python

2013-09-11 Thread Marc Tompkins
On Wed, Sep 11, 2013 at 5:40 AM, zubair alam wrote: > i am learning how a __class__ data member behaves in python as compared to > static data member in java, but following code is throwing error > > > class PizzaShop(): > pizza_stock = 10 > def get_pizza(self): > while not PizzaSh

Re: [Tutor] Want to keep to two decimal places for currency

2013-10-24 Thread Marc Tompkins
On Thu, Oct 24, 2013 at 11:25 AM, bob gailer wrote: > On 10/24/2013 2:09 PM, Danny Yoo wrote: > >> Related: I saw a picture the other day on Google+ of an mailing envelope >> whose zip code was written in scientific notation. >> > That;s odd - since ZIP codes are character, not integer, > You'd

Re: [Tutor] Want to keep to two decimal places for currency

2013-10-24 Thread Marc Tompkins
On Thu, Oct 24, 2013 at 1:21 PM, Marc Tompkins wrote: > On Thu, Oct 24, 2013 at 11:25 AM, bob gailer wrote: > >> On 10/24/2013 2:09 PM, Danny Yoo wrote: >> >>> Related: I saw a picture the other day on Google+ of an mailing envelope >>> whose zip cod

Re: [Tutor] Finding a nearest perfect cube

2013-11-07 Thread Marc Tompkins
On Thu, Nov 7, 2013 at 2:25 PM, donsuni wrote: > Hi, I am new to python and i have to write a following code without using > any > inbuilt function or a for loop. Only while and if loops are allowed. > > If i input a number, i should get a perfect cube nearest to it. > For eg: if > input=4, outpu

Re: [Tutor] Issue w/ while loops

2013-11-23 Thread Marc Tompkins
On Sat, Nov 23, 2013 at 8:30 AM, Rafael Knuth wrote: > Marc, > > great feedback - thank you very much! > I will bear that in mind for the future. > > I modified my program as you suggested, but I received a runtime > error; I tried to fix that but unfortunately I didn'

Re: [Tutor] What is a namespace? What is meant by "A namespace is a mapping from names to objects"

2013-12-09 Thread Marc Tompkins
On Sun, Dec 8, 2013 at 8:46 PM, Varuna Seneviratna < varunasenevira...@gmail.com> wrote: > But what is meant by "A *namespace* is a mapping from names to objects" > Steven touched on this, but I'd like to emphasize: in Python, EVERYTHING is an object - variables, functions, integers, strings, you

Re: [Tutor] Stuck on error

2013-12-21 Thread Marc Tompkins
On Sat, Dec 21, 2013 at 12:36 PM, NZHacker1 . wrote: > I'm not finished with the program and I put Plays = int(x) * 100, > plays = int(x) * 100 > on purpose. > > I don't think you understood what people were trying to tell you. Python is case-sensitive; "plays" and "Plays" are NOT the same vari

Re: [Tutor] Which computer operating system is best for Python

2014-02-05 Thread Marc Tompkins
On Wed, Feb 5, 2014 at 3:18 PM, Joel Goldstick wrote: > I would get a laptop with as large a screen as you can afford. Windows or > Linux. > > I second that emotion, and also: try out the keyboard first (or rather, have your kid try it out). We spend a lot of time on our laptops, and a badly-desi

[Tutor] Beginner - explaining 'Flip a coin' bug

2014-02-12 Thread Marc Eymard
ting variable count_flips each time until the loop becomes false. Can somebody explain the reason of the bug. Cheers, Marc #Coin Flip #Flip a coin 100 times and count heads and tails input('Press ENTER to flip a coin a hundred times'

Re: [Tutor] thanks - Beginner - explaining 'Flip a coin' bug

2014-02-15 Thread Marc Eymard
programming is about regardless of the language. Please keep commenting/helping whenever necessary. Cheers, Marc Date: Fri, 14 Feb 2014 22:49:43 -0500 Subject: Re: [Tutor] Beginner - explaining 'Flip a coin' bug From: dwightdhu...@gmail.com To: marc_eym...@hotmail.com CC: tutor@python.or

[Tutor] Beginner - understanding randint arguments

2014-02-15 Thread Marc Eymard
was rather expecting: >>> low_range 0 >>> high_range 100 Can somebody explain why both low_range and high_range are still returning their initial values ? Thanks, Marc ___ Tutor maillist

[Tutor] Beginner - Clarifying 'understanding randint arguments'

2014-02-17 Thread Marc Eymard
s not exit in time to avoid error by working out the answer based on a logical narrowing of the guessing range. Hope this clarifies my previous email (see further down this note). Thanks, Marc > Subject: Your message to Tutor awaits moderator approval > From: tutor-ow...@python.org >

[Tutor] Beginner - list not returning correct variable value

2014-03-13 Thread Marc Eymard
e from the list attributes[] when the 'for' loop at the bottom of the script runs. I have commented out the script to highlight what causes me problem. I hope this is clear enough a question. Thanks for your help, Marc #Character role play #you h

[Tutor] FW: Beginner - list not returning correct variable value

2014-03-19 Thread Marc Eymard
Hello Tutor, Could somebody help me with below query? Thanks Marc From: marc_eym...@hotmail.com To: tutor@python.org Subject: Beginner - list not returning correct variable value Date: Thu, 13 Mar 2014 16:12:28 + Hello Tutor, I am a self-taught Python script beginner and I do it from

<    1   2   3   4   5   >