Re: [Tutor] Suggestion required on python as scripting language

2013-12-08 Thread bob gailer
On 12/8/2013 1:59 AM, Shankar Donepudi wrote: Hi All, I am working as test engineer in Networking in storage domain. We have decided to automate our testing and have chosen python for the same. We have basic knowledge on python so can anyone suggest good tutorials for writing automation scrip

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread bob gailer
On 1/24/2014 4:47 AM, Steven D'Aprano wrote: Hi Tobias, and welcome. On Thu, Jan 23, 2014 at 07:34:18PM -0700, Tobias Quezada wrote: hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal.

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread bob gailer
On 1/24/2014 10:28 PM, bob gailer wrote: Sorry for misspelling parens. My reason for requesting the various names is that it makes communication clear, explicit and terse. When someone says just "brackets" what does he actually mean? For more grins see http://www.codinghorror.com

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-01-29 Thread bob gailer
On 1/28/2014 9:12 PM, scurvy scott wrote: Hi guys, I'm trying to figure out why my code won't output to terminal, but will run just fine in interpreter. I'm using python 2.7.3 on Debian Linux/Crunchbang. Here is my code. import requests from bs4 import BeautifulSoup as beautiful import sys de

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-01-31 Thread bob gailer
On 1/29/2014 8:59 PM, scurvy scott wrote: Please always reply to the tutor list so we can all play with your question. On 1/28/2014 9:12 PM, scurvy scott wrote: Hi guys, I'm trying to figure out why my code won't output to terminal, but will run just fine in interpreter. I'm using

Re: [Tutor] Recommendation For A Complete Noob

2014-02-11 Thread Bob Williams
m names into a list. So far, so good but my output contains duplicates, so my final task is to work out how to get rid of them. You may find me popping up here again in a few days ;-) Good luck. Bob - -- Bob Williams System: Linux 3.11.10-7-desktop Distro: openSUSE 13.1 (x86_64) with KDE Developme

Re: [Tutor] Recommendation For A Complete Noob

2014-02-12 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/02/14 00:58, Dave Angel wrote: > Bob Williams Wrote in message: > > >> to slice those lines to get the artist and album names into a >> list. >> >> So far, so good but my output contains duplicates, so my fi

Re: [Tutor] i dont understand this code

2014-02-22 Thread bob gailer
On 2/22/2014 7:26 AM, piyush joshi wrote: Can anyone help me out in understanding this code Your question is kinda vague. Exactly what do you not understand? # import os rotationMatrix1 = [7, 1, 5, 3, 0, 6, 2, 5, 2, 3, 0, 6, 1, 7, 6, 1, 5, 2, 7, 1, 0, 3, 7, 6, 1, 0, 5, 2, 1, 5, 7, 3, 2, 0

[Tutor] os.symlink can't find target

2014-02-24 Thread Bob Williams
print 'Creating link %s -> %s' % (linkName2, pathList[j]) os.symlink(pathList[j], linkName2) fails with this error: Creating link /pollux/music/portable/testing/artists/Death in June/1995 Rose Clouds Of Holocaust/10 Lifebooks.mp3 -> /home/bob/music/artists/Death

Re: [Tutor] os.symlink can't find target

2014-02-24 Thread Bob Williams
> Peter, Many thanks. I was fixating on the existing_file, not realising I had to create a home for the symlink first. > try: os.makedirs(os.path.dirname(symlink_to_create)) except OSError > as err: # Assume the directory exists. # A thorough coder would > check the errno here pass Rega

Re: [Tutor] os.symlink can't find target

2014-02-24 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/02/14 16:56, Mark Lawrence wrote: > On 24/02/2014 16:36, Peter Otten wrote: >> Bob Williams wrote: >> [...] >>> Thanks, >> >> os.symlink(existing_file, symlink_to_create) >> >> fails with that e

Re: [Tutor] os.symlink can't find target

