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

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 >

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

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

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

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

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"

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:

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

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

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 <s.mol...@sbcglobal.net> wrote: > On 02/27/2017 02:29 PM, Marc Tompkins wrote: > >> On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar >> <s.mol...@sbcglobal.net <mailto:s.mol...@sbcglobal.net>> wrote: >&g

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 >

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

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

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

2015-09-07 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

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 alan.ga...@btinternet.com 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 = []

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 em...@fenx.com 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. Fortunately Mozilla hasn't

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 alan.ga...@btinternet.com 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

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread Marc Tompkins
On Aug 10, 2015 12:17 PM, David Rock da...@graniteweb.com 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

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 robertvst...@gmail.com 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

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 mar...@linux-ip.net 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

Re: [Tutor] bin to dec conversion puzzlement

2015-04-20 Thread Marc Tompkins
On Apr 20, 2015 6:56 AM, Jim Mooney cybervigila...@gmail.com 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

Re: [Tutor] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld alan.ga...@btinternet.com 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

Re: [Tutor] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 1:18 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 02/02/2015 20:59, Marc Tompkins wrote: On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld alan.ga...@btinternet.com wrote: Don't expect a whole heap of support from the GUIs. A lot of the work will have to come from

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 ben+pyt...@benfinney.id.au wrote: Danny Yoo d...@hashcollision.org 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

Re: [Tutor] Would somebody kindly...

2014-10-30 Thread Marc Tompkins
On Wed, Oct 29, 2014 at 10:39 PM, Clayton Kirkwood c...@godblessthe.us 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: -

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 danny@gmail.com 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

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 ch.de2.2...@gmail.com 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

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Marc Tompkins
On Fri, Sep 5, 2014 at 2:32 PM, Crush crushe...@gmail.com 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

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 alan.ga...@btinternet.com 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

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 aklei...@sonic.net 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

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 terry.kemme...@gmail.com 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

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 terry.kemme...@gmail.com 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

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 marc.tompk...@gmail.com 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

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 breamore...@yahoo.co.uk 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

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 terry.kemme...@gmail.com 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

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 c...@zip.com.au wrote: On 17Aug2014 23:51, Terry--gmail terry.kemme...@gmail.com 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

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 terry.kemme...@gmail.com 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

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 terry.kemme...@gmail.com 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...)

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 marc.tompk...@gmail.com wrote: On Sun, Aug 17, 2014 at 9:40 PM, Terry--gmail terry.kemme...@gmail.com 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

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 terry.kemme...@gmail.com 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

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 maximestei...@gmail.com 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

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 zachary.ware+py...@gmail.com 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

Re: [Tutor] Comparing two different text file

2014-07-29 Thread Marc Tompkins
On Tue, Jul 29, 2014 at 4:13 PM, 이명교 t...@naver.com 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

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 8:40 AM, LN A-go-go lnart...@yahoo.com.dmarc.invalid 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

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 2:37 PM, Alan Gauld alan.ga...@btinternet.com 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

Re: [Tutor] (no subject)

2014-07-20 Thread Marc Tompkins
On Sun, Jul 20, 2014 at 6:12 PM, Mark Lawrence breamore...@yahoo.co.uk 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

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 ben+pyt...@benfinney.id.au wrote: Marc Tompkins marc.tompk...@gmail.com 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, which I'm

Re: [Tutor] Using module Facebook

2014-07-18 Thread Marc Tompkins
On Fri, Jul 18, 2014 at 9:29 AM, Chris ch2...@arcor.de 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

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 d...@hashcollision.org 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

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 msmur...@alumni.unc.edu 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

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 the two

Re: [Tutor] python sockets

2014-06-11 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 4:08 PM, Jon Engle jon.en...@gmail.com 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

Re: [Tutor] Simple python help

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 7:55 AM, Stephen Brazil steph...@nmsu.edu 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

Re: [Tutor] python sockets

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 9:28 AM, Jon Engle jon.en...@gmail.com 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):

Re: [Tutor] python sockets

2014-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2014 at 2:00 PM, Jon Engle jon.en...@gmail.com 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

Re: [Tutor] Swampy: No module name World

2014-06-03 Thread Marc Tompkins
On Tue, Jun 3, 2014 at 7:53 AM, Charles Agriesti dragrie...@comcast.net 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

Re: [Tutor] Swampy: No module name World

2014-06-03 Thread Marc Tompkins
On Tue, Jun 3, 2014 at 11:00 AM, Mark Lawrence breamore...@yahoo.co.uk 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

Re: [Tutor] self keyword in recursive function

2014-05-31 Thread Marc Tompkins
On Fri, May 30, 2014 at 11:06 PM, Ritwik Raghav ritwikragha...@gmail.com 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

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 aaronmisqu...@gmail.com 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

Re: [Tutor] self keyword in recursive function

2014-05-30 Thread Marc Tompkins
On Fri, May 30, 2014 at 10:16 PM, Ritwik Raghav ritwikragha...@gmail.com 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)

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 yarteydegre...@gmail.com 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

