Re: [Tutor] How to use Git from Windows PC for files on Solaris machine where Git cannot be installed?

2015-04-30 Thread boB Stepp
On Wed, Apr 29, 2015 at 11:38 PM, Dave Angel wrote: > On 04/30/2015 12:28 AM, boB Stepp wrote: >> >> The main danger as I see it is that if I am not careful, then the code >> on the dev environment could diverge from the state of code on my >> Windows PC, i.e., I for

Re: [Tutor] How to use Git from Windows PC for files on Solaris machine where Git cannot be installed?

2015-04-29 Thread boB Stepp
On Wed, Apr 29, 2015 at 10:39 PM, Cameron Simpson wrote: > On 29Apr2015 22:10, boB Stepp wrote: >> On the smart enterprise where we (now) do our clinical planning they >> are very strict: no installing any external software; no accessing the >> Internet; no email; etc. Not

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

2015-04-29 Thread boB Stepp
On Wed, Apr 29, 2015 at 5:49 PM, Peter Otten <__pete...@web.de> wrote: > boB Stepp wrote: >> So I have stumbled (With your gracious help!) into a legitimate use of >> eval()? > > No. To expand on Marks hint here's how to do it without evil eval(

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

2015-04-29 Thread boB Stepp
re much easier on the eyes, I do say! Anyway, Mark, thanks for the link! This looks quite straightforward and I will be able to side-step the evils of eval() once again. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscrip

Re: [Tutor] How to use Git from Windows PC for files on Solaris machine where Git cannot be installed?

2015-04-29 Thread boB Stepp
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote: > On 29Apr2015 12:12, boB Stepp wrote: >>> >>> ... (3) install git if needed ... >> >> >> It seems Git is needed, but I am not allowed to install it on the >> Solaris workstation. So is there

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

2015-04-29 Thread boB Stepp
studying of this topic. But as you point out, not ready for it yet! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

2015-04-29 Thread boB Stepp
On Wed, Apr 29, 2015 at 3:46 PM, Marc Tompkins wrote: > On Wed, Apr 29, 2015 at 1:10 PM, boB Stepp wrote: >> >> Python 2.4.4, Solaris 10. >> >> I have some functions that I believe I could collapse into a single >> function if I only knew how: >> >>

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

2015-04-29 Thread boB Stepp
tion I have done to date has not worked. Also, what about the first function above? I could use 2 dictionaries, 1 for calling the 5 functions and one to pass the arguments, but is it worth doing this? Or, I would not be surprised if there is a much better way! ~(:>)) Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to use Git from Windows PC for files on Solaris machine where Git cannot be installed?

2015-04-29 Thread boB Stepp
On Wed, Apr 29, 2015 at 12:04 PM, Albert-Jan Roskam wrote: > > -- > On Wed, Apr 29, 2015 4:21 PM CEST boB Stepp wrote: > >>I now have Git installed on my Windows 7 PC at work. The files that I >>wish to put under Git version control exist on a

[Tutor] How to use Git from Windows PC for files on Solaris machine where Git cannot be installed?

2015-04-29 Thread boB Stepp
sting projects and from the get-go on new ones. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Questions (and initial responses) on using version control [Was: Introductory questions on test-driven development and implementing Git version control.]