2014-02-26 Thread Bob Williams
05:31, Cameron Simpson wrote: > Hi Bob, > [...] > > The other things are just script remarks, not directly related to > your problem: > > On 24Feb2014 16:07, Bob Williams > wrote: >> if pathList[j][-3:] == "mp3": > > This is often written (I'

[Tutor] Editing values from a dictionary

2014-02-26 Thread Bob Williams
c In [2]: metadata = mutagen.flac.Open("/home/bob/music/artists/The Incredible String Band/1967 The 5000 Spirits Or The Layers Of The Onion/08 The Hedgehog's Song.flac") In [3]: print metadata["artist"] [u'The Incredible String Band'] I now want to pass that

Re: [Tutor] Editing values from a dictionary

2014-02-26 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/02/14 17:29, Ben Finney wrote: > Bob Williams writes: > >> In [3]: print metadata["artist"] [u'The Incredible String Band'] >> >> I now want to pass that string to another program, but I want to &

Re: [Tutor] os.symlink can't find target

2014-02-26 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/02/14 15:41, Bob Williams wrote: On 26/02/14 05:31, Cameron Simpson wrote: >>> linkName1 = pathList[j][0:-3] + "mp3" >>> >>> Isn't this exactly the same as pathList[j] ? >>> > Actually

Re: [Tutor] improvements on a renaming script

2014-03-09 Thread bob gailer
On 3/9/2014 3:22 PM, street.swee...@mailworks.org wrote: Hello all, A bit of background, I had some slides scanned and a 3-character slice of the file name indicates what roll of film it was. This is recorded in a tab-separated file called fileNames.tab. Its content looks something like: p01

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread bob gailer
On 3/19/2014 8:19 AM, Toni Fuente wrote: Hello everyone, I am stack with a problem that I can't find a solution: I need to create a sqlite schema dynamically, I've got a dictionary with text keys: "RedHat", "CentOS", "SLES9",..., "etc", "etc" My intention was at the time of creating the table

Re: [Tutor] Slices of lists of lists

2014-03-28 Thread Bob Williams
My first > guess was that standard slice notation on the first index would do it, > but it doesn't! Instead, we get the rows again: > > In [6]: l[:][0] > Out[6]: [11, 12, 13] > > In [7]: l[:][1] > Out[7]: [21, 22, 23] > Jose, Just for clarity, are you trying to acces

[Tutor] Vending machine problem.

2014-04-01 Thread bob gailer
I'm posting this to include you in this conversation. Recently I got the following Request: can you write me a code in python please or if you have one already my response: print('hello world') what more can I do for you? (next two lines are best guesses as I can't find the relevant emails.

[Tutor] Vending machine problem.

2014-04-01 Thread bob gailer
On 4/1/2014 3:26 AM, Sebastien Gomez wrote: The vending machine must have 5 prices with items it should accept 10p, 20p 50p and £1 coins it should allow the user to purchase a item and give him a choice of purchasing something else. it should display the remaining credit once the item is purcha

Re: [Tutor] Vending machine problem.

2014-04-02 Thread bob gailer
On 4/1/2014 5:09 PM, Sebastien Gomez wrote: I have started my code but there are some errors including indentation and syntax, please fix it if you can: Did you miss my request that you send a copy to the tutor list (tutor@python.org)? Were there any more specifications in the assignment? P

Re: [Tutor] Vending machine problem.

2014-04-02 Thread bob gailer
On 4/2/2014 5:06 PM, Sebastien Gomez wrote: i am using python 3.2 windows vista This is my last email to you. Communicating with you is way too time consuming; you consistently do not provide all the information I request, nor do you include the tutor list in your responses. If you want any

Re: [Tutor] difference between expressions and statements

2014-04-10 Thread bob gailer
Caveat: I began this before there were any other responses. So this may be overkill - but I ike to be thorough. On 4/9/2014 12:49 PM, Jared Nielsen wrote: Hi Pythons, Could someone explain the difference between expressions and statements? I know that expressions are statements that produce a

Re: [Tutor] difference between expressions and statements

2014-04-10 Thread bob gailer
On 4/10/2014 5:48 PM, Jared Nielsen wrote: Thanks for the thorough answer, Bob. I now understand the difference. Thanks for the ACK. It helps me remember I have something to contribute. ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Range within a range

2014-04-11 Thread bob gailer
On 4/11/2014 1:13 PM, Andoni Gorostiza wrote: Hi tutor. I need your help with something I don't understand. In the tutorial, it mentions an example of a range within a range. I'll keep it simplified. How exactly does this work? I'll provide a few examples. >>> for x in range(0,5): ...for n in

Re: [Tutor] Refining Code

2014-04-11 Thread bob gailer
On 4/10/2014 6:26 PM, Saba Usmani wrote: My task is : Welcome to the tutor list. In what school are you learning Python? What version of Python? What operating system? What do you use to write and run your code? What Python elements have you studied so far? Your code can be greatly simpli

Re: [Tutor] Python & algorithms (Lang line simplification algorithm)

2014-04-14 Thread bob gailer
On 4/14/2014 11:30 AM, Laura Kauria wrote: Thanks a lot for all the help! I got the courage to start at least.. Some requests regarding posts. 1) put your comments following the relevant text rather than at the top. 2) delete old (irrelevant) text. 4) be more clear with your questions. I star

