Re: [Tutor] noob python question

2015-10-26 Thread boB Stepp
fferences between Python 2 and 3 syntax in some areas. HTH, -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] noob python question

2015-10-26 Thread Bob Gailer
Welcome to the tutor list. In order for us to help you please post the following: Python version Operating system The code you are running To trace back you are getting The trace back will be several lines of references to various programs and line numbers Once we have that information then it bec

[Tutor] Are there any Python-based GUI builders for tkinter

2015-10-27 Thread boB Stepp
3.5. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interface

2015-12-16 Thread boB Stepp
quot;T") as it is copyrighted 2000. Despite this I think it is still quite useful even if you are working in Python 3 as, as far as I can tell, t/Tkinter has not changed substantially in how the coding goes. -- boB ___ Tutor maillist - Tutor@python.

[Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
clicking all things that need to be clicked, etc.? This is mostly a Windows-based scenario, but if the techniques (if they exist) can be abstracted to any OS I can find plenty of uses elsewhere as well! TIA! Merry Christmas!!! -- boB ___ Tutor maillist

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
On Thu, Dec 24, 2015 at 11:34 AM, Oscar Benjamin wrote: > > On 24 Dec 2015 14:55, "boB Stepp" wrote: [...] >> I find myself doing the same boring, repetitive tasks by hand, which >> amounts to copying certain information from one program and putting it >> i

Re: [Tutor] reading an input stream

2015-12-24 Thread boB Stepp
ums() >>> numStream.next() Traceback (most recent call last): File "", line 1, in numStream.next() AttributeError: 'generator' object has no attribute 'next' If I instead do this: >>> next(numStream) 0 >>> next(numStream) 1 >>

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
make sure you do that > first or you will almost certainly have to rewrite from scratch > (and after most every other upgrade of OS or app thereafter). > And don't even think of changing your system fonts - ever! > I am at the mercy of my IS department re possible upgrades and the

[Tutor] OT: How best to use Git for multi-directory projects?

2015-12-29 Thread boB Stepp
thing with a single .git file at the level of StudyBooks directory? Hoping to more effectively use Git in the new year! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: How best to use Git for multi-directory projects?

2016-01-01 Thread boB Stepp
On Tue, Dec 29, 2015 at 11:32 PM, Martin A. Brown wrote: > > Hello there boB, > > Hey, wait a second! What time zone are you in? You can't have 2016 > resolutions already. Not even the New Zealanders are there yet! Santa gave me a peek into you know who's time machine

[Tutor] What potential problems might I encounter installing Anaconda?

2016-01-01 Thread boB Stepp
regarding Anaconda? 4) I have only tonight started looking into this. My initial impression is that updates and new Python package installations are done in Anaconda with a "conda" command. Does this mean that pip installations can no longer be done? TIA! Happy New Year

[Tutor] antigravity?!?

2016-01-01 Thread boB Stepp
37.857713 -122.544543 FILE c:\python34\lib\antigravity.py Out of ever growing curiosity I went to the official Python docs site. Sure enough, no module named "antigravity" is listed. What else awaits as I explore Python??? I sure hope I don&#

Re: [Tutor] new line to list of strings send by email

2016-01-08 Thread Bob Gailer
On Jan 8, 2016 11:03 AM, "Emil Natan" wrote: > > Hello list, > > I have a function which receives a string and sends it as a body of an > email. > > It is a part of a program which does certain checks on network > infrastructure. When a check fails I append error message to a > error_collector lis

[Tutor] Is there a preference of "class MyClass:" or "class MyClass(object):" for Py3?