2015-04-25 Thread boB Stepp
On Sat, Apr 25, 2015 at 10:30 AM, boB Stepp wrote: > On Fri, Apr 24, 2015 at 7:36 PM, Steven D'Aprano wrote: >>On Fri, Apr 24, 2015 at 02:09:45PM -0500, boB Stepp wrote: > > [...] > >>> And what would be the best approach to integrating Git with these >>>

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-25 Thread boB Stepp
On Fri, Apr 24, 2015 at 7:36 PM, Steven D'Aprano wrote: > So many questions... let's hope I don't miss any... :-) > > On Fri, Apr 24, 2015 at 02:09:45PM -0500, boB Stepp wrote: > >> First question: What testing modules/frameworks should I start out >> with?

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-25 Thread boB Stepp
On Sat, Apr 25, 2015 at 10:58 AM, boB Stepp wrote: > On Sat, Apr 25, 2015 at 3:20 AM, Laura Creighton wrote: >> In a message of Fri, 24 Apr 2015 20:24:38 -0500, boB Stepp writes: >>>I think that I can get an exception here (See a post in response that >>>I made

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-25 Thread boB Stepp
On Sat, Apr 25, 2015 at 3:20 AM, Laura Creighton wrote: > In a message of Fri, 24 Apr 2015 20:24:38 -0500, boB Stepp writes: >>The Python versions at work are 2.4.4 and 2.6.4(?)(Not certain about >>the last digit there.) Based on responses to date, the fact that >>unitte

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-25 Thread boB Stepp
On Sat, Apr 25, 2015 at 3:21 AM, Alan Gauld wrote: > Having looked at this thread and its early responses I think it > would be good to break it up into its two natural parts. TDD > and version control are pretty much separate concepts and > should be on separate threads. > &

[Tutor] Questions (and initial responses) on using version control [Was: Introductory questions on test-driven development and implementing Git version control.]

2015-04-25 Thread boB Stepp
id not include those portions of the original thread here. In a message of Fri, 24 Apr 2015 14:09:45 -0500, boB Stepp writes: [...] >My wife (A teacher.) has been after me a lot lately to write some >programs to make her teaching life better. So I would like to start >one of her projects us

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-24 Thread boB Stepp
tools to support it than I did a few minutes ago. I highly recommend watching this video -- Mr. Batchelder is a very good speaker and presents his material very effectively. Many thanks, Mark, for this link! boB ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-24 Thread boB Stepp
On Fri, Apr 24, 2015 at 3:00 PM, Laura Creighton wrote: > In a message of Fri, 24 Apr 2015 14:09:45 -0500, boB Stepp writes: > You need the testing-in-python mailing list. Come on over ... > http://lists.idyll.org/listinfo/testing-in-python > You will find lots of familiar

Re: [Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-24 Thread boB Stepp
On Fri, Apr 24, 2015 at 5:03 PM, Alan Gauld wrote: > On 24/04/15 20:09, boB Stepp wrote: >> >> allowed to install anything else, strange as this may sound! Since the >> only functional editors in these bare-bones Solaris 10 environments >> are some simplistic defaul

[Tutor] Introductory questions on test-driven development and implementing Git version control.

2015-04-24 Thread boB Stepp
e special strategies and techniques for accomplishing such a feat? And any other suggestions to best start learning all of this as well as possible? As always, many thanks in advance! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] How to close a Tkinter window from a different thread?

2015-04-24 Thread boB Stepp
On Fri, Apr 24, 2015 at 8:41 AM, Steven D'Aprano wrote: > On Sun, Apr 19, 2015 at 10:34:43PM -0500, boB Stepp wrote: > >> Scenario B: >> 1) I start out inside the CSA. >> 2) I initiate a script in the CSA's scripting language. >> 3) This script calls a

Re: [Tutor] How to close a Tkinter window from a different thread?

2015-04-20 Thread boB Stepp
On Mon, Apr 20, 2015 at 2:10 AM, Alan Gauld wrote: > On 20/04/15 04:34, boB Stepp wrote: > >> So, how do I: >> 1) Check for the existence of an already open window from a previous >> running of the script? >> 2) If such a window exists, how do I close it from th

Re: [Tutor] How to close a Tkinter window from a different thread?

2015-04-20 Thread boB Stepp
On Mon, Apr 20, 2015 at 2:10 AM, Alan Gauld wrote: > On 20/04/15 04:34, boB Stepp wrote: > >> So, how do I: >> 1) Check for the existence of an already open window from a previous >> running of the script? >> 2) If such a window exists, how do I close it from th