Re: [Tutor] Why should modules or packages should define their own domain-specific base exception class?

2014-04-14 Thread bob gailer
On 4/14/2014 10:09 PM, brian arb wrote: I don't quite understand why the google python style guide recommends that packages and modules we write should avoid using the catch-all except. Instead the guide encourages you to write domain specific exception classes. class Error(Exception): """.

[Tutor] Logical error?

2014-05-02 Thread Bob Williams
ests that the first 'if' clause (matching the first 10 characters of the last line) is satisfied, but the second one isn't, as the flow jumps to the second 'else' clause. As the script runs without complaint, this is presumably a logical error rather than a syntax error,

Re: [Tutor] Logical error?

2014-05-03 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Steven, On 03/05/14 02:53, Steven D'Aprano wrote: > Hi Bob, and welcome! > > My responses interleaved with yours, below. > > On Fri, May 02, 2014 at 11:19:26PM +0100, Bob Williams wrote: >> -BEGIN PGP SIGNED MESSAGE

Re: [Tutor] code review

2014-06-11 Thread Bob Williams
benefit. Others can ignore the thread if they wish. Bob - -- Bob Williams System: Linux 3.11.10-11-desktop Distro: openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.1 Uptime: 06:00am up 3 days 11:36, 3 users, load average: 0.05, 0.03, 0.05 -BEGIN PGP SIGNATURE- Version:

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Bob Williams
ge, ShowMeDo etc. > > But I thought the tutor list readers might be an interesting source > of alternatives that I hadn't thought of, or even heard of. > > All contributions considered :-) > Python Module of the Week <http://pymotw.com/2/> Bob - -- Bob Williams System: L

[Tutor] subprocess.call not formatting date

2014-07-08 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm using Python 2.7.6 on an openSUSE linux system. I'm trying to convert a shell (bash) script to a python script, and everything's worked OK except this. The following line in the shell script btrfs subvolume snapshot /home/bob/A3/

Re: [Tutor] subprocess.call not formatting date

2014-07-08 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/07/14 18:12, Peter Otten wrote: > I suggest that you calculate the folder name in Python instead: > > # untested name = > datetime.datetime.now().strftime("%y-%m-%d_%H-%M") destpath = > os.path.join(&quo

Re: [Tutor] Printing a list count - Help

2014-08-30 Thread boB Stepp
+ 1 > if grades == "A" or grades == "B": > print honor_roll_count > Are you sure you have your increment of honor_roll_count where you want it? As it is placed you are counting how many grades of any kind there are. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread boB Stepp
13), so I don't > really know any good options. > Sublime Text is still being developed by its creator. He is just being slow (thorough?) about it. A seemingly stable beta version of Sublime Text 3 is available, and the plugin community is actively developing for it. boB __

Re: [Tutor] usage difference between tabs and spaces

2014-09-09 Thread boB Stepp
just want to point out that most editors have a setting where hitting tab results in spaces being inserted (of the appropriate number) instead of tab characters. Thus you can use your preferred tab key and follow recommended technique! -- boB ___ Tutor

Re: [Tutor] pygame module

