Re: [Tutor] Looking for some direction

2019-05-11 Thread Marc Tompkins
On Sat, May 11, 2019 at 12:05 PM Cranky Frankie wrote: > 2) For wxPython I'm finding a lot of the documentation is outdated. I'm a fan of wxPython myself, for a number of reasons - it suits the way I think, and the applications it generates look native to the platform they're running on, as opp

Re: [Tutor] "Python not recognized as a command"

2018-09-01 Thread Marc Tompkins
On Sat, Sep 1, 2018 at 10:40 AM, Dana O'Connor wrote: > Hi, > I've been trying to download and use Python 3.7 for the past few days and > every time I try to open it it tells me I don't have "pip" which should be > impossible because this version of Python is supposed to automatically come > with

Re: [Tutor] try, except syntax

2018-08-02 Thread Marc Tompkins
try... except is meant to catch errors: places where your program would otherwise crash. It does NOT work as a truth check. In your example: > try: > type(uvc) == float > except TypeError as e: > print(e, msg) > > "type(uvc)==float" resolves to a standalone True or False, not an exception

Re: [Tutor] SSL Error

2018-08-01 Thread Marc Tompkins
On Wed, Aug 1, 2018 at 1:13 AM, Alan Gauld via Tutor wrote: > On 01/08/18 05:07, Saket Mehrotra wrote: > > Hi > > > > I am also not using any Open SSL package. > > I have just added " import requests" in py file. And when I run the > module > > I get the SSL package error ,not sure why. > > Th

Re: [Tutor] SSL Error

2018-07-31 Thread Marc Tompkins
On Tue, Jul 31, 2018 at 10:03 AM, Alan Gauld via Tutor wrote: > On 31/07/18 03:52, Saket Mehrotra wrote: > > > error ssl.PROTOCOL_SSLv23: OpenSSL.SSL.SSLv23_METHOD, > > AttributeError: module 'ssl' has no attribute 'PROTOCOL_SSLv23' > > Are you sure you spelled the attribute correctly? > > Have

Re: [Tutor] SSL Error

2018-07-31 Thread Marc Tompkins
This is a general Python tutor group; I'm not sure anybody here can help you with the OpenSSL package (I've definitely never used it myself.) We're all willing to help, but this might not be the right place to ask this question. More to the point, though, when you ask questions on this list it's

Re: [Tutor] confused about Pypi

2017-10-29 Thread Marc Tompkins
On Sat, Oct 28, 2017 at 1:43 PM, Mark Anderson wrote: > Hello, I am currently doing an online course to learn Python. Generally > ive followed it well and am enjoying my first go at programming. However > the description of how to get modules from PyPi has left me confused. Ive > only recently do

Re: [Tutor] Am I missing something obvious about "FizzBuzz"?

2017-10-01 Thread Marc Tompkins
On Sun, Oct 1, 2017 at 12:48 PM, Alan Gauld via Tutor wrote: > But to address another issue raised by Mats: > > Probably the best programming test there is look at code > > that's already been developed, > > Very true and in an ideal world what you would do, but... > > It is what we did with the

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Marc Tompkins
On Wed, Jul 5, 2017 at 9:51 AM, Ashfaq wrote: > Hi Peter, > The way you find the issue is really cool! Very cool! :) > > I agree - that is very cool. But I have also made this sort of mistake a few times, and found it by using a very quick, low-tech method... "Unfold" the lines of the two dictio

[Tutor] Thread Object integration with GPIO

2017-04-30 Thread Marc Eymard
. Can a charitable soul advise whether my approach makes sense and whether I am using the right type of object for the task at hands? I am looking for guidance and willing try completely different approach/objects if necessary. Thanks in advance for sending me into the right direction. Marc

[Tutor] Thread Object integration with GPIO

2017-04-29 Thread Marc Eymard
advance for sending me into the right direction. Marc ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Count for loops

2017-04-11 Thread Marc Tompkins
On Tue, Apr 11, 2017 at 9:48 AM, Rafael Knuth wrote: > I tested this approach, and I noticed one weird thing: > > Pi_Number = str(3.14159265358979323846264338327950288419716939) > Pi_Number = "3" + Pi_Number[2:] > print(Pi_Number) > > == RESTART: C:\Users\Rafael\Documents\01 - BIZ\CODING\Python >