Re: [Tutor] what is the cores?

2014-05-25 Thread Marc Tompkins
On Sun, May 25, 2014 at 10:32 AM, Marino David davidmarino...@gmail.com 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

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 dragrie...@comcast.netwrote: 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.

Re: [Tutor] PyCountry currency formatting woes

2014-05-04 Thread Marc Tompkins
On Sun, May 4, 2014 at 1:55 PM, Sithembewena Lloyd Dube zebr...@gmail.comwrote: 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

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 joel.goldst...@gmail.comwrote: 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

Re: [Tutor] Stuck on error

2013-12-21 Thread Marc Tompkins
On Sat, Dec 21, 2013 at 12:36 PM, NZHacker1 . nikolau...@gmail.com 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

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 name

Re: [Tutor] Issue w/ while loops

2013-11-23 Thread Marc Tompkins
On Sat, Nov 23, 2013 at 8:30 AM, Rafael Knuth rafael.kn...@gmail.comwrote: 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't succeed.

Re: [Tutor] Finding a nearest perfect cube

2013-11-07 Thread Marc Tompkins
On Thu, Nov 7, 2013 at 2:25 PM, donsuni dons...@gmail.com 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

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

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 marc.tompk...@gmail.comwrote: On Thu, Oct 24, 2013 at 11:25 AM, bob gailer bgai...@gmail.com 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

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 zubair.alam@gmail.comwrote: 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):

Re: [Tutor] dbus.Array to string

2013-08-13 Thread Marc Tompkins
On Tue, Aug 13, 2013 at 8:59 AM, Amit Saha amitsaha...@gmail.com 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

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 correct but

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 joel.goldst...@gmail.comwrote: On Thu, Aug 8, 2013 at 9:52 PM, SM sunith...@gmail.com 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

Re: [Tutor] Can anyone explain this

2013-08-07 Thread Marc Tompkins
On Fri, Aug 2, 2013 at 4:33 PM, Amandeep Behl amandeep...@gmail.com 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

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 cybervigila...@gmail.comwrote: 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

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 marc.tompk...@gmail.comwrote: 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

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 cybervigila...@gmail.comwrote: On 23 July 2013 00:40, Steven D'Aprano st...@pearwood.info 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

Re: [Tutor] close, but no cigar

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 7:46 AM, Steven D'Aprano st...@pearwood.infowrote: 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

Re: [Tutor] unichr not working as expected

2013-07-23 Thread Marc Tompkins
On Tue, Jul 23, 2013 at 12:31 PM, Dave Angel da...@davea.name 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

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 10:47 AM, Jim Mooney cybervigila...@gmail.comwrote: I forgot about TREE. But figured piping C:\Python27tree /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

Re: [Tutor] slashes in paths

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

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:57 AM, Jim Mooney cybervigila...@gmail.comwrote: 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

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:27 AM, Jim Mooney cybervigila...@gmail.comwrote: 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 = '' for x in ÀÄÄÄ:

Re: [Tutor] close, but no cigar

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

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:00 PM, Jim Mooney cybervigila...@gmail.comwrote: 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

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:34 PM, eryksun eryk...@gmail.com 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

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 3:22 PM, Jim Mooney cybervigila...@gmail.comwrote: On 22 July 2013 14:11, Marc Tompkins marc.tompk...@gmail.com wrote: One way to deal with this is to specify an encoding: newchar = char.decode('cp437').encode('utf-8') Works fine, but I decided to add a dos

Re: [Tutor] close, but no cigar

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 6:13 PM, Dave Angel da...@davea.name 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] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sat, Jul 20, 2013 at 4:37 PM, Jim Mooney cybervigila...@gmail.comwrote: 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.

Re: [Tutor] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sun, Jul 21, 2013 at 7:41 PM, Jim Mooney cybervigila...@gmail.comwrote: On 21 July 2013 18:18, Marc Tompkins marc.tompk...@gmail.com 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

Re: [Tutor] A slight bug in IDLE

2013-07-15 Thread Marc Tompkins
On Sun, Jul 14, 2013 at 7:38 PM, Jim Mooney cybervigila...@gmail.comwrote: 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/

Re: [Tutor] A slight bug in IDLE

2013-07-14 Thread Marc Tompkins
On Sun, Jul 14, 2013 at 4:18 PM, Jim Mooney cybervigila...@gmail.comwrote: 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

Re: [Tutor] converting string to text

2013-07-10 Thread Marc Tompkins
On Wed, Jul 10, 2013 at 3:45 AM, Dave Angel da...@davea.name 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

Re: [Tutor] Reading numbers from a text file

2013-07-10 Thread Marc Tompkins
On Wed, Jul 10, 2013 at 1:41 AM, Phil phil_...@bigpond.com 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.

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 alan.ga...@btinternet.comwrote: 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

  1   2   3   4   5   >