[Tutor] How to close a Tkinter window from a different thread?

2015-04-19 Thread boB Stepp
close the particular window I need closed -- IF it is even open. I feel the solution must be in Tkinter's access to the X Window system, but nothing in the documentation is *clicking* with me yet. Thanks! -- boB ___ Tutor maillist - Tutor@

[Tutor] OT: Is there a good book that covers the history/evolution of software? [Inspired by the thread: lists, name semantics]

2015-04-19 Thread boB Stepp
, etc.? As the different threads reveal bits and pieces of the low level guts of Python, I am becoming more and more fascinated about how all of this is managed. Just the brief discussion of garbage collection details going on I find quite interesting. -- boB

Re: [Tutor] lists, name semantics

2015-04-19 Thread boB Stepp
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel wrote: > On 04/19/2015 03:08 PM, boB Stepp wrote: >> >> Or is the real point that we are adding an abstraction >> layer so we don't even have to think about where objects are >> physically stored in RAM? > > >

Re: [Tutor] lists, name semantics

2015-04-19 Thread boB Stepp
On Sun, Apr 19, 2015 at 6:47 AM, Dave Angel wrote: > On 04/19/2015 12:07 AM, boB Stepp wrote: [...] >> I hope this is helpful, and, if there are any misstepps, that when >> they are revealed both of our understandings will be enhanced! >> > > Some of your knowledge of

Re: [Tutor] lists, name semantics

2015-04-19 Thread boB Stepp
On Sun, Apr 19, 2015 at 12:24 AM, Cameron Simpson wrote: > On 19Apr2015 15:09, Cameron Simpson wrote: >> >> On 18Apr2015 23:26, boB Stepp wrote: >>> >>> On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson wrote: [...] >>> "Two problems often e

Re: [Tutor] lists, name semantics

2015-04-18 Thread boB Stepp
ence to themselves) may cause a recursive loop. Because deep copy copies everything it may copy too much, e.g., administrative data structures that should be shared even between copies." If I am understanding things correctly, should not that last sentence read instead: ".

Re: [Tutor] lists, name semantics

2015-04-18 Thread boB Stepp
On Sat, Apr 18, 2015 at 10:03 PM, Bill Allen wrote: > > On Apr 18, 2015 4:11 PM, "boB Stepp" wrote: >> >> On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen wrote: >> > On Apr 18, 2015 7:50 AM, "Peter Otten" <__pete...@web.de> wrote: >>

Re: [Tutor] How (not!) lengthy should functions be?

2015-04-18 Thread boB Stepp
g you can do about this; it's human nature. So I claim that > making sure the advice your program offers has > 1) few bugs. And what it has should be crashes, not just getting the > wrong result. > 2) Careful wording of the messages to indicate the

Re: [Tutor] lists, name semantics

2015-04-18 Thread boB Stepp
print the original copy of a which b now references which is > [1, ["x", "y"], 3] Uh, oh! You should have checked your work in the interpreter before replying! Peter is being very tricky!! (At least for me...) Look again at that list inside of a list and... boB P.S.: Wat

Re: [Tutor] How to print ALL contents of a scrolled Tkinter window?

2015-04-18 Thread boB Stepp
On Fri, Apr 17, 2015 at 2:28 PM, Alan Gauld wrote: > On 17/04/15 14:26, boB Stepp wrote: >> >> Solaris 10, Python 2.4.4 >> [...] > That's why GUI printing generally uses an entirely different > technique to print things (see my earlier email). In essence > thi

Re: [Tutor] How (not!) lengthy should functions be?

2015-04-18 Thread boB Stepp
On Thu, Apr 16, 2015 at 4:03 PM, Alan Gauld wrote: > On 16/04/15 17:47, boB Stepp wrote: [...] > 2) I have seen varying recommendations as to number of lines of code > > Most of these come from the days when we worked on dumb terminals with 24 > line screens. Actual measurements

Re: [Tutor] How (not!) lengthy should functions be?