Re: [Tutor] Question to Phyton and XBee

2017-04-11 Thread Marc Tompkins
On Tue, Apr 11, 2017 at 9:12 AM, Daniel Berger wrote: >Hello, > >I have installed the modules to control xbee with Python >https://pypi.python.org/pypi/XBee). Afterwards I have set the path >variable on C:\Python27\python-xbee-master and also the subdirectories. > To >check, i

Re: [Tutor] How do we create a GUI to run a simple calculation program in Python?

2017-04-04 Thread Marc Tompkins
On Tue, Apr 4, 2017 at 9:55 AM, Lisa Hasler Waters wrote: > Hello Tutor, > > A middle school student of mine created a program to calculate simple and > compound interest. He built it in PyCharm EDU using a Mac running 10.11.6. > > He would like to create a GUI to run this program. Please, can yo

Re: [Tutor] Tutor Digest, Vol 157, Issue 39

2017-03-19 Thread Marc Sebek
Hi Rafael You are appending quit to the list, before checking to see if quit has been typed. You could move the "if Statement" up in the code and add an else statement, so Quit is not appended to the list first thing. while True: activity = input(prompt) if activity == "quit": pr

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

[Tutor] Help me out please

2016-07-19 Thread Marc Sànchez Quibus
Hi, First of all I'm gonan introduce myself. My name is Marc and I'm a student and also a python's programmer begginer. I've been studying/learning python and now I need some help to finish my project. I have two scripts, one of them in python (the main script) and the other

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

[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] 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

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] 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] 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] 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] 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] 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] 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] 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] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 1:18 PM, Mark Lawrence wrote: > On 02/02/2015 20:59, Marc Tompkins wrote: > >> On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld >> wrote: >> >> Don't expect a whole heap of support from the GUIs. A lot of the work >>> will >>&

Re: [Tutor] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld wrote: > Don't expect a whole heap of support from the GUIs. A lot of the work will > have to come from you. > I suspect the standard GUI framework Tkinter is not going to be your best > bet. You might find that PyQt or PyGTK will offer better multi ling

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-13 Thread Marc Tompkins
On Thu, Nov 13, 2014 at 12:40 PM, Ben Finney wrote: > Danny Yoo writes: > > > >> To quote: "Let your statement be: 'Yes, yes', or "no, no': anything > > >> beyond these is of evil." > > > > > > "Have you stopped abusing small children yet?" > > > > :( > > > > I don't understand what your respons

Re: [Tutor] Would somebody kindly...

2014-10-30 Thread Marc Tompkins
On Wed, Oct 29, 2014 at 10:39 PM, Clayton Kirkwood wrote: > When I run: > values = [ ('a', 1), ('b', 2), ('a', 5), ('c', 7)] > key = 'a' > pair=[] > You just created an empty list and called it "pair". > [pair for pair in values if key == pair[0]] > Two things to bear in mind here: - The stepper

Re: [Tutor] Auto-response for your message to the "Tutor" mailing list

2014-10-26 Thread Marc Tompkins
On Sun, Oct 26, 2014 at 1:15 PM, Danny Yoo wrote: > > >> why is it I get this messages repeatedly despite having been reading > and writing on the list for over a year now? > > This has happened to me once in a while too. I conjecture that it might > be a bug with Mailman, but I'd have to dive i

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Marc Tompkins
On Fri, Sep 5, 2014 at 2:32 PM, Crush wrote: > Ok nevermind, I did not figure it out. My code... > > count = 0 > while count < 3: > count += 1 > Subprocess.Popen('command') > if count == 3: > sys.exit() > > This does not work as I want it to; it consecutively executes the command > t

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-05 Thread Marc Tompkins
On Fri, Sep 5, 2014 at 4:09 AM, Whees Northbee wrote: > I'm really sorry if my post doesn't appropriate to the forum rule.. I > already asked in other forums 2 months ago, but no answer or had voted down > and closed.. It's not that you've broken a rule. It's just that you're asking on a forum w

Re: [Tutor] Tutor Digest, Vol 127, Issue 12