2016-01-15 Thread boB Stepp
Pythonic style/preference question: For strictly Python 3 code, is there any preference for class MyClass: pass versus the more explicit class MyClass(object): pass ? TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-15 Thread boB Stepp
not because: >>> things.insert(-1, 'What the heck?!?') >>> things [0, 'Hmm...', 3, 'WhackABunny', 6, 'What the heck?!?', '?'] "...at the index..." to me would mean that 'What the he

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-15 Thread boB Stepp
On Fri, Jan 15, 2016 at 10:53 PM, Cameron Simpson wrote: > On 15Jan2016 22:20, boB Stepp wrote: >> I always get an empty list, which is actually what I was expecting, so >> I do not see how s[i:i] can ever equal [x]. > > > It isn't an equality test (==), it is an

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-15 Thread boB Stepp
On Fri, Jan 15, 2016 at 11:32 PM, Cameron Simpson wrote: > On 15Jan2016 23:05, boB Stepp wrote: >> >> On Fri, Jan 15, 2016 at 10:53 PM, Cameron Simpson wrote: >>>>>>> >>>>>>> things.insert(-1, 'What the heck?!?') >>>

Re: [Tutor] Is there a preference of "class MyClass:" or "class MyClass(object):" for Py3?

2016-01-15 Thread boB Stepp
ul at work! I'll just copy this class to my thumb drive and ..." Perhaps for all too easily confused boB explicit might be better than implicit? Seems I read that somewhere recently ... Thanks, Steve! -- boB ___ Tutor maillist -

Re: [Tutor] What is the square brackets about?

2016-01-16 Thread boB Stepp
rning I find it very helpful to either use IDLE or invoke the Python interpreter in the shell and try these things out. Once I get it to work, then I play around with the syntax and deliberately try to break things and see what sorts of errors are generated, figure out the limits of what the syn

Re: [Tutor] What is the square brackets about?

2016-01-16 Thread boB Stepp
On Sat, Jan 16, 2016 at 1:14 PM, boB Stepp wrote: > > While learning I find it very helpful to either use IDLE or invoke the > Python interpreter in the shell and try these things out. Once I get > it to work, then I play around with the syntax and deliberately try to > break

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-16 Thread boB Stepp
r None]) > ... > [100] > [100, 200] > [100, 200, 300] > [100, 200, 300, 400] > [100, 200, 300, 400, 500] OK, Peter, all was going smoothly in boB-land until you added your "fix". Adding "or None" has me addled! I tried to clarify things in the interpreter (I rem

Re: [Tutor] What is the square brackets about?

2016-01-16 Thread boB Stepp
On Sat, Jan 16, 2016 at 2:33 PM, Alan Gauld wrote: > On 16/01/16 19:35, boB Stepp wrote: > >> And so on. Until you (and I) can understand why the function produces >> these outputs with the given values of loc and thing, then we cannot >> claim we understand what is going

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-16 Thread boB Stepp
Alex sent me this off-list. I hope he does not mind me sharing part of what he wrote on-list! On Sat, Jan 16, 2016 at 4:57 PM, Alex Kleider wrote: > On 2016-01-16 14:39, boB Stepp wrote: > > >>>>> mylist[:0 or None] >> >> [100, 200, 300, 400, 500] >> &

[Tutor] Should a "data" directory have a __init__.py file?

2016-01-17 Thread boB Stepp
for a data directory. Yes, files will be read there, but there will be no code there. Is this correct? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How (and whether I should) use pkgutil.get_data()?

2016-01-17 Thread boB Stepp
this returned object that I could do if I used "with open..."? Is it iterable? [OK, I confess up front. I am being lazy here. I *could* create a file and try this out to see what happens, so I will understand if I get chided (or worse!).] 3) Should I be using relative imports in my

[Tutor] Why is the name "self" optional instead of mandatory?

2016-01-20 Thread boB Stepp
y sleepy!!!") >>> mycat = Cat('Callie', 7) >>> mycat.happy_cat() Zzzz ... pu ... >>> mycat.whoami() My name is Callie and I am 7 years old. Now leave me be! I'm very sleepy!!! So I really only have one question: Why not make Python's *

[Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-20 Thread boB Stepp
was given This was my original point in doing all of this, to see what would result if I omitted "self". I am pretty sure the error is because the object instance gets automatically passed to the sigh() method, but by leaving the "self" parameter out in the method definition

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-22 Thread boB Stepp
t is happening *inside* the class definition. > It also means that Python doesn't require a magic "undefined" value, > like Javascript has, or require declarations ahead of time, like static > languages such as Pascal and C require. I have come to enjoy this feature of Python as well! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is the name "self" optional instead of mandatory?

2016-01-22 Thread boB Stepp
On Thu, Jan 21, 2016 at 5:49 AM, Steven D'Aprano wrote: > On Wed, Jan 20, 2016 at 09:42:29PM -0600, boB Stepp wrote: > >> So I really only have one question: Why not make Python's >> *traditional* name, "self", mandatory? Why give the programmer this

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-22 Thread boB Stepp
On Fri, Jan 22, 2016 at 11:04 PM, Cameron Simpson wrote: > On 22Jan2016 22:14, boB Stepp wrote: [...] > Consider: this is information you want assicated with a specific object. > Therefore it really _is_ an arribute of the object so that it can follow it > around. > >>

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-23 Thread boB Stepp
On Sat, Jan 23, 2016 at 3:30 AM, Cameron Simpson wrote: > On 23Jan2016 01:52, boB Stepp wrote: >> I guess no matter how new one is to OOP, one nevertheless brings one's >> preconceptions, however malformed, into the learning process. In my >> case, one of mine was

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-23 Thread boB Stepp
g is to avoid "from M import *", but it is good to know that this style of import will not capture names of the form "_name". -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-23 Thread boB Stepp
On Sat, Jan 23, 2016 at 12:55 PM, boB Stepp wrote: > I still would like to do this via a method, but I am currently stuck > on how to replace ??? with the attribute name I would like to insert: > > class Dog(object): > ... > > def add_attribute(self, attribute_

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-23 Thread boB Stepp
nail on the head here? Thanks, Alan! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Value of tracebacks to malicious attackers?

2016-01-23 Thread boB Stepp
course for many applications these concerns are probably inconsequential. I don't think I would be gravely concerned if someone cracked into my ticktacktoe game deployed to some freebie site. OTOH, if I was deploying an online payment system, I would be much more concerne

Re: [Tutor] Value of tracebacks to malicious attackers?

2016-01-23 Thread boB Stepp
reaking of your own program. Instead, think > about what happens if someone takes over the machine and starts using > it as part of a botnet. That is often a purpose of a system > compromise: the attacker may not personally care about tic-tac-toe, > but they do care about having r

Re: [Tutor] Can This Script Be Modified to Read Many Files?..

2016-01-25 Thread Bob Gailer
On Jan 25, 2016 6:26 PM, "Sam Starfas via Tutor" wrote: > > Hi,I am very new to Python, but having fun learning. > I need to have a script read all of the XML files contents that are in a directory, pull out the contents of an element, in my case , and list them in an output file. I have this scri

Re: [Tutor] Help

2016-01-26 Thread boB Stepp
In case you cannot see what we are talking about in how your message is not keeping its proper indentation, go to the Tutor Mail Archive at: https://www.mail-archive.com/tutor@python.org/msg73411.html and perhaps you can better see the difficulty we are having reading your message. boB

[Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-27 Thread boB Stepp
tentially promising, but looks complicated. This leads me to look at https://docs.python.org/3.4/library/unittest.mock.html, but right now I am finding this heavy going, and it will probably take me some time and further research before I feel I am really understand applying this mock proces

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
if the "with open ..." context manager is still usable to handle simulated file closing using this technique? > So for our own unit tests, now we should be able to say something like this: > > ## > def test_foobar(

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
gram code or test code. But amongst all the things Danny clarified, he really helped me see how to do this in the context of writing classes. But in choosing what approach to use, I had not considered the possible importance of using real files in some instances, which

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
st languages (although > not in python!) I'll ask you the same question that I asked Danny: Do you have a favorite text which teaches OOP the way you feel it should be taught? And if possible, Python-based? boB ___ Tutor maillist - Tutor@pytho

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
s like a file, but > can be constructed in memory, use StringIO (or cStringIO). Isn't option D what Danny was using to make option B? Or are you saying keep things even simpler? boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
opinion is that it misses the forest for the trees. What I think > OOP's heart is beating is in the ability to parameterize behavior.) In response to your aside, do you have a favorite text that teaches OOP the way you feel it should be taught? And is there a Python-based version? -- boB

Re: [Tutor] Noob: nested if-clauses

2016-01-29 Thread boB Stepp
dow. If you go to the "Keys" tab, you can see (and edit) the key bindings IDLE uses as well as available pre-configured key binding styles. Hopefully I'm answering the question(s) you are really asking and have not gone off on a tangent! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Code Regress

2016-02-01 Thread boB Stepp
7;) elif t == 60: your_label.config(bg='firebrick') . . . HTH! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
e_to_test, 103.0)) ? If my understanding is indeed correct, then I will leave it to you to figure out which logic operator ("and" or "or") makes sense here! ~(:>)) -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
On Sat, Feb 6, 2016 at 3:54 PM, boB Stepp wrote: > On Sat, Feb 6, 2016 at 10:07 AM, Anubhav Yadav wrote: Just read Danny's reply after sending mine, which means that the answer to my question: > If my understanding is indeed correct, then I will leave it to you to > figure o

[Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread boB Stepp
0 starts an octal number, but this was changed in Python 3. But then why is 00...0 valid, that is, does not give a syntax error? TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with an error

2016-03-05 Thread boB Stepp
thon and have no special need for Python 2, then you should work on learning Python 3. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread boB Stepp
owing through (So far!) on my New Year's resolution to persistently work through some Python books. I've knocked off "Python Crash Course", which I think is a fine beginner's book. Now I am starting "Think Python, 2nd ed.", which is an intro to C.Sc.-type book

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread boB Stepp
On Sat, Mar 5, 2016 at 11:32 PM, Steven D'Aprano wrote: > On Sat, Mar 05, 2016 at 05:20:21PM -0600, boB Stepp wrote: > >> Why do zeros not give a syntax error, but other numbers with a leading >> zero do give a syntax error? An online search reveals that in Python >

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread boB Stepp
On Sun, Mar 6, 2016 at 12:37 AM, Ben Finney wrote: > boB Stepp writes: > >> […] why was this feature implemented? > > You've been asking that a lot lately :-) This forum is unlikely to be > able to give authoritative answers to “why was the language designed the &

[Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
done some Googling on this as well, but haven't found the right search query yet. I also poked into some of the idlelib files, but so far the only ">>>" I've found have been in specialized displays like IDLE debug. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
On Fri, Mar 11, 2016 at 9:31 PM, boB Stepp wrote: > Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 > 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> import s

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
On Fri, Mar 11, 2016 at 11:02 PM, Cameron Simpson wrote: > On 11Mar2016 21:31, boB Stepp wrote: >> >> I must be bored tonight. I have to confess that when copying and >> pasting from the interpreter into a plain text email, I often find it >> cluttered to confusing b

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
'), which did not require any spaces and received an error stating that it would not accept values greater than hex ff. So it is pretty clear that following Cameron's suggestion is not (At least on the surface.) doable in the codeanywhere environment. Might I suggest pythonanywhere?

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-12 Thread boB Stepp
On Sat, Mar 12, 2016 at 2:14 AM, Cameron Simpson wrote: > On 12Mar2016 00:46, boB Stepp wrote: >> Additionally, one must set the font for cmd.exe and PowerShell to >> "Lucida Console" or the above will not work. > > > You may find some other fonts also work

[Tutor] OT: (Continuous) integration testing: Can a solo developer with very limited resources truly do this?

2016-03-12 Thread boB Stepp
do at home, even with using some complex combination of virtual environments to test all relevant OS's (Assuming I could even afford copies WinXP, WinVista, Win7, Win10, etc., with all their many permutations.), how can automated, continuous integration testing be accomplished *in prac

Re: [Tutor] OT: (Continuous) integration testing: Can a solo developer with very limited resources truly do this?

2016-03-12 Thread boB Stepp
On Sat, Mar 12, 2016 at 2:02 PM, Alan Gauld wrote: > On 12/03/16 18:10, boB Stepp wrote: > Virtual machines, eg VirtualBox. > You can install all of the required OS on a single physical machine > (assuming the same hardware of course). For example, on my > Linux Mint box I hav

Re: [Tutor] Pmw/Tkinter question

2016-03-12 Thread boB Stepp
, if labelpos is W, the label is placed in the center of the left-hand side; if it is WN, the label is placed at the top of the left-hand side; if it is WS, the label is placed at the bottom of the left-hand side. I presume the second letter possibilities are referring to vertical spacing. Hope th

Re: [Tutor] Pmw/Tkinter question

2016-03-12 Thread boB Stepp
tion_menu): menu.configure(menubutton_direction = direction) if __name__ == "__main__" : root = Pmw.initialise() root.title("Demo") widget = Demo(root) root.mainloop() I omitted the extra "broccoli" words, to clarify the alignment issues.

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
in your long "broccoli-..." option. I will send you a png image of what I am seeing on my PC privately. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
On Sun, Mar 13, 2016 at 6:06 PM, boB Stepp wrote: > On Sun, Mar 13, 2016 at 11:01 AM, Albert-Jan Roskam > wrote: >> > >> Thanks! However, if you replace 'broccoli' with a much longer option, you >> will see what I

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
menubutton_anchor = 'w', > command = self._printOrder, > ) > #self.vege_menu.pack(anchor = 'w', padx = 10, pady = 10) > self.vege_menu.grid(row=1, column=0, sticky = 'w', padx = 10, pady = > 10) [...]

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-15 Thread boB Stepp
It does not happen in the IDLE Python shell. This is bizarre. What's up? boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-15 Thread boB Stepp
On Tue, Mar 15, 2016 at 7:35 PM, boB Stepp wrote: > Is the following result in PowerShell related to what Eryk has been > discussing? > > Windows PowerShell > Copyright (C) 2009 Microsoft Corporation. All rights reserved. > > PS C:\Windows\system32> py > Python 3.5.1 (

[Tutor] How to test function using random.randint()?

2016-03-18 Thread boB Stepp
. Of course I don't know that I care about testing for this for what will be used in a game for fun. Am I on the right track with this? The actual function will be more complicated in that it will generate a result for multiple dice with potentially a variety of sid

Re: [Tutor] Advice on multi-dimensional data storage

2016-03-19 Thread Bob Gailer
On Mar 16, 2016 5:59 AM, "Matt Williams" wrote: > > Dear Tutors, > > I am looking for some advice. I have some data that has three dimensions to > it. I would like to store it such that one could manipulate (query/ update/ > etc.) by dimension - so it would be feasible to ask for all of the data >

Re: [Tutor] How to test function using random.randint()?

2016-03-19 Thread boB Stepp
). Otherwise you're > trying to call random.randint.randint. And then this statement would be correct as Ben wrote it. Ben, please chime in if I have got it wrong. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread boB Stepp
t; which is the default RNG instance in the module. Can I not use: if rng is None: rng = random.Random() ? When I tested it int the interpreter to see if I could use randint: py3: rng = random.Random() py3: rng.randint(1, 6) 4 Am I missing something basic here? boB _

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread boB Stepp
On Sun, Mar 20, 2016 at 8:44 PM, Ben Finney wrote: > boB Stepp writes: >> Can I not use: >> >> if rng is None: >> rng = random.Random() > > That will work. > > It unfortunately creates a new random.Random instance every time that > line is execute

Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Bob Gailer
On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters" wrote: > > I continually get this error: > > > Traceback (most recent call last): > File "/Users/lwaters/Desktop/pygameTest.py", line 1, in > import pygame, sys > File > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac

Re: [Tutor] "List" object is not callable

2016-04-30 Thread bob gailer
On 4/30/2016 3:27 PM, Alex Kleider wrote: On 2016-04-30 11:51, Jason N. via Tutor wrote: Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_o

[Tutor] int(1.99...99) = 1 and can = 2

2016-04-30 Thread boB Stepp
the case of 15 nines the final bit is "0", but with 16 nines it is "1". Would someone clarify this for me, please? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-04-30 Thread boB Stepp
short threads with a > question from someone, a couple of responses from list members, and no > further reply. > Finally, I would like to see digest simply not offered. They are a disaster. > They break subject lines, threading and bury responses in noise. + infinity! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Bob Gailer
On May 1, 2016 8:04 AM, "Olaoluwa Thomas" wrote: > > The novice Python programmer is back. Welcome back. We are here to help you when you are stuck. Telling us something is broken is not adequate. Tell us-what you are expecting the program to do and what results you're getting. > > I'm trying to i

Re: [Tutor] Python Homework

2016-05-01 Thread Bob Gailer
On May 1, 2016 4:33 AM, "Katie Tuite" wrote: > > I'm trying to do a python homework question and cannot figure out how to > start at all. > > This is the question > > [image: pasted1] As you can see attachments don't work. Include the code in your post. > __

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
On Sun, May 1, 2016 at 5:43 AM, Steven D'Aprano wrote: > On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: >> Life has kept me from Python studies since March, but now I resume. >> Playing around in the interpreter I tried: >> >> py3: 1.

