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

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 3:14 PM, Joel Goldstick wrote: > On Sat, Jun 18, 2016 at 3:04 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&quo

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

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 9:10 PM, Steven D'Aprano wrote: > On Sat, Jun 18, 2016 at 02:04:46PM -0500, boB Stepp wrote: > Can you explain what you expected > > def d(row, col/2) > > to mean? I have literally no idea. You know Steve, as I was typing the beginning of a reply

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

2016-06-18 Thread boB Stepp
ompass and fill in marks for a distance from the circle's center, I get a very unsatisfactory result! I still have more conceptual work to do on your code. I still do not fully get decorators. In your code I get the impression that you are trying to be more formal in how y

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

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 11:18 PM, boB Stepp wrote: > On Sun, May 29, 2016 at 9:28 AM, Peter Otten <__pete...@web.de> wrote: > >> Here's a commandline example with two views (the circle-drawing routine has >> to be fixed)... > > I have to admit that now that I

Re: [Tutor] ASCII-Art circles, was Re: Why are expressions not allowed as parameters in function definition statements?

2016-06-20 Thread boB Stepp
And your code did give me (two) good examples demonstrating an implementation of MVC, which was the main point of the thread. I am content (For a moment at least!). Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] My code isn't working properly

2016-06-20 Thread boB Stepp
look like a lack of indentation for his statements that are part of the while loop are his problem. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-27 Thread boB Stepp
x? What about the differences in line endings? Am I going to have to be constantly converting back and forth? I guess that is most of it. It will be interesting to hear your thoughts! Thanks in advance! -- boB ___ Tutor maillist - Tutor@py

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread boB Stepp
On Mon, Jun 27, 2016 at 9:52 PM, boB Stepp wrote: [...] > 10) ... I forgot one concern last night: 11) My current graphics adapter is made by NVIDIA. Their drivers are proprietary. Is this going to be a deal breaker for Linux? 12) And what about wireless networking? My ASUS motherbo

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread boB Stepp
On Mon, Jun 27, 2016 at 10:48 PM, Steven D'Aprano wrote: > On Mon, Jun 27, 2016 at 09:52:50PM -0500, boB Stepp wrote: >> My eyes are glazing over from hours and hours of Googling on this. I >> cannot come to a rational conclusion. Perhaps someone can help me to >> do

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Tue, Jun 28, 2016 at 6:34 PM, David Rock wrote: > >> On Jun 28, 2016, at 18:16, boB Stepp wrote: >> >> On Mon, Jun 27, 2016 at 10:48 PM, Steven D'Aprano >> wrote: >>> >>> >>> What about running Win7 in a virtual machine? >

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 12:02 PM, David Rock wrote: > >> On Jun 29, 2016, at 11:20, boB Stepp wrote: >> >> My Christmas present of a Corsair mechanical gaming keyboard was not >> _seen_ during the boot up sequence until *after* Windows started up. >> So I could

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 1:12 PM, David Rock wrote: > >> On Jun 29, 2016, at 12:32, boB Stepp wrote: >> >> On Wed, Jun 29, 2016 at 12:02 PM, David Rock wrote: >>> >>>> On Jun 29, 2016, at 11:20, boB Stepp wrote: >>>> >>>> My

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 7:56 PM, boB Stepp wrote: > Now I can get into BIOS. BIOS sees my USB flash drive as "UEFI: Lexar > USB Flash Drive 1100", but it silently refuses to boot to the iso > image installed on it. Something new to puzzle out! OK, I'm into a live Mint

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
s I read, but not all, so I actually was going to look into this more deeply. Thanks for saving me some research! Alan Gauld said: > If you really want to see what's on offer open the > > Menu->Administration->Software Manager tool > > And browse away... :-) Wow! "

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Thu, Jun 30, 2016 at 12:09 AM, Alan Gauld via Tutor wrote: > On 29/06/16 23:58, boB Stepp wrote: > >> One point I just discovered for those new to this and Linux: tkinter >> does *not* come pre-installed with the Python distributions; it will >> have to be installed

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-07-02 Thread boB Stepp
Ward. So that will probably distract me from Python studies for a while. Again, thanks for all of the help you've collectively given! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-07-03 Thread boB Stepp
On 07/03/2016 02:32 PM, Ries Rommens wrote: Hello boB, On the latter I was surprised that Thunderbird did not support conversation views out of the box. After opening Thunderbird you will see a listing of your emails. Clicking on the header of the very first column of the listing will give