2014-09-04 Thread Marc Tompkins
On Thu, Sep 4, 2014 at 3:26 PM, Alan Gauld wrote: > On 04/09/14 21:37, Najam Qasim wrote: >> I downloaded notepad++. Can you please help me how to run python script in >> notepad++? > > I only played with notepad++ briefly but I seem to recall it had a menu with > commands to 'make' and 'run' a fi

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-25 Thread Marc Tompkins
On Mon, Aug 25, 2014 at 12:04 AM, Alex Kleider wrote: > I appreciate your further elucidation, like your 'sledge hammer' metaphor and > thank you for the fragility warning. I expect within such a limited scope, > the dangers are not great. As someone who has been burned by this sort of thinkin

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-20 Thread Marc Tompkins
On Wed, Aug 20, 2014 at 1:38 PM, Terry--gmail wrote: > Marc, my understanding is, is that: > > lens[col].append(len(item)) > > -should be building a mirror image of my list of lists called catalog2, > which currently has 9 columns by x number of rows, and that we are plu

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-20 Thread Marc Tompkins
On Aug 20, 2014 12:07 PM, "Terry--gmail" wrote: > > Alan Gauld > > Hi! > We are not quite out of the woods on this last example you gave me. It now seems to be complaining > that it doesn't want to append an integer to the list or that this isn't the place to use '.append' -- I am probably interp

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-19 Thread Marc Tompkins
On Tue, Aug 19, 2014 at 1:04 PM, Mark Lawrence wrote: > I'm not aware of any problem with Thunderbird or any (semi-)decent mail > client. The original poster uses NinjaIDE and Thunderbird, and his code was being persistently flattened when he copied/pasted. I believe I've just tracked it down to

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-19 Thread Marc Tompkins
On Mon, Aug 18, 2014 at 1:00 AM, Marc Tompkins wrote: > Also, looking at the Ninja-IDE website more closely I see that, > although they do mention compatibility with multiple languages, they > were designed by and for Python programmers - which makes the > tab/space issue less like

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-18 Thread Marc Tompkins
On Mon, Aug 18, 2014 at 12:13 AM, Cameron Simpson wrote: > On 17Aug2014 23:51, Terry--gmail wrote: >> >> I'm copy and pasting from Ninja-IDE, which I thought was created >> specifically to do python programming...so I never checked to see if it >> needs to have the tab set to enter 4 spaces, as i

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-18 Thread Marc Tompkins
On Sun, Aug 17, 2014 at 10:51 PM, Terry--gmail wrote: > I'm copy and pasting from Ninja-IDE, which I thought was created > specifically to do python programming... Specifically for programming, yes, and Python is among the supported languages - but according to their web page, they support many l

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-17 Thread Marc Tompkins
On Sun, Aug 17, 2014 at 9:49 PM, Marc Tompkins wrote: > On Sun, Aug 17, 2014 at 9:40 PM, Terry--gmail > wrote: >> I found another place in Thunderbirdy to set 'plain text'. >> >> This is a test. >> >> Does the below code look correct now? >> &

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-17 Thread Marc Tompkins
On Sun, Aug 17, 2014 at 9:40 PM, Terry--gmail wrote: > I found another place in Thunderbirdy to set 'plain text'. > > This is a test. > > Does the below code look correct now? > > --And did I reply correctly this time? (Reply-All and keep only > tutor@python.org address...) > > > for line_number,

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-17 Thread Marc Tompkins
On Sun, Aug 17, 2014 at 4:48 PM, Terry--gmail wrote: > WOW! There is a lot of help on this mailing list! I want to thank everyone > for their valuable input! Thanks! (I am working my way through the > replies.) > > Sorry about the HTML. I think I have it turned off now in Thunderbirdy for > this

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Marc Tompkins
On Fri, Aug 15, 2014 at 10:46 AM, Terry--gmail wrote: (By the way - your indentation got flattened - cue the inevitable chorus of "DON'T POST TO THIS LIST IN HTML" - so this is my best-guess reconstruction.) > lens = [] > # pre-format the list called lens for maximum number of columns contained i

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-05 Thread Marc Tompkins
On Tue, Aug 5, 2014 at 8:23 AM, Zachary Ware wrote: > > which it should be if the most recently > installed Python was 3.3 or 3.4, installed with default options. > And there we have my problem with this glorious new "feature". YOU CAN'T RELY ON IT, because it depends on the most recent version

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-05 Thread Marc Tompkins
On Tue, Aug 5, 2014 at 12:48 AM, Maxime Steisel wrote: > I think this is because on windows, *.py files are associated with py.exe > that choose the python version depending on the first line of your file. No. *ix operating systems (Unix, Linux, OS X, etc.) inspect the first line of a file to de