2015-04-18 Thread boB Stepp
ut decreasing target coverage; etc. Even though I am attempting to make this program as *bulletproof* as my knowledge and experience allows, it cannot affect anyone's treatment. It is purely a supplemental level of checking, much like the many, ... , ma

Re: [Tutor] Star imports, was Re: How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-18 Thread boB Stepp
On Thu, Apr 16, 2015 at 2:54 AM, Peter Otten <__pete...@web.de> wrote: > boB Stepp wrote: > >>> import Tkinter as tk >> >> Question: I have been using "from Tkinter import *" as suggested in >> "Programming Python" by Lutz. He remarks t

Re: [Tutor] How to print ALL contents of a scrolled Tkinter window?

2015-04-18 Thread boB Stepp
t of OS hassle. In my particular scenario I would desire the ability to output both postscript and pdf, though if I have the first it is easy to get the latter. boB Stepp ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to print ALL contents of a scrolled Tkinter window?

2015-04-17 Thread boB Stepp
include your suggestion. However, I will look into kivy for my at-home studies/projects! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How to print ALL contents of a scrolled Tkinter window?

2015-04-17 Thread boB Stepp
cannot help but feel there is a much better way... I intend to scour my available Tkinter documentation to see if there are root window level and scrolled area commands that might suggest another approach. And what I am doing now, seeking your collective wisdom... Thanks! -- boB

[Tutor] How (not!) lengthy should functions be?

2015-04-16 Thread boB Stepp
en on one's monitor. Of course, some people have HUGE monitors! And I assume that any guidance applies equally well to methods. Am I on-track or am I getting carried away? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
jects it might be very useful. However, I should work on mastering Tkinter first, as I am sure that all of the principles I learn here will be generically useful for any GUI programming. Thanks, Alan! -- boB ___ Tutor maillist - Tutor@python.org To unsub

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 10:39 AM, Peter Otten <__pete...@web.de> wrote: > boB Stepp wrote: > >> Solaris 10, Python 2.4.4 [...] > > I'm on linux and surprisingly > > subprocess.call(["import", "-window", window_title, postscript_file]) >

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 8:50 AM, Zachary Ware wrote: > > On Apr 15, 2015 9:38 AM, "boB Stepp" wrote: >> Perhaps I am being foolish! But I do have my reasons, which, in this >> case, is I wanted to take advantage of the pack and grid geometry >> managers

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 8:29 AM, Steven D'Aprano wrote: > On Wed, Apr 15, 2015 at 07:55:28AM -0500, boB Stepp wrote: >> Solaris 10, Python 2.4.4 >> >> I have very little experience with issuing print commands using a Unix >> environment. Despite this, I wish t

[Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
ething*, but how do I get it to print the specific window containing the to-be-designed print button? Also, I need it to print a postscript file, not print to paper. I suspect this is another configuration setting that I need to research. As always, many th

Re: [Tutor] still breaking chains

2015-04-12 Thread boB Stepp
chance of *immediately* understanding my intent, then when I have to decipher my thoughts from a "one-liner" that might occupy less space, but where its complexity has me pausing in thought to be sure I understand what I actually was trying to do. -- boB __

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-07 Thread boB Stepp
On Mon, Apr 6, 2015 at 2:42 PM, Dave Angel wrote: > On 04/06/2015 03:20 PM, Emile van Sebille wrote: >> >> On 4/6/2015 7:54 AM, boB Stepp wrote: >>> [...] >> >> Maybe this form helps: >> >> Python 2.7.6 (default, Mar 22 2014, 22:59:56) >

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-07 Thread boB Stepp
On Mon, Apr 6, 2015 at 12:54 PM, Dave Angel wrote: > On 04/06/2015 12:43 PM, boB Stepp wrote: > >> >> I was breaking down longer functions into smaller ones. Along the way >> I noticed I was passing an entire dictionary from one function to >> another. I only neede

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread boB Stepp
icular value, not the whole dictionary, so that is how I got into the issue I asked about. Once you and Joel responded it was *obvious*. A bunch of years ago, it would have been *obvious* and I never would have asked the question in the first place. This is easy enough to correct now that I realize

[Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread boB Stepp
>>> d['n'] 'Print me!' >>> def func(d['n']): SyntaxError: invalid syntax >>> def func(d): print d['n'] >>> func(d) Print me! The plain text does not show it, but in the invalid syntax the &q

Re: [Tutor] Use of "or" in a lambda expression

2015-04-05 Thread boB Stepp
On Sun, Apr 5, 2015 at 3:06 AM, Alan Gauld wrote: > On 05/04/15 04:45, boB Stepp wrote: > >>>>> He could have done it in various other ways too: >>>>> >>>>> eg. >>>>> lambda : all(print('Hello lambda world!'), sys.ex

Re: [Tutor] Use of "or" in a lambda expression

2015-04-04 Thread boB Stepp
On Sat, Apr 4, 2015 at 6:55 PM, Alan Gauld wrote: > On 04/04/15 22:57, boB Stepp wrote: >> >> On Sat, Apr 4, 2015 at 3:35 PM, Alan Gauld >> wrote: >>> >>> He could have done it in various other ways too: >>> >>> eg. >>> lambda

Re: [Tutor] Use of "or" in a lambda expression

2015-04-04 Thread boB Stepp
nt('Hello lambda world!'), sys.exit()) > But the OR style is established as a kind of idiom, > not just in Python but several other languages too. So this is not unusual for Python. BTW, what are some of the other languages where this type of expres

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-04 Thread boB Stepp
nterfaces. Most programmers should be familiar users of such technologies. At the center of each of those areas, though, is a hard core of programming problems. Those programs remain the theme of this book. This edition of the book is a slightly larger fish in a much larger pond. ..." HTH -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Use of "or" in a lambda expression

2015-04-04 Thread boB Stepp
On Sat, Apr 4, 2015 at 12:34 PM, Steven D'Aprano wrote: > On Sat, Apr 04, 2015 at 11:49:08AM -0500, boB Stepp wrote: >> Windows 7, Python 3.4.3 >> >> This code snippet is "Example 7-13" on page 383 from "Programming >> Python, 4th ed." by

Re: [Tutor] Use of "or" in a lambda expression

2015-04-04 Thread boB Stepp
On Sat, Apr 4, 2015 at 12:34 PM, Steven D'Aprano wrote: > On Sat, Apr 04, 2015 at 11:49:08AM -0500, boB Stepp wrote: >> Windows 7, Python 3.4.3 >> >> This code snippet is "Example 7-13" on page 383 from "Programming >> Python, 4th ed." by

[Tutor] Use of "or" in a lambda expression

2015-04-04 Thread boB Stepp
pecting the 'or' to result only in the print running without executing sys.exit(). But that is not what happens--of course. I tried substituting 'and' for 'or', but this results in only the print being run! Obviously I have a significant misunderstanding of what is

Re: [Tutor] Unexpected results using enumerate() and .split()

2015-03-31 Thread boB Stepp
code that I assume this was cut out of, keep enumerate; it's the right > tool for the job. Yeah, I simplified my actual code into the smallest snippet that I could reproduce my problem in. My actual code need the index. -- boB ___ Tutor maillis

Re: [Tutor] Unexpected results using enumerate() and .split()

2015-03-31 Thread boB Stepp
On Tue, Mar 31, 2015 at 3:32 PM, Dave Angel wrote: > On 03/31/2015 04:23 PM, boB Stepp wrote: >> >> The following behavior has me stumped: >> >> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit >> (Intel)] on win32 >> Type "copyright&quo

Re: [Tutor] Unexpected results using enumerate() and .split()

2015-03-31 Thread boB Stepp
On Tue, Mar 31, 2015 at 3:28 PM, Zachary Ware wrote: > On Tue, Mar 31, 2015 at 3:23 PM, boB Stepp wrote: >> The following behavior has me stumped: >> >> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit >> (Intel)] on win32 >> Type "copyrig