Re: [Tutor] Dictionary Question

2016-05-02 Thread Bob Gailer
On May 2, 2016 5:27 PM, "Jason N. via Tutor" wrote: > > Hello, > Wanted to ask if its possible to have a dictionary that can be looked up by either values? > For example, > mydic = {"A: "Apple", "B": "Banana"}When user inputs "A" I want "Apple" to come. But if the user enter "Apple" I want "A" to

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-03 Thread bob gailer
On May 3, 2016 3:04 AM, "Katie Tuite" > wrote: > > So the question is: > > "a contour plot is a graphic representation of the relationships among three numeric variables in two dimensions. Two variables are for X and Y axes, and a third variable Z is for contour lev

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-04 Thread Bob Gailer
On May 3, 2016 2:38 PM, "Katie Tuite" wrote: > > So I know what a color gradient is, I don't know how to compute it though. As far as programs, they told us we should use matplotlib, NumPy, and SciPy to display graphs. Thanks. Always reply to the list as well as me. Computing gradient. Each colo

Re: [Tutor] Practice python

2016-05-08 Thread boB Stepp
s, but the last time I went looking there I was checking out Java. Anyway, one MIT link is: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/index.htm -- boB ___

Re: [Tutor] How to make object disappear?

2016-05-09 Thread Bob Gailer
On May 9, 2016 8:01 AM, "Lisa Hasler Waters" wrote: > > Dear Tutor, > > My students and I are creating a maze game in tkinter. We are trying to > make the ball disappear when it hits the wall (black lines). We are not > having much luck. The following code has run the best, but still, the ball > d

Re: [Tutor] How to make object disappear?

2016-05-09 Thread boB Stepp
sappearing, then my initial thoughts would be: 1) Your if/elif statements are not correctly detecting the collisions. 2) You are not actually "capturing" the collision event as the ball moves; that is, you may not be successfully detecting the ball's *current* coordinates. 3

Re: [Tutor] How to make object disappear?