Re: [Tutor] Comparing two different text file

2014-07-29 Thread Marc Tompkins
On Tue, Jul 29, 2014 at 4:13 PM, 이명교 wrote: > inf1 = open('first.txt') > for line in inf1.readlines(): > list1.append(line) So far, so good... > list1 = line[:-1].split('\n') ...but then you do this, which wipes out list1. > for a in list1: > if a not in list1: Even if you hadn't

Re: [Tutor] Ending a loop with a condition not at the top

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 8:10 PM, Ben Finney wrote: > Marc Tompkins writes: > >> Seriously, though, how is >> 1) Do {this} forever, until something happens that I'll tell you about >> later >> >> better than >> 2) Do {this} until this condition, wh

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 6:12 PM, Mark Lawrence wrote: >> Ah. I missed that, as I've only noticed this newer thread. And I >> apologize for imputing motive (a liking for "while True"); I'd just >> noticed that you often advise it. I don't know who _does_ think this >> is a desirable pattern; I'

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 2:37 PM, Alan Gauld wrote: > In fact in this case I suggested he use a for loop to iterate over > the file and use a dictionary to store the results... Ah. I missed that, as I've only noticed this newer thread. And I apologize for imputing motive (a liking for "while Tr

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 8:40 AM, LN A-go-go wrote: > > States OJ > AK 36 > AL 39 > AR 39 > AZ 45 > CA 61 > CO 54 > CT 61 > DC 93 > DE 62 > FL 51 > GA 47 > HI 72 > IA 54 > ID 36 > IL 62 > IN 50 > KS 41 > KY 41 > LA 40 > MA 62 > MD 62 > ME 58 > MI 57 > MN 54 > MO 49 > MS 43 > MT 47 > NC 50 > ND 45

Re: [Tutor] Using module Facebook

2014-07-18 Thread Marc Tompkins
On Fri, Jul 18, 2014 at 9:29 AM, Chris wrote: > On 07/18/2014 09:44 AM, Alan Gauld wrote: > > Are you sure thats the version of Python you are running > > in the virtualenv? > > I've modified the first line to #!./bin/python (instead of > #!/usr/bin/python). > > Now, there's another error message

Re: [Tutor] Why is Quick Search at docs.Python.org so useless?

2014-07-06 Thread Marc Tompkins
On Sun, Jul 6, 2014 at 1:57 PM, Danny Yoo wrote: > 2. Direct feedback to the Python web site maintainers so that either they fix the problem or are at least aware that something is deficient. Google offers a per-site custom search; it's free for very basic functionality and not very expensive

Re: [Tutor] How to list/process files with identical character strings

2014-06-24 Thread Marc Tompkins
On Tue, Jun 24, 2014 at 1:02 PM, Peter Otten <__pete...@web.de> wrote: > Sorting is probably the approach that is easiest to understand, but an > alternative would be to put the files into a dict that maps the 8-char > prefix to a list of files with that prefix: > I was debating the virtues of th

Re: [Tutor] How to list/process files with identical character strings

2014-06-24 Thread Marc Tompkins
On Tue, Jun 24, 2014 at 8:34 AM, mark murphy wrote: > What I hope to be able to do is scan the directory, and for each instance > where there are two files where the first 8 characters (TDDD) are > identical, run a process on those two files and place the output (named > TDDD) in a new

Re: [Tutor] python sockets

2014-06-11 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 4:08 PM, Jon Engle wrote: > Ok, so when I run the code it immediately terminates and never 'listens' to > the ports in the loop. I have verified by running netstat -an | grep 65530 > and the startingPort is not binding. The problem is that all threads started by a program

Re: [Tutor] python sockets

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 2:00 PM, Jon Engle wrote: > Ok, so after making the changes the code does bind the startingPort > variable but that is the only port that gets bound. Also when connecting to > the startingPort I receive the following error: > > Please enter starting port: 65520 > >

