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 da...@davea.name wrote: On 11/27/2014 11:39 AM, boB Stepp wrote: On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano st...@pearwood.info wrote: You say you're using some 3rd party package to do the heavy lifting. But you also say there could be as many

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

2014-11-26 Thread boB Stepp
? -- 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 alan.ga...@btinternet.com 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 preferred colour scheme. Even in Windoze

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 alan.ga...@btinternet.com 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 = 'CENTER' that can

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

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 alan.ga...@btinternet.com 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 of us are quite

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

2014-11-26 Thread boB Stepp
into a new thread, I am not sure I understand the full intent and use of Tkinter's Variable class. Any clarification on this would be welcome as well. Thanks in advance! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

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 st...@pearwood.info 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 only had access

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

2014-11-24 Thread boB Stepp
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
relative 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 robertvst...@gmail.com wrote: On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware zachary.ware+py...@gmail.com wrote: [...] Have I clarified or muddied it for you? :) Clarified, I believe, if my following statements are correct: I did not consider

[Tutor] How to store and use passwords?

2014-11-18 Thread boB Stepp
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 ___ Tutor maillist - Tutor

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

2014-11-18 Thread boB Stepp
to. 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 unsubscribe

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

2014-10-24 Thread boB Stepp
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 not typing in the search strings to get me

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 ben+pyt...@benfinney.id.au wrote: boB Stepp robertvst...@gmail.com writes: [...] I have so far been unable to find a list of these class/subclass names. The standard library documentation's chapter on exceptions URL:https://docs.python.org/3

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

2014-10-23 Thread boB Stepp
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] 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 wolfgang.ma...@biologie.uni-freiburg.de 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

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 robertvst...@gmail.com wrote: On Fri, Oct 10, 2014 at 2:05 AM, Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de 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

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 zachary.ware+py...@gmail.com wrote: On Fri, Oct 10, 2014 at 11:34 PM, boB Stepp robertvst...@gmail.com 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

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 robertvst...@gmail.com wrote: On Fri, Oct 10, 2014 at 11:54 PM, Zachary Ware zachary.ware+py...@gmail.com wrote: On Fri, Oct 10, 2014 at 11:34 PM, boB Stepp robertvst...@gmail.com wrote: I can live with 2.7.8 being the default Python, but if I wanted