[Tutor] Unexpected results using enumerate() and .split()

2015-03-31 Thread boB Stepp
d the indentation that was present in the interpreter. I added spaces manually to get it appear as it did in the interpreter. Anyone know why Gmail does that to my copy and paste? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why does print(a_list.sort()) return None?

2015-03-29 Thread boB Stepp
at sorted() was an available option. I had focused on available list methods. While it does not matter if my actual lists do or do not get sorted, my intent was to just have a sorted view of the list, so your suggestion works better here and uses one less line of code. Thanks! -- boB __

Re: [Tutor] Why does print(a_list.sort()) return None?

2015-03-28 Thread boB Stepp
t method returns None. And that is > printed. Ah! I did not realize this. That makes sense now. Many thanks, Cameron! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Why does print(a_list.sort()) return None?

2015-03-28 Thread boB Stepp
)) None >>> print(a_list) [0, 1, 2, 4, 5] >>> I expected the first print statement to return what the second one did. Apparently the first print printed a_list, then did the sort. Why is this so? -- boB ___ Tutor maillist - Tut

Re: [Tutor] List comprehensions to search a list--amazing!

2015-03-23 Thread boB Stepp
oops, best of 3: 221 usec per loop > > So reverse/bisect is 50 times faster than the listcomp, and > bisect/virt is 3500 times faster than the listcomp. You present a compelling case! > I expect that a prepackaged linear interpolation function from numpy/scipy > can still do better, and also handle the corner cases correctly. To use such > a function you may have to reverse order of the values. This is not an option for me as I would not be allowed to install numpy/scipy. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List comprehensions to search a list--amazing!

2015-03-23 Thread boB Stepp
irectly use those functions on a list which is > reverse-sorted, but the source is available. On my install, it's located > at: > > /usr/lib/python3.4/bisect.py And I see this is available on my oldest Python installlation, 2.4.4, too. -- boB ___

[Tutor] What is the best approach to organizing the order of functions in a module?

2015-03-19 Thread boB Stepp
mimic the natural order, in so far as it is possible, in which the functions get called. Are there better ways to organize them? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/ma

[Tutor] List comprehensions to search a list--amazing!

2015-03-18 Thread boB Stepp
= S[0] I tested this out with concrete examples in the interpreter, such as with a list, L: L = [item for item in range(1, 0, -1)] and trying different test values. It was blazingly fast, too! All I can say is: WOW!!! -- boB ___ Tutor maillist - Tu

Re: [Tutor] print string using triple quote

2015-03-17 Thread boB Stepp
is used to initiate "escape" sequences. And since every line ends with with "invisible" line termination character(s) (newline, \n, carriage return, \r), the backslash at the end of a line interacts with what is there, whether you can see it or not. -- boB ___

Re: [Tutor] Idle - ImportError: No module named numpy

2015-03-06 Thread boB Stepp
y chance have Python 2 installed as well as Python 3, where Python 2 is associated with your terminal session? And your numpy module is for Python 2, not 3? That is my first thought, but I'm sure the experts will chime in shortly with a more definitive diagnosis. -- boB

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread boB Stepp
would like to throw out a general THANK YOU to all of the "tutors", who so generously donate your time. I know I have gotten many detailed, patient answers to my queries. I just hope I truly absorb and properly utilize the wisdom passed on t

Re: [Tutor] Python 3 - bugs or installation problem

2015-03-04 Thread boB Stepp
2.x's xrange(), which is removed." -- Python Pocket Reference, 5th ed., by Mark Lutz. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-04 Thread boB Stepp
slight "clunkiness" in addressing pales in comparison to the power and flexibility of the "stuff" I can store in a list compared to an array (unless they have substantially evolved). And I have greatly enjoyed making use of this flexibility! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] mySQL and Python