Re: [Tutor] iterators

2016-07-04 Thread boB Stepp
e('') else: event.Skip()This is the error message. Traceback (most recent call last): File "/home/colby/Calculator/Calculator_betaV3.py", line 110, in OnKeyPress elif keycode in (27): TypeError: argument of type 'int' is not iterable I believe that for (27) to be a tupl

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-05 Thread boB Stepp
provide the necessary context *in* your email body, so that everyone can follow along. Cheers! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help me out please

2016-07-19 Thread Bob Gailer
On Jul 19, 2016 9:24 AM, "Marc Sànchez Quibus" wrote: > > 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 the

Re: [Tutor] Python Assignment

2016-08-02 Thread Bob Gailer
On Aug 2, 2016 4:42 AM, "Justin Korn via Tutor" wrote: > > To whom it may concern, > > I need help on this assignment: > > > Create a new class, SMS_store. The class will instantiate SMS_store objects, similar to an inbox or outbox on a cellphone: > my_inbox = SMS_store() > This store can hold mul

Re: [Tutor] need help

2016-08-11 Thread boB Stepp
en you need to research this. Also, you say you're using Python 2.7. Python 2.x uses print *statements* => no parentheses, while Python 3.x uses print *functions*. Something else to read up on. Hope this gives you enough hints to work through

[Tutor] Fwd: Re: need help

2016-08-12 Thread boB Stepp
Pallab, please reply to the Tutor list. -- Forwarded message -- From: "Pallab Amway" Date: Aug 12, 2016 1:05 AM Subject: Re: [Tutor] need help To: "boB Stepp" Cc: > Respected sir,lots of thanks for your advice,but while i am compiling > those programe

Re: [Tutor] pip says no downloads for PyMedia

2016-09-12 Thread boB Stepp
; news entry is February 1, 2006. So this looks to be from the Python 2 only days. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pip says no downloads for PyMedia

2016-09-13 Thread boB Stepp
On Tue, Sep 13, 2016 at 2:17 PM, Jim Byrnes wrote: > On 09/12/2016 07:59 PM, Jim Byrnes wrote: >> >> On 09/12/2016 06:06 PM, boB Stepp wrote: >>> >>> On Sep 10, 2016 7:20 PM, "Jim Byrnes" wrote: >>>> >>>> >>>> >

Re: [Tutor] Help with Max Number and Min number script

2016-09-16 Thread Bob Gailer
On Sep 16, 2016 8:12 PM, "Sharon Wallace" wrote: > In addition to showing us your code , Please show us whatever Trace back you got when you ran the code. I would guess you are either getting an indentation error or syntax error in the vicinity of line that begins if num =. > inp = raw_input > >

Re: [Tutor] Help with Max Number and Min number script

2016-09-17 Thread Bob Gailer
On Sep 17, 2016 4:55 PM, "Sharon Wallace" wrote: > > Would you please help me with the last piece of this assignment? > > > > This is my code: > > > > largest = None > > smallest = None > > > > while True: > > num = raw_input("Enter a number: ") > > if num == "done

[Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-23 Thread boB Stepp
loop to work inside the class, but I guess my current poor knowledge of OOP did me in. But I KNOW there has to be a way to accomplish this WITHOUT using subTest. After all, subTest was not introduced until Python 3.4. So how should I go about this without using subTest? Question #3: In "with self.subTest(test_string = test_string):" why is "test_string = test_string" necessary? Is it that using "with" sets up a new local namespace within this context manager? I think with these long Python layoffs I am losing knowledge faster than I am gaining it! Cheers! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-23 Thread boB Stepp
I wanted to add a clarification as to what I was hoping to achieve. On Sat, Sep 24, 2016 at 12:55 AM, boB Stepp wrote: > > Of course, this code passed its test when the string was "Monty > Python", so I next wanted to run the same test with different strings > each time,

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread boB Stepp
On Sat, Sep 24, 2016 at 2:04 AM, Ben Finney wrote: > Bob, you may want to also subscribe to the specific forum for testing in > Python http://lists.idyll.org/listinfo/testing-in-python>. You're > beyond the beginner material that's usually discussed on this Tutor forum. Ho

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread boB Stepp
On Sat, Sep 24, 2016 at 11:05 PM, Steven D'Aprano wrote: > On Sat, Sep 24, 2016 at 12:55:28AM -0500, boB Stepp wrote: >> def right_justify(a_string): >> '''This fucntion will take the string, "a_string", and left justify it by >

[Tutor] Testing print

2016-09-29 Thread boB Stepp
d.. Anyway, it would seem that the only way to capture the output of a print is to redirect the stdout to something I can capture and compare against. Googling brings up some people doing something with mock objects, some redirecting to a string buffer, som

[Tutor] Passing functions as arguments to other functions

2016-09-29 Thread boB Stepp
this. But noob boB initially want to do instead: def f(g(*args)): g(*args) def g(*args): # Do somenthing. do_things = f(g(*args)) which, of course, will give me a syntax error. Also, I note that if I just type a function name without the parentheses in the interpreter, I will get

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 5:07 AM, Steven D'Aprano wrote: > On Thu, Sep 29, 2016 at 09:24:51PM -0500, boB Stepp wrote: >> Second, it seems that prints are often intermingled with the main >> logic of a function and only serve to pass on a message to the user. > > Yeah,

Re: [Tutor] Passing functions as arguments to other functions

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 3:43 AM, Alan Gauld via Tutor wrote: > On 30/09/16 03:43, boB Stepp wrote: > >> Also, I note that if I just type a function name without the >> parentheses in the interpreter, I will get something like this: >> >>>>> def f(): >>

Re: [Tutor] Passing functions as arguments to other functions

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 6:55 AM, Steven D'Aprano wrote: > On Thu, Sep 29, 2016 at 09:43:57PM -0500, boB Stepp wrote: >> But why does Python require >> separating the function object from its parameters when it is being >> passed as an argument to another function? &g

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
e rabbit!!! She is a vicious beast who will rip" " your throat out!", ""] main(input_strings) = Does this meet the criteria of each function doing its specific thing? Or is there something else I need to decouple/improve? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
On Sat, Oct 1, 2016 at 12:12 AM, Richard Doksa wrote: > unsubscibe please If you wish to unsubscribe, go to the bottom of this page and follow its instructions: https://mail.python.org/mailman/listinfo/tutor boB ___ Tutor maillist - Tu

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
On Sat, Oct 1, 2016 at 2:02 AM, Alan Gauld via Tutor wrote: > On 01/10/16 05:24, boB Stepp wrote: > >> === >> '''Exerise 3.1 from "Think Python 2" by Allen Downey. >> >&

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
thread ([Tutor] Passing functions as arguments to other functions) I started in parallel with this one. A practical example of passing a function to another function... -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unsubscribe

2016-10-01 Thread boB Stepp
Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
same way I have been doing them. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
On Sat, Oct 1, 2016 at 7:19 PM, Alan Gauld via Tutor wrote: > On 01/10/16 23:08, boB Stepp wrote: >> On Sat, Oct 1, 2016 at 11:35 AM, Alan Gauld via Tutor >> wrote: >> >>> ... Personally I don't like functions that >>> sometimes return one and someti

[Tutor] How to test a function which runs a passed in function twice?

2016-10-02 Thread boB Stepp
edge cases for this function. Something exploring the limits of Python's functionality? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to test a function which runs a passed in function twice?

2016-10-02 Thread boB Stepp
On Sun, Oct 2, 2016 at 6:00 PM, Steven D'Aprano wrote: > On Sun, Oct 02, 2016 at 05:47:51PM -0500, boB Stepp wrote: >> In exercise 3.2 of Downey's "Think Python 2" he has a function: >> >> def do_twice(f): >> f() >> f() >> >>

Re: [Tutor] Python Word Problems(Student)

2016-10-06 Thread bob gailer
On 10/6/2016 10:15 AM, Zeel Solanki wrote: def filter_long_words(words, n): for x in words.split(): return filter(lambda x: len(x) > n, words) print filter_long_words(raw_input("Enter a list of words with spaces in between."), raw_input("Enter a number.")) raw_input() always returns a st

Re: [Tutor] Python Word Problems(Student) MORE ISSUES

2016-10-06 Thread bob gailer
On 10/6/2016 10:15 AM, Zeel Solanki wrote: def filter_long_words(words, n): for x in words.split(): return filter(lambda x: len(x) > n, words) print filter_long_words(raw_input("Enter a list of words with spaces in between."), raw_input("Enter a number.")) raw_input() always returns a st

[Tutor] TDD: How to test input()?

2016-10-07 Thread boB Stepp
rocess to created a generalized grid printing program. So please excuse the file names "test_draw2x2grid.py" and "draw2x2grid.py". Let me know if there is a better way to test input() (The heart of get_input()), or if I have outright misconceptions, etc. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] TDD: How to test input()?

2016-10-07 Thread boB Stepp
Oops! On Fri, Oct 7, 2016 at 8:26 PM, boB Stepp wrote: > I think I have this figured out, but I want to be certain I am doing > it both correctly and in the preferred way. I have a need for a > get_input() function and have written my first test for this function > as follow

[Tutor] Do not understand why I am getting "EOFError: EOF when reading a line".

2016-10-07 Thread boB Stepp
-- Traceback (most recent call last): File "c:\thinkpython2\ch3\ex_3-3\test_draw2x2grid.py", line 126, in test_get_input_value_error draw2x2grid.get_input() AssertionError: ValueError not raised -- Ran 5 tests in 0.003s FAILED (failures=1) == I am currently quite stumped. What is it I am not seeing? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Do not understand why I am getting "EOFError: EOF when reading a line".

2016-10-07 Thread boB Stepp
I think I now understand why I am getting this EOF exception. On Fri, Oct 7, 2016 at 10:16 PM, boB Stepp wrote: > My current get_input() function: > > == > def get_input(): > '''Get string input from the use

Re: [Tutor] Adding numbers within a string

2016-10-12 Thread Bob Gailer
On Oct 12, 2016 4:09 AM, "LQ Soh" wrote: > > To whom it may concern, > Can someone enlighten me as to how you can create a function such > that sum_numbers('10 5 8'), when run, will give an answer of 23, without > using str.split() and using a for loop def sum_numbers(x): for x in [1]:

Re: [Tutor] String within a string solution (newbie question)

2016-10-26 Thread Bob Gailer
On Oct 26, 2016 2:07 PM, "Wish Dokta" wrote: > > Hello, > > I am currently writing a basic program to calculate and display the size of > folders with a drive/directory. To do this I am storing each directory in a > dict as the key, with the value being the sum of the size of all files in > that d

Re: [Tutor] String within a string solution (newbie question)

2016-10-27 Thread Bob Gailer
BubOn Oct 27, 2016 8:38 AM, "Wish Dokta" wrote: > > Hello Alan, > > Thank you for the reply. > > I have actually fixed that bug. If you are bored or for some other reason > would like to assist a newbro my code is here: > > main: http://pastebin.com/LgbeywiB > functions: http://pastebin.com/vU7zzJ

Re: [Tutor] compress directory

2016-11-03 Thread boB Stepp
rflow.com/questions/1855095/how-to-create-a-zip-archive-of-a-directory No time to look it over, but perhaps it will help. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] 1 to 49 numbered grid