Re: [Tutor] python sockets

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 9:28 AM, Jon Engle wrote: > for port in range (startingPort, 65535): > thread.start_new_thread(setup, (port,)) > startingPort=startingPort+1 > #print startingPort > I think you just need this: for port in range (startingPort, 65535): > thread.start_new_thread(s

Re: [Tutor] Simple python help

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 7:55 AM, Stephen Brazil wrote: > Hello! I am brand new to python and need to know how to make the attached > lines of code work. Should be pretty > You need quotes. Stephen (without quotes) is an object, which you haven't previously defined. 'Stephen' is a string, whic

Re: [Tutor] Swampy: No module name World

2014-06-03 Thread Marc Tompkins
On Tue, Jun 3, 2014 at 11:00 AM, Mark Lawrence wrote: pip-win (https://sites.google.com/site/pydatalog/python/pip-for-windows) > > > Never heard of it so thanks for the link. > > I don't know how long it's been around but I'll tell you this much for free: I wish I'd known about it when I first s

Re: [Tutor] Swampy: No module name World

2014-06-03 Thread Marc Tompkins
On Tue, Jun 3, 2014 at 7:53 AM, Charles Agriesti wrote: > Thanks all. Problem apparently solved. Shortly after that last message it > quit working completely. Reinstall Python 2.7 + swampy -> no good; > uninstall both 2.7 and 3.4, manually remove the folders that remained > because of scripts tha

Re: [Tutor] self keyword in recursive function

2014-05-30 Thread Marc Tompkins
On Fri, May 30, 2014 at 11:06 PM, Ritwik Raghav wrote: > That's all the code I'm writing. > That can't be true - the 11 lines of code you posted doesn't include anything that would give you "Correct Return Value: No", let alone any reference to PersistentNumber. From the error message, it would

Re: [Tutor] self keyword in recursive function

2014-05-30 Thread Marc Tompkins
On Fri, May 30, 2014 at 10:16 PM, Ritwik Raghav wrote: > It has again given some error I do not understand. This time my code is: > > count = 0 > def getPersistence(self,n): > > product = 1 > if len(str(n)) == 1: > return self.count > else: > a = str(n) > for

Re: [Tutor] Library for .ppt to .txt conversion

2014-05-30 Thread Marc Tompkins
On Fri, May 30, 2014 at 2:41 AM, Aaron Misquith wrote: > Like pypdf is used to convert pdf to text; is there any library that is > used in converting .ppt files to .txt? Even some sample programs will be > helpful. > I suspect you'd need to use PowerPoint itself to do that cleanly; you can defin

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Marc Tompkins
On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey wrote: > I am studying python on my own (i.e. i am between the beginner and > intermediate level) and i haven't met any difficulty until i reached the > topic 'Generators and Iterators'. > I need an explanation so simple as using the expression 'pri

Re: [Tutor] what is the cores?

2014-05-25 Thread Marc Tompkins
On Sun, May 25, 2014 at 10:32 AM, Marino David wrote: > Hi all: > I am a newpie at python. > I read a python toolbox in which there is code line:import cores as co. I > wantta know what the cores is. > When I type "import cores as co", error occur as follows: > Traceback (most recent call last): >

Re: [Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Marc Tompkins
On Wed, May 14, 2014 at 12:08 PM, Charles Agriesti wrote: > Is this Anaconda thing any part of being able to run the scripts from the > textbook with time_series? Is it a complete wild goose chase? > First off - I know nothing about using Python in a scientific setting. Second (before anyone el

Re: [Tutor] PyCountry currency formatting woes

2014-05-04 Thread Marc Tompkins
On Sun, May 4, 2014 at 1:55 PM, Sithembewena Lloyd Dube wrote: > Thanks, i was actually getting the error information to update the post. > Apoligies to waste your time posting here - I could not find an appropriate > PyCountry discussion list and my next best bet seemed to be a Python users' > li

[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

[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] 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 - 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

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

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

[Tutor] Parsing multiple lines from text file using regex

2013-10-27 Thread Marc
e it is already done. Any help in pointing me in the right direction would be most appreciated. Thank you, Marc ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

  1   2   3   4   5   >