[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

[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
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 maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org

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
will persevere... -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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 alan.ga...@btinternet.com 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 the labels (like SERIAL_ROI

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
can operate just the same, regardless of which one you used. Is there a typo on [0]? Will it in fact work 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

Re: [Tutor] pygame module

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

Re: [Tutor] usage difference between tabs and spaces

2014-09-09 Thread boB Stepp
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 maillist - Tutor@python.org

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

2014-09-01 Thread boB Stepp
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] Printing a list count - Help

2014-08-30 Thread boB Stepp
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

[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/documents /home

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(/home/bob/A3/docsnaps, name) subprocess.call

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Bob Williams
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: Linux 3.11.10-17-desktop Distro: openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.2 Uptime: 06:00am up 1 day 20:14

Re: [Tutor] code review

2014-06-11 Thread Bob Williams
available can then take a peek. hth One way noobs anywhere can learn is by listening in to other people's conversations - it's called lurking, I believe. So I would say, please do this on the list, and many more people than Adam may benefit. Others can ignore the thread if they wish. Bob - -- Bob

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- Hash: SHA1 Hi, I'm

[Tutor] Logical error?

2014-05-02 Thread Bob Williams
, this is presumably a logical error rather than a syntax error, but I cannot see where I've gone wrong. Bob - -- Bob Williams System: Linux 3.11.10-7-desktop Distro: openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.0 Uptime: 06:00am up 11:26, 4 users, load average: 0.00, 0.02, 0.05 -BEGIN PGP

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

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

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

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

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?

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

[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

[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

Re: [Tutor] Slices of lists of lists

2014-03-28 Thread Bob Williams
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 access a particular *column* in your last example? Bob -- Bob Williams System: Linux 3.11.10-7-desktop Distro: openSUSE 13.1 (x86_64) with KDE Development

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 schema

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] os.symlink can't find target

2014-02-26 Thread Bob Williams
: Hi Bob, [...] The other things are just script remarks, not directly related to your problem: On 24Feb2014 16:07, Bob Williams li...@barrowhillfarm.org.uk wrote: if pathList[j][-3:] == mp3: This is often written (I've inserted a dot, assuming you don't want foomp3, only foo.mp3

[Tutor] Editing values from a dictionary

2014-02-26 Thread Bob Williams
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 string to another program, but I want to strip

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 li...@barrowhillfarm.org.uk 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 strip off the leading [u

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, no. Actually, you are right. I've trimmed down that block now, thank

[Tutor] os.symlink can't find target

2014-02-24 Thread Bob Williams
- %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 in June/1995 Rose Clouds Of Holocaust/10 Lifebooks.mp3

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

2014-02-24 Thread Bob Williams
. 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 Regards Bob - -- Bob Williams System

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 error if the directory that shall contain the new symlink does

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,

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 li...@barrowhillfarm.org.uk 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 final task

Re: [Tutor] Recommendation For A Complete Noob

2014-02-11 Thread Bob Williams
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 Development Platform: 4.12.2 Uptime: 18:00pm up 1 day 22:01, 5 users, load average

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

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

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/blog/2008

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

Re: [Tutor] Automation

2013-11-03 Thread bob gailer
the elements in a list. Apply min() and max() to the list. Use list.index() to get the position of the value in the list. Or write your own program to examine each value, tracking when it gets smaller (bigger) and also tracking the index where that change occurs, -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
str.isalpha() main() Thanks!! :) Carmen -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dictionary from a text file

2013-10-31 Thread bob gailer
rather use sqlite to store the data. Also please give us a use case. There is probably a much simper and more elegant solution. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
are printing out this way. 5 5 5 5 6 Please post the new program. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
the desired output. One is: collect the characters in one list, say numberList Then use slicing to insert the - e.g. numberList[3:3] = - Then print .join(numberList) -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
On 10/31/2013 10:11 AM, Carmen Salcedo wrote: Thanks Bob! :) A list is great idea. I'm just trying to figure out how to print the number across like a phone number 555- instead of downward. I'm stuck on that. I repeat what I said before: There are many ways to get the desired output

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
by the next string in the tuple. Just be sure you have exactly 7 characters in the list or this will fail. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
On 10/31/2013 2:51 PM, Carmen Salcedo wrote: Thanks Bob! :) I'm very new at programming in Python. I appreciate your feedback. Here are some improvements to consider: import string def main(): d = {1 : phoneTranslator, 2 : backwardString} # map user selection to corresponding function

Re: [Tutor] Geometric sequence

2013-10-30 Thread bob gailer
(60)) + 2)] -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python String Help

2013-10-29 Thread bob gailer
in s as in the for loop above, and inside that for loop, count the number of letters that are in s and come before the loop variable ch. You will also need an accumulator to build the permutation the function will return. -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] UnicodeDecodeError while parsing a .csv file.

2013-10-28 Thread bob gailer
with the file. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Want to keep to two decimal places for currency

2013-10-24 Thread bob gailer
On 10/24/2013 2:09 PM, Danny Yoo wrote: Related: I saw a picture the other day on Google+ of an mailing envelope whose zip code was written in scientific notation. That;s odd - since ZIP codes are character, not integer, -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] [OT] Programming practice was: Re: string list in alphabetical!

2013-10-22 Thread bob gailer
struggling with his first Basic program. I recommended he walk thru it line by line, and I demonstrated that technique. Amazed he exclaimed In that much detail?. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] Tutor] string list in alphabetical!

2013-10-21 Thread bob gailer
has an unnecessary statement (input_content = []) IMHO it is more customary and a lot simpler to process the lines in a file thusly: for line in open(file1, 'r'): process the line -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist

Re: [Tutor] Cannot understand object initiation

2013-10-12 Thread bob gailer
object that is an attribute of User. filter_by is a callable object that is an attribute of query. first is a callable object that is an attribute of filter_by. Nothing in the above suggests object creation. HTH -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Parsing Rhino Sightings - Python

2013-10-06 Thread bob gailer
On 10/6/2013 12:11 PM, Mason Majors wrote: Dear Bob, I just came across your email address on the following website: https://mail.python.org/pipermail//tutor/2011-November/087044.html I was wondering, if you were able to provide any help and slove this Pythn coding problem, as I am working