2016-12-08 Thread boB Stepp
in a suitable variable to reuse as needed. I am being very general here, but perhaps this can give you some ideas. HTH! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] 1 to 49 numbered grid

2016-12-08 Thread boB Stepp
Apologies! My ever friendly Gmail reset my font preferences along the way and put me on a non-monospace font. However, I hope the OP can determine my intent below despite the misalignment of my big one. Cheers! boB On Thu, Dec 8, 2016 at 8:51 AM, boB Stepp wrote: > Greetings! > > On

Re: [Tutor] FW: 1 to 49 numbered grid

2016-12-08 Thread boB Stepp
Forwarding this to the Tutor list. Please note that your formatting will be lost. Again, this is a plain text list. Also, please don't top-post. On Thu, Dec 8, 2016 at 9:38 AM, M Ali wrote: > Hi Bob > > > > I am trying to create the below and wanted an idea as to how I c

Re: [Tutor] 1 to 49 numbered grid

2016-12-08 Thread boB Stepp
Please respond to the entire Tutor list. Also, note that Tutor is a plain text only list so your image is not going to show up. On Thu, Dec 8, 2016 at 9:21 AM, M Ali wrote: > > Hi Bob > > > > Thank you ever so much in getting in touch. I have been given an exemplar work of wh

Re: [Tutor] 1 to 49 numbered grid