2014-10-04 Thread boB Stepp
.edu/~gohlke/pythonlibs/#pygame -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread boB Stepp
t turn up anything that really clicked for me as the way to go. I could not seem to come up with a search string that would bring up what I was really interested in: What are the best practices for organizing plain text data? Thanks! -- boB ___ Tutor ma

Re: [Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread boB Stepp
these off to get to the actual data. But when I implement a data editor later, these labels will be needed (I think.). I just now have located the documentation for python 2.4.4. It does not seem to be as friendly or easy to read as for the current version documentation. But I will persevere...

Re: [Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread boB Stepp
On Wed, Oct 8, 2014 at 11:27 AM, Alan Gauld wrote: > On 08/10/14 16:47, boB Stepp wrote: > >>> It looks like you have csv like data. Except you have a semicolon as >>> a separator. Look at the csv module. That should work for you >>> >> Joel, will

Re: [Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread boB Stepp
for python 2.4? > > [0] https://pypi.python.org/pypi/simplejson/ > [1] > http://stackoverflow.com/questions/712791/what-are-the-differences-between-json-and-simplejson-python-modules > -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-09 Thread boB Stepp
about the order of installation anywhere during my searches, I missed it. Anyway, I hope that my experience helps some other newbie who wants to play around with both major versions. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-10 Thread boB Stepp
On Fri, Oct 10, 2014 at 2:05 AM, Wolfgang Maier wrote: > On 10/10/2014 05:57 AM, boB Stepp wrote: >> >> I am hoping to save other people the grief I just worked through. I >> wanted to run both Python 2 and 3 on my windows PC, and, after >> googling this topic found th

Re: [Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-10 Thread boB Stepp
On Fri, Oct 10, 2014 at 7:43 AM, boB Stepp wrote: > On Fri, Oct 10, 2014 at 2:05 AM, Wolfgang Maier > wrote: >> On 10/10/2014 05:57 AM, boB Stepp wrote: [...] >> >> It would help if you could share details about how you tried to run the >> Python 3 program (c

Re: [Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-10 Thread boB Stepp
On Fri, Oct 10, 2014 at 11:54 PM, Zachary Ware wrote: > On Fri, Oct 10, 2014 at 11:34 PM, boB Stepp wrote: >> I can live with 2.7.8 being the default Python, but if I wanted to >> make 3.4.2 the default, how would I go about doing it? > > Check the output of "ftype

Re: [Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-10 Thread boB Stepp
On Sat, Oct 11, 2014 at 12:24 AM, boB Stepp wrote: > On Fri, Oct 10, 2014 at 11:54 PM, Zachary Ware > wrote: >> On Fri, Oct 10, 2014 at 11:34 PM, boB Stepp wrote: >>> I can live with 2.7.8 being the default Python, but if I wanted to >>> make 3.4.2 the default,

[Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-23 Thread boB Stepp
up for each type of error I wish to catch. Is there such a table or list?​ -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-24 Thread boB Stepp
such a table or list? > > > > Hi Bob, > > You can find the ones used in the Standard Library here: > > https://docs.python.org/3.4/library/exceptions.html > Thanks, Danny. That is exactly what I was looking for. Not being familiar with exception-related vocabulary yet, I was n

Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-24 Thread boB Stepp
On Thu, Oct 23, 2014 at 11:04 PM, Ben Finney wrote: > boB Stepp writes: > [...] > >> I have so far been unable to find a list of these class/subclass >> names. > > The standard library documentation's chapter on exceptions > https://docs.python.org/3/lib

[Tutor] How to store and use passwords?

2014-11-18 Thread boB Stepp
from outside (of our organization) access, though I am fairly confident that with what little I know I could gain access from my home. If I can, then I am sure that someone knowledgeable and skilled would be able to do the same. Suggestions? -- boB ___ Tuto

Re: [Tutor] How to store and use passwords?

2014-11-18 Thread boB Stepp
> The downside is that you need to build a password management > module/workflow/UI into your code to allow changes/resets etc. Another opportunity for furthering my education! Thanks, Alan! -- boB ___ Tutor maillist - Tutor@python.org To unsu

[Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
hat str[-3:-1] returns '789', especially since str[-1] returns '9'. What is the reason for choosing Python's actual behavior? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
elative to which positive and negative indices create identical behaviors. Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
On Mon, Nov 24, 2014 at 1:06 PM, boB Stepp wrote: > On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware > wrote: > [...] >> >> Have I clarified or muddied it for you? :) > > Clarified, I believe, if my following statements are correct: I did > not consider that t

[Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-26 Thread boB Stepp
in Tkinter? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How to change the color of the title bar of the root window in Tkinter?

2014-11-26 Thread boB Stepp
Python 2.4.4 Solaris 10 -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to change the color of the title bar of the root window in Tkinter?

2014-11-26 Thread boB Stepp
On Wed, Nov 26, 2014 at 11:25 AM, Alan Gauld wrote: > On 26/11/14 16:48, boB Stepp wrote: >> >> Python 2.4.4 >> Solaris 10 > > > I can't find anything on this and I suspect that's because > title bar colour is generally part of the user's preferre

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-26 Thread boB Stepp
On Wed, Nov 26, 2014 at 11:23 AM, Alan Gauld wrote: > On 26/11/14 16:46, boB Stepp wrote: > >> I can accomplish this by getting the screen height and width and >> calculating pixel coordinates. But so far I have not found something >> equivalent to anchor = 'CENTE

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-26 Thread boB Stepp
On Wed, Nov 26, 2014 at 11:50 AM, Alan Gauld wrote: > On 26/11/14 17:44, boB Stepp wrote: > [...] > So they can't read email, write reports, browse web sites? > And what if the OS or sysadmin is also trying to catch their eye - maybe > because the server is going down and

Re: [Tutor] How to change the color of the title bar of the root window in Tkinter?

2014-11-26 Thread boB Stepp
On Wed, Nov 26, 2014 at 11:58 AM, Alan Gauld wrote: > On 26/11/14 17:39, boB Stepp wrote: > [...] >> The application I am attempting to write will show up in the >> foreground of our planning software. This planning software has its >> own color scheme, which all

[Tutor] Question about why a list variable is apparently global.

2014-11-26 Thread boB Stepp
h will potentially be large and complex. I have tested this on two different sized monitors where I work and so far it has given the correct results. Third: I am always open to stylistic comments and how to be more pythonic! Fourth: And perhaps this should go into a new thread, I am not sure I underst

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-26 Thread boB Stepp
On Wed, Nov 26, 2014 at 6:20 PM, Steven D'Aprano wrote: > On Wed, Nov 26, 2014 at 05:23:40PM -0600, boB Stepp wrote: [...] >> First question: How can the printLabel() function see the list >> variable, l, defined outside of this function? I thought that >> functions on

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 4:51 AM, Alan Gauld wrote: > On 27/11/14 04:18, boB Stepp wrote: [...] >> So any variables lower in the program are accessible to those above it? > > > No. > Its not whether they are defined above or below each other its the level of > inden

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 4:56 AM, Steven D'Aprano wrote: > On Wed, Nov 26, 2014 at 10:18:55PM -0600, boB Stepp wrote: > >> So any variables lower in the program are accessible to those above it? > > No, that can't be the explanation. Think of this: > > b = a + 1

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 9:33 AM, Steven D'Aprano wrote: > On Thu, Nov 27, 2014 at 09:00:48AM -0600, boB Stepp wrote: [...] > But there is a subtlety that you may not expect: > > py> class Tricky: > ... print(x) > ... x = "inner" > ... print(x

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano wrote: > On Wed, Nov 26, 2014 at 12:25:23PM -0600, boB Stepp wrote: > >> As I am the only person in our >> group with any programming knowledge (weak though it is), this means I >> usually wind up trying to solve issue

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread boB Stepp
On Nov 27, 2014 1:27 PM, "Dave Angel" wrote: > > On 11/27/2014 11:39 AM, boB Stepp wrote: >> >> On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano wrote: > > > > You say you're using some 3rd party package to do the heavy lifting. But you also s

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

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

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

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

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

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

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

[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

[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

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

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

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

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

<    13   14   15   16   17   18   19   20   21   >