Re: [Tutor] how to generate random numbers in Python

2013-10-03 Thread bob gailer
/tutor -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqlite3 place holder problem

2013-10-03 Thread bob gailer
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Arbitrary-argument set function

2013-10-02 Thread bob gailer
to test things, and the documentation to explain things. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help on class

2013-09-27 Thread bob gailer
. self.emp_name=name self.emp_id=id a=employee() a.show() print() b=employee(test,1003) b.show() print() c=employee() c.show() -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-24 Thread bob gailer
In addition to Alan's comment: Saying it work properly is totally uninformative. Tell us what is happening that you want different. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Field Width

2013-09-19 Thread bob gailer
format specification 9.2f = same meaning as in format() % - format operator (The cost of the carpet is , subtotal) = tuple of values to be formatted. HTH -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] fit data to equation

2013-09-05 Thread bob gailer
), would you advice me on the how to, or tutorial? Curve fitting is not my strength. Perhaps someone else on the list will come to your aid. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] [Python-Help] Please help replace Long place-names with short place-names in many files with Python

2013-09-01 Thread bob gailer
some of the above then come back with questions. Start with something simple - process just one file. Or hire me as a consultant and I will write it for you. [snip] -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org

Re: [Tutor] i need help with the following question

2013-08-26 Thread bob gailer
what you want - but that is not efficient. Better is for you to read the article on how to ask questions, then re-send your question. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

[Tutor] Comment on http://www.catb.org/esr/faqs/smart-questions.html

2013-08-26 Thread bob gailer
Then all the other stuff. With contact names and email at the bottom preceded by a neutrally worded disclaimer. Only those who seek the contact info would need to read that. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor

Re: [Tutor] Comparison Textboxes

2013-08-26 Thread bob gailer
-invent the wheel. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Convert SOAP response (ArrayOfInt) to Python list

2013-07-10 Thread bob gailer
the structure is maintained; the numpy.shape returns (). Huh? Makes no sense to me. Please explain. I assume the following format is a character string. How do you convert characters to integers - hint - int() So try applying int() to each accession number and collecting the results in a list. -- Bob

Re: [Tutor] Error in Game

2013-07-03 Thread bob gailer
return to a main program, have the main program determine the next step and invoke it. Help? Since we are volunteers, the more you tell us the easier it is for us to do that. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor

Re: [Tutor] Help with Python in ArcGIS 10.1!

2013-06-23 Thread bob gailer
expect? Did you hit enter after each line? Did the cursor move to the next line? Did you get another prompt? What did the prompt look like? I think you get the idea - you need to tell us more, since we did not watch you try the above. -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Python and Symbolic Math for beginners

2013-06-16 Thread bob gailer
On 6/15/2013 5:53 AM, Amit Saha wrote: Symbolic math? What is that? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] when is a generator smart?

2013-06-03 Thread bob gailer
On 6/1/2013 11:58 PM, Jim Mooney wrote: squarelist = (c**2 for c in range(x,y) if c%2 != 0) can be simplified to: squarelist = (c**2 for c in range(x,y,2)) as long as x is odd. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist

Re: [Tutor] a little loop

2013-05-29 Thread boB Stepp
and interesting site! I will have to bookmark this one and come back for more exploration. Thanks! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] a little loop

2013-05-29 Thread boB Stepp
On Wed, May 29, 2013 at 11:07 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 29 May 2013 16:38, boB Stepp robertvst...@gmail.com wrote: On Tue, May 28, 2013 at 9:34 PM, Steven D'Aprano st...@pearwood.info wrote: However, a word of warning: although you *can* assemble a new string

Re: [Tutor] challenge-chapter 2

2013-05-24 Thread bob gailer
to give in that category is not a variable name. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-23 Thread boB Stepp
On Wed, May 22, 2013 at 8:47 PM, Steven D'Aprano st...@pearwood.info wrote: On 23/05/13 02:09, boB Stepp wrote: I would like to ask some general questions here. Problems can arise from bugs in the operating system, bugs in the programming language(s) being used, bugs in packages/modules being

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