2016-05-09 Thread boB Stepp
On Mon, May 9, 2016 at 11:34 AM, Alan Gauld via Tutor wrote: > On 09/05/16 16:55, boB Stepp wrote: Did not! Lisa Hasler Waters (and her students?) wrote the code!! [Snipped her code and Alan's comments.] boB ___ Tutor maillist - Tutor@py

Re: [Tutor] Learning Regular Expressions

2016-05-24 Thread boB Stepp
t;> print ''' \tTab character!!! ''' Tab character!!! >>> Note: I had to simulate with spaces what I see in IDLE as my Gmail refuses to accurately copy my IDLE result. I suspect that your multiple backslash instances are generating what you are

[Tutor] Correct use of model-view-controller design pattern

2016-05-28 Thread boB Stepp
I were to convert the view to a tkinter GUI, where would the root.mainloop() statement go? In the controller's main() method? What GUI-related stumbling blocks might I easily run into in going from CLI to GUI with this existing code? 3) If I were to add data files in place of (or in

Re: [Tutor] Study Tips

2016-05-30 Thread boB Stepp
books and tutorials online. Search for them. Search the Tutor archives. As you might imagine, your questions have been asked often before. Alan Gauld has an online tutorial that has a link to it in any of his posts to Tutor. He also has recently released a book himself for learning Pyth

Re: [Tutor] Learning Regular Expressions

2016-05-30 Thread boB Stepp
On Mon, May 30, 2016 at 12:13 PM, dirkjso...@gmail.com wrote: > Hi bob, > > I had used the wrong email address when I wrote to python tutor on this, and > evidently it > took a while for the monitors to let it go ahead and be entered in the list, > so I apologize > for

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
On Sun, May 29, 2016 at 9:10 AM, Alan Gauld via Tutor wrote: > On 29/05/16 05:33, boB Stepp wrote: >> My current understanding is that the model contains program logic and >> the data which the program logic manipulates. > > Correct, all the core entities which ma

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
On Mon, May 30, 2016 at 11:30 AM, Alan Gauld via Tutor wrote: > On 29/05/16 05:33, boB Stepp wrote: >> 1) If I were to add code to filter user inputs, which file is the >> logical place to place such code? My current impression is that it >> should go in the controlle

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
Googling suggests registered views is referring to a dynamically generated presentation, perhaps in the sense of a db view. I suspect I have an idea of what is being meant here, but instead of potentially guessing, would you care to elaborate? Thanks! boB _

Re: [Tutor] Practice Exercises for Beginner ?

2016-06-02 Thread boB Stepp
ong the way! Good luck on your journeys! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] rock paper scissor lizard spock help

2016-06-14 Thread Bob Gailer
On Jun 14, 2016 4:05 PM, "Katelyn O'Malley" wrote: > > Hi I am just getting into python and I am trying to create a rock paper > scissor lizard spock game for 3 people and I cannot figure out the scoring > of the players I attached the code below, any help/ideas is much > appreciated. Welcome to p

[Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-16 Thread boB Stepp
I have actually successfully connected to the FTP server. Is there a better way to check for connection success? 4) As this class stuff is mostly treading new ground for me, am I doing anything that I should not be doing or should do in a more preferred way? Keep in mind that I am just starting on this code today. As always, many thanks in advance! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-17 Thread boB Stepp
On Thu, Jun 16, 2016 at 11:40 AM, Alan Gauld via Tutor wrote: > On 16/06/16 16:38, boB Stepp wrote: > >> class FTPFiles(FTP, object): >> """FTP files to Windows server location(s).""" > > OK, First comment. You describe this as an actio

Re: [Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-17 Thread boB Stepp
possible with what I am forced to in Python 2.4 at work where I have no choices as to Python version.). On Fri, Jun 17, 2016 at 10:31 AM, Steven D'Aprano wrote: > Some futher thoughts: > > On Thu, Jun 16, 2016 at 10:38:13AM -0500, boB Stepp wrote: >> class FTPFiles(FTP, object):

[Tutor] Best way to do FTP login?

2016-06-17 Thread boB Stepp
ach. Is there some reason why this is to be preferred? TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Why are expressions not allowed as parameters in function definition statements?

2016-06-18 Thread boB Stepp
in Python's syntax it will allow one to insert almost any kind of object or expression. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

<    10   11   12   13   14   15   16   17   18   19   >