2015-02-18 Thread boB Stepp
rmation. Also, sometimes something *clicks* and I am able to solve an issue that has been baffling me for a while. Plus it gives me thought to what to study in the future... -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

[Tutor] OT: Preferred email client for sending plain text programming code snippets

2015-02-17 Thread boB Stepp
ain text communication as I only rarely need html formatting. And I rarely care to see most of the crap people send me that require html! So are there any recommendations from this group that would make things easy, would still be able to receive/send from my Gmail account, etc.? --

Re: [Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread boB Stepp
On Tue, Feb 17, 2015 at 3:34 PM, Joel Goldstick wrote: > On Tue, Feb 17, 2015 at 4:05 PM, boB Stepp wrote: >> On Tue, Feb 17, 2015 at 1:47 PM, Dave Angel wrote: >>> On 02/17/2015 02:12 PM, boB Stepp wrote: >> This seems to be the case. On a related note, I wanted

Re: [Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread boB Stepp
On Tue, Feb 17, 2015 at 3:05 PM, boB Stepp wrote: > This seems to be the case. On a related note, I wanted to copy and > paste the author's source code, showing how he generated the large, > "Game Over", but my Gmail keeps collapsing the white space, making the > res

Re: [Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread boB Stepp
On Tue, Feb 17, 2015 at 1:47 PM, Dave Angel wrote: > On 02/17/2015 02:12 PM, boB Stepp wrote: > > See > https://docs.python.org/3.4/reference/lexical_analysis.html#string-and-bytes-literals >> >> >> At this point in the text he is not talking about raw literal strin

Re: [Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread boB Stepp
did, you leave no spaces between the last backslash and the EOL termination characters, then the problem behavior occurs. Actually, I realize I have a question: If I do the following in the Win7 command line Python interpreter: Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64

[Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread boB Stepp
x27;t want to say too much for those working through this book, but the essence of the issue is illustrated by the following: Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more inform

[Tutor] What are *appropriate* uses for exec() and eval() ?

2015-02-16 Thread boB Stepp
IS appropriate? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 10:58 AM, Dave Angel wrote: > On 02/11/2015 10:29 AM, boB Stepp wrote: >> >> On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel wrote: >>> >>> On 02/11/2015 08:27 AM, boB Stepp wrote: [...] >>> In each case, there are probably better

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel wrote: > On 02/11/2015 08:27 AM, boB Stepp wrote: [...] > > Sure, it's viable, but the best approach depends on your goal (use case), > and your restrictions. Are these functions really totally unrelated to each > other? You not

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:44 AM, eryksun wrote: > On Wed, Feb 11, 2015 at 7:27 AM, boB Stepp wrote: >> >> pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)} >> call_fcn[key_letter](key_letter) >> >> But ran into the syntax e

[Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
s are expected. Is what I am trying to do a viable approach that can be made to work? Otherwise, I will brute-force my way through with if-elif-else statements. Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Nested for loops, possibly?

2015-02-06 Thread Bob Williams
>>>>>>> def main(): print("Backing up ", src_path, >>>>>>> "/Documents\n", sep='') do_sync(doc_srcpath, >>>>>>> doc_syncpath) create_snaps(doc_syncpath, doc_snappath) >>>>>>> print("

Re: [Tutor] How to easily recover the current index when using Python-style for loops?

2015-02-05 Thread boB Stepp
of the other software on the systems unless the planning software upgrade makes use of external software that must be upgraded, too. Unfortunately Python is not one of these! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] How to easily recover the current index when using Python-style for loops?

2015-02-05 Thread boB Stepp
On Thu, Feb 5, 2015 at 11:48 AM, Alan Gauld wrote: > On 05/02/15 17:30, boB Stepp wrote: >> >> Python 2.4.4, Solaris 10. >> >> a_list = [item1, item2, item3] >> for item in a_list: >> print 'Item number', ???, 'is:', item >> &

Re: [Tutor] How to easily recover the current index when using Python-style for loops?

2015-02-05 Thread boB Stepp
On Thu, Feb 5, 2015 at 11:45 AM, Zachary Ware wrote: > On Thu, Feb 5, 2015 at 11:30 AM, boB Stepp wrote: >> Python 2.4.4, Solaris 10. >> >> a_list = [item1, item2, item3] >> for item in a_list: >> print 'Item number', ???, 'is:', item >

Re: [Tutor] Nested for loops, possibly?

2015-02-05 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/02/15 14:59, DaveA wrote: > > > On February 5, 2015 8:27:29 AM EST, Bob Williams > wrote: >> Hi, >> >> My script is running under Python 3.4.1 on a 64bit openSUSE >> linux system. It is a backup scrip

[Tutor] How to easily recover the current index when using Python-style for loops?

2015-02-05 Thread boB Stepp
Python 2.4.4, Solaris 10. a_list = [item1, item2, item3] for item in a_list: print 'Item number', ???, 'is:', item Is there an easy, clever, Pythonic way (other than setting up a counter) to replace ??? with the current index of item

Re: [Tutor] Nested for loops, possibly?

2015-02-05 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/02/15 13:57, Mark Lawrence wrote: > On 05/02/2015 13:27, Bob Williams wrote: > >> >> I would like to reduce all those repeated calls to do_sync() in >> main(), for example, to one by putting the *_srcpath and >&

[Tutor] Nested for loops, possibly?

2015-02-05 Thread Bob Williams
subprocess import sys if not os.getuid() == 0: print("\n*** This script must be run as root. ***\n") sys.exit() mnt_path = "/home/bob/A3" subprocess.call(["mount", "LABEL=backup", mnt_path]) if not os.path.ismount(mnt_path): print("\nBackup

Re: [Tutor] Why is it not working?

2015-02-04 Thread boB Stepp
that one should not run a program using Tkinter from within IDLE as IDLE itself is implemented using Tkinter. Just to eliminate one other variable from your troubleshooting you might ensure you start your program from the command line and not from within IDLE. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread boB Stepp
On Thu, Jan 22, 2015 at 5:45 PM, Steven D'Aprano wrote: > On Thu, Jan 22, 2015 at 03:17:58PM -0600, boB Stepp hid the following > question in the subject line: > > "Does the Python way of doing things have a definite preference for the > structure and content of pro

Re: [Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread boB Stepp
On Thu, Jan 22, 2015 at 5:25 PM, Ben Finney wrote: > boB Stepp writes: > >> And […] > > Could you write a message body that asks the question? (The Subject > field isn't part of the message body.) Does the Python way of doing things have a definite preference for th

[Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread boB Stepp
And will this vary depending on whether a version control system is being used or not? Or is the use of a version control system considered to be highly recommended (if not mandatory)? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Could you look over my code?

2015-01-04 Thread boB Stepp
t; instead of "input", so your code will look like this: In the paragraph above, I believe that Steven meant to say, "... version 3. In Python 2, you should use ...", which should be evident from his earlier comments. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: Re: Learning to program, not code. [LONG RESPONSE!]

2014-12-21 Thread boB Stepp
It appears that Michael only sent this to me when I think he meant to send it to the list... -- Forwarded message -- From: "Michael Shiloh" Date: Dec 21, 2014 7:25 PM Subject: Re: [Tutor] Learning to program, not code. [LONG RESPONSE!] To: "boB Stepp" Cc: &g

Re: [Tutor] Learning to program, not code. [LONG RESPONSE!]

2014-12-19 Thread boB Stepp
t file you are expecting isn't actually there? Etc. I hope I did not waste your time with this long post. As I said, my programming skills are quite modest. But this is how I try to approach things. Keep at it! Persistence wins out in the end!1 Cheers! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

<    1   2   3   4   5   6   7   8   9   10   >