2016-12-08 Thread Bob Gailer
On Dec 8, 2016 8:52 AM, "M Ali" wrote: > > Hi Team > > I was wondering if you can help me, as I am struggling to create a numbered grid in Python. I am trying to be able to create a snakes and ladders game in Python and it must have a numbered grid and involve 2 players. I would appreciate it if y

Re: [Tutor] (no subject)

2016-12-10 Thread Bob Gailer
On Dec 10, 2016 12:15 PM, "Tetteh, Isaac - SDSU Student" < isaac.tet...@jacks.sdstate.edu> wrote: > > Hello, > > I am trying to find the number of times a word occurs on a webpage so I used bs4 code below > > Let assume html contains the "html code" > soup = BeautifulSoup(html, "html.pa

Re: [Tutor] unknown syntax error

2016-12-15 Thread boB Stepp
hat up. It would prove helpful in your example. I'm curious as to how you will call your start() function. Judging from the "print("type start()")" line, I am wondering if you might have a misconception. But go ahead and plow forward and see what happens. That is how we learn. HTH! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] unknown syntax error

2016-12-15 Thread bob gailer
print("your older than me i'm",my_age,":(") please help thank you. IDLE's way of reporting some errors is different than the standard traceback, so you may not be able to follow Bob Stepp's advice. When I select Run on your module I see the first "else

Re: [Tutor] Using Python to solve factoria

2016-12-21 Thread boB Stepp
gic errors! Also give the version of Python and your operating system. I am assuming you are using Python 3. HTH! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread boB Stepp
o back and revisit some code I wrote as I used the os.system()approach. But was this option available in Py 2.4.4? I'll have to check. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyth

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread boB Stepp
My current understanding as to why the subprocess module is preferred to using the older os.system() is to avoid shell injection attacks. So my assumption is that even when using "shell=True" with either run() or Popen(), this is avoided. Is

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread boB Stepp
de attribute." from the docs, I wonder if setting "stdin=PIPE" (or does it need to be "subprocess.PIPE"?) might do what you want? If I am understanding the docs correctly, this will result in stdin going to the the new process you created with call(). I don't have tim

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread boB Stepp
On Sun, Dec 25, 2016 at 3:08 AM, Alan Gauld via Tutor wrote: > > On 25/12/16 01:58, boB Stepp wrote: > > > the stdin option of call()might be used to direct the desired > > keystrokes to LO? After looking at > > The problem is that keystrokes in a GUI are not read fro

Re: [Tutor] I hope you can build a platform for studying in Traditional Chinese.Please

2017-01-29 Thread boB Stepp
docs.io/en/latest/ It is referring to Python 3.2.2 instead of the most current documentation, but perhaps it might be a useful start. Good luck! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Best Python 3 module to create simple text editor in Windows command prompt?

2017-02-02 Thread boB Stepp
creating a more interesting version (with increased features) in tkinter. What would be the best Python 3 module to best assist me in controlling the command prompt window display, font colors, positioning the cursor dynamically, etc.? TIA! -- boB ___ Tutor

Re: [Tutor] Best Python 3 module to create simple text editor in Windows command prompt?

2017-02-02 Thread boB Stepp
On Thu, Feb 2, 2017 at 8:35 PM, eryk sun wrote: > On Fri, Feb 3, 2017 at 2:22 AM, boB Stepp wrote: >> What would be the best Python 3 module to best assist me in controlling >> the command prompt window display, font colors, positioning the cursor >> dynamically, etc.? &g

[Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
nd why this throws a SyntaxError. If I wrap essentially the same code into a function it works: py3: def print_list(a_list): ... for item in a_list: ... print(item) ... print('Huh?') ... py3: print_list(a) Mary had a little lamb break What am I not understanding here? -

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
On Sat, Feb 4, 2017 at 4:40 PM, David wrote: > On 5 February 2017 at 09:02, boB Stepp wrote: >> py3: a >> ['Mary', 'had', 'a', 'little', 'lamb', 'break'] >> py3: for w in a: >> ... print(w) >> ...

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
On Sat, Feb 4, 2017 at 5:44 PM, Alan Gauld via Tutor wrote: > On 04/02/17 22:56, boB Stepp wrote: >> On Sat, Feb 4, 2017 at 4:40 PM, David wrote: >>> On 5 February 2017 at 09:02, boB Stepp wrote: >>>> py3: a >>>> ['Mary', 'h

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
I'm beginning to believe I am being incredibly dense today ... On Sat, Feb 4, 2017 at 6:16 PM, Ben Finney wrote: > boB Stepp writes: > >> But would it not be more consistent to assume the user knows what he >> is doing based on the new (lack of) indentation being use

[Tutor] Function annotations

2017-02-04 Thread boB Stepp
, most of which is dealing with aspects of Python I have not gotten to studying yet! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] sort() method and non-ASCII

2017-02-04 Thread boB Stepp
ses with some text file I might have to manipulate in the future. Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Function annotations

2017-02-04 Thread boB Stepp
On Sat, Feb 4, 2017 at 9:23 PM, Steven D'Aprano wrote: > On Sat, Feb 04, 2017 at 08:50:00PM -0600, boB Stepp wrote: >> Of course, these are >> apparently optional. I now wonder if I should be endeavoring to add >> these to my code? > > Do you run a linter? If no

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sun, Feb 5, 2017 at 2:32 AM, Steven D'Aprano wrote: > On Sat, Feb 04, 2017 at 09:52:47PM -0600, boB Stepp wrote: >> Does the list sort() method (and other sort methods in Python) just go >> by the hex value assigned to each symbol to determine sort order in >> whiche

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: > On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: >> Does the list sort() method (and other sort methods in Python) just go >> by the hex value assigned to each symbol to determine sort order in >> whichever Unicode en

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
ligned on ranges > based on power-of-2 multiples. Like ASCII has the upper case latin alphabet > at 64 (2^6) and lower case at 96 (2^6 + 2^32). Those values look rounder in > base 16: 0x40 and 0x60. I will endeavor to use "code points" instead. I am just used to seeing these char

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sun, Feb 5, 2017 at 7:23 PM, Steven D'Aprano wrote: > On Sun, Feb 05, 2017 at 04:31:43PM -0600, boB Stepp wrote: >> On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: >> > On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: > Alternatively, you can embed it right in t

Re: [Tutor] sort() method and non-ASCII

2017-02-06 Thread boB Stepp
On Sun, Feb 5, 2017 at 10:49 PM, Cameron Simpson wrote: > On 05Feb2017 22:27, boB Stepp wrote: >> >> On Sun, Feb 5, 2017 at 7:23 PM, Steven D'Aprano >> wrote: >>> >>> Alternatively, you can embed it right in the string. For code points >>>

[Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
t has something to do with the built-in attributes of Python objects that I currently know so very little about. 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

[Tutor] Python-list thread: int vs. float

2017-02-10 Thread boB Stepp
future, I am sure I would find a use for it. So I left it as is for the moment.) My quick checks are: py3: ck_input() Enter a number:5 You have entered an integer. py3: ck_input() Enter a number:5.0 You have entered a float. py3: ck_input() Enter a number:'5' You have failed to enter a n

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
pes, including most builtins, eval(repr(obj)) == obj. Question: What does the forward slash represent in this context? If I type: py3: repr(int, /) File "", line 1 repr(int, /) ^ SyntaxError: invalid syntax whereas: py3: repr(int) "" appears

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
s this how I would define __repr__() for a custom class? py3: class boB: ... def __repr__(self): ... return "" ... py3: x = boB() py3: repr(x) "" Seems to work. But in class examples I've seen posted, I do not recall __repr__ ever being defined. So I

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
Thanks for the detailed information. I have a final really nitpicky question. On Fri, Feb 10, 2017 at 11:27 PM, eryk sun wrote: > On Sat, Feb 11, 2017 at 4:32 AM, boB Stepp wrote: >> >> This bit got me experimenting. Since the integer "5" is an integer >> object

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
On Fri, Feb 10, 2017 at 11:49 PM, eryk sun wrote: > On Sat, Feb 11, 2017 at 3:22 AM, boB Stepp wrote: >> >> py3: help(repr) >> Help on built-in function repr in module builtins: >> >> repr(obj, /) >> Return the canonical string representation of the

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread boB Stepp
rguments are only a concern for > built-in functions. So I am assuming this syntax is only being used for some built-in functions? You have provided a lot of interesting information. I'm not sure if I am comprehending everything, but it has made interesting reading and Googling tonight.

Re: [Tutor] Python-list thread: int vs. float

2017-02-11 Thread boB Stepp
On Fri, Feb 10, 2017 at 7:59 PM, boB Stepp wrote: > I have been following the thread "int vs. float" > (https://mail.python.org/pipermail/python-list/2017-February/719287.html) > on the main list. A search for the OP on the Tutor archive came up > negative, so I am hopi

Re: [Tutor] Python-list thread: int vs. float

2017-02-11 Thread boB Stepp
>> word = "Hello" >>>> print((c for c in word)) Need print(*(c...)) to unpack the sequence arguments. > at 0xb71d125c> >>>> >>>> print(*(c for c in word)) > > H e l l o Spaces because of the default setting for sep argu

Re: [Tutor] Python-list thread: int vs. float

2017-02-11 Thread boB Stepp
license()" for more information. >>> s Traceback (most recent call last): File "", line 1, in s NameError: name 's' is not defined >>> '௧꘢୩' '௧꘢୩' >>> I think that this demonstrates that 's' is just an identifier pointing to the non-ASCII character sequence, but that the actual characters can be copied and pasted *if* the editor or environment you paste those characters into is setup to translate those characters. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python-list thread: int vs. float

2017-02-11 Thread boB Stepp
On Sat, Feb 11, 2017 at 2:06 AM, Steven D'Aprano wrote: > On Fri, Feb 10, 2017 at 07:59:04PM -0600, boB Stepp wrote: > >> He cannot figure out how to reliably tell if the user's input is an >> integer, float or neither. So I thought I would come up with my >

Re: [Tutor] Python-list thread: int vs. float

2017-02-11 Thread boB Stepp
On Sat, Feb 11, 2017 at 7:08 PM, Steven D'Aprano wrote: > On Sat, Feb 11, 2017 at 02:28:42PM -0600, boB Stepp wrote: > >> Back in the main Python list thread, Marko Rauhamaa suggested >> (https://mail.python.org/pipermail/python-list/2017-February/719322.html): >>

Re: [Tutor] Resources/Books for teaching OOP in Python and Tkinter

2017-02-20 Thread boB Stepp
st in my mind seems to be "Programming Python" by Lutz, which is Python 3-based. He does a much better job explaining things; however, he is assuming you are fairly competent in basic Python, that is, it is a sequel to his other massive tome, "Learning P

[Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread boB Stepp
A' Obviously I am horribly misunderstanding something, and being currently sleepy is not helping my cause. Help, please? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread boB Stepp
On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp wrote: > I am trying to wrap my head around the mechanics of inheritance in > Python 3. I thought that all attributes of a superclass were > accessible to an instance of a subclass. But when I try the > following: > > py3: clas

Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-23 Thread boB Stepp
Thank you to everyone that provided illumination in this thread! Things seem much clearer now, which caused me to realize that what I wrote below cannot work as written (Even though I did copy and paste it from the interpreter): On Wed, Feb 22, 2017 at 10:53 PM, boB Stepp wrote: > On Wed, Feb

Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-23 Thread boB Stepp
On Wed, Feb 22, 2017 at 10:49 PM, Zachary Ware wrote: > On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp wrote: > > I'll give you a couple of hints. First, try this: > > print('defining A') > class A: > print('Setting a on class A') When I typed

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