Re: [Tutor] Lists of duplicates

2017-03-08 Thread boB Stepp
t then it will execute the "append(item)" method on the sublist attached to that key. If it does not find it, then it creates a new key, "item", attaches the empty list, "[]", to that key, and then appends item to that empty list. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Better way to insert items into a list

2012-12-08 Thread bob gailer
uld be done using a list comprehension? I realize I achieved my goal, but I was wondering what other alternates could be done to achieve the same results. a = 'ABCD' c = 'OO' tuple(sum([list(x) for x in zip(a,[c]*len(a))],[])) Th

Re: [Tutor] Recommended texts for self-study to master software engineering?

2012-12-15 Thread boB Stepp
ad done in college was definitely lacking in many recommended software engineering practices. > Object Oriented Analysis and Design > > Programming Pearls (vols 1 & 2) > Thanks, Alan! It does help. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Recommended texts for self-study to master software engineering?

2012-12-15 Thread boB Stepp
do not have any time at all for study. Just reading the posts, which are never onerous in their number each day, constantly teaches. The people on this list go above and beyond in the level of effort they put into their answers to questions. Thanks! boB

Re: [Tutor] Trailing spaces affect output in a way I don't understand.

2012-12-15 Thread boB Stepp
I was still blind to the fact that a \n was staring me in the face. You are one sharp dude! As seem to be just about all of you... Many thanks! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Trailing spaces affect output in a way I don't understand.

2012-12-15 Thread boB Stepp
On Sat, Dec 15, 2012 at 10:55 PM, boB Stepp wrote: > It is funny in retrospect: If I had wanted to create a newline > character I would do the correct thing, but seeing the backslashes as > part of a picture, even after I went into PyScripter's options and > turned on ALL spec

[Tutor] Limitation of int() in converting strings

2012-12-16 Thread boB Stepp
o integers with int() that the string must already be of integer format? What is the rationale for setting up int() in this manner? Thanks as I continue to puzzle over the fine points of the basics... boB ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] Limitation of int() in converting strings

2012-12-16 Thread boB Stepp
nd it's a mistake in the > program -- and therefore python should alert you. > And this is why I asked the question. If this is the rationale, it makes sense--an extra bit of double checking of the programmer's intent. Thanks, boB _

Re: [Tutor] I cant fix this bug

2012-12-18 Thread bob gailer
really don't need a function menu_quad(). You could instead have a variable menu_quad which is assigned the menu, then just print menu_quad. There are many other opportunities to improve and simplify this program. But it is a good start. -- Bob Gailer 919-636-4239 Chapel Hi

[Tutor] Your thoughts on using Python 2.4.x?

2012-12-18 Thread boB Stepp
if I could demonstrate a compelling need, which at this time I would deem highly unlikely. Thanks! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] need help with python for counter

2012-12-19 Thread bob gailer
n number: count = 0 if i == digit: count += 1 Drop next two statements and try agan else: count = 0 print count -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] Your thoughts on using Python 2.4.x?

2012-12-21 Thread boB Stepp
clsh". You should get a % prompt, which you > can quit by entering "exit" command. If you don't, then you do not have > tcl installed and won't have Tkinter either. Thanks for pointing this out and how to check for tcl being installed. I will have to check for this

Re: [Tutor] For Loop Question

2012-12-24 Thread bob gailer
On 12/23/2012 9:02 PM, Alan Gauld wrote: You do realize that self is only defined inside a method? Perhaps. self is just another name - it could be "just" a variable, outside any method. -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] help about to how many times the function called

2013-01-04 Thread bob gailer
PASS" + bcolors.ENDC + " (%.2f s)" % t_elapsed) I for one would appreciate a more complete explanation. -- 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] Vending machine program

2013-01-04 Thread bob gailer
? Did you attempt a design? -- 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] Vending machine program

2013-01-05 Thread bob gailer
On 1/4/2013 8:26 PM, Alan Gauld wrote: On 04/01/13 17:47, bob gailer wrote: > Further selections can be made if there is enough credit. This is confusing. You could drop that line with no ill effect. I am not sure what it even means. It seemed straightforward enough to me Bob. If you put

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread bob gailer
On 1/18/2013 8:03 AM, eryksun wrote: Yes, it's a mistake in the PCA example from the docs: http://mlpy.sourceforge.net/docs/3.5/dim_red.html#principal-component-analysis-pca There seems to be no way to report a bug in that documentation! Or am I missing something? -- Bob Gailer 919-636

[Tutor] how to import our own data sets

2013-01-29 Thread bob gailer
Python uses import to load modules. What are you trying to do? -- 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] HELP-Regarding python

2013-01-30 Thread bob gailer
On 1/30/2013 1:51 AM, Gayathri S wrote: I am sorry that you chose to ignore my request to start a new email with a relevant subject. Please next time do so. The easier you make it for us to help you the more likely we will want to help. -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] regarding the list problem

2013-02-06 Thread bob gailer
http://www.pythontutor.com/visualize.html is very helpful. Enter your code, click Visualize Execution, then click forward. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] binary - denary converter (was Additional help)

2013-02-10 Thread bob gailer
mber of the collection s 5:10 The expression x or y first evaluates x; if x is true, its value is returned; otherwise, y is evaluated and the resulting value is returned. 5:15 for operator precedence Also realize that all you need at the end is: else: print("Invalid input-

Re: [Tutor] Binary Addition

2013-02-13 Thread bob gailer
print("The result is",remainder) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] Binary Addition

2013-02-13 Thread bob gailer
define eight_digit_binary and eight_digit_binary2, as they do the same thing. There is no need to nest these defs inside the loop. You have a lot of other unnecessarily duplicated code. There is no need to say while on == True: It is sufficient to say while on: Your program will never termin

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-14 Thread bob gailer
On 2/14/2013 3:55 PM, Michael McConachie wrote: [snip] I agree with dave angel - the specification is far from clear. please clarify. perhaps a simple example that goes from input to desired output. -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] mysqlite

2013-03-06 Thread bob gailer
LE session. i reopened another session and simply did import sqlite3 cxn = sqlite3.connect('sqlite_test/test') cur = cxn.cursor() You are missing cur.execute('SELECT * from users') for user in cur.fetchall(): print(

[Tutor] Problem with Fibonacci example

2013-03-10 Thread bob gailer
On 3/10/2013 3:06 AM, bessenkphilip wrote: Hello Bob, Hi. When you have a Python question that is not related to Python Pipelines I suggest you send it to the tutor group.I and others will see it and you will get faster help. While trying one Fibonacci example in tutorial, i'm having

Re: [Tutor] Designing a program (File-Fetcher)

2013-03-15 Thread bob gailer
eak, it throws alot of erros but it works, it happens to others using it too. Can't address this as I apparently don't have the correct executable. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] Starting a simple python project

2013-03-22 Thread bob gailer
com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- 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] A Text Adventure Problem

2013-03-24 Thread bob gailer
s is a list with one element, consisting of one string or 244 characters. print quips[randint(0, len(quips)-1)] will always print the entire string. Perhaps you meant to put a comma at the end of each line? HTH and good luck. -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] A Text Adventure Problem

2013-03-24 Thread bob gailer
ot;, "You've died and left your comrades to fend for themselves. Douche", "Your whole group dies because of you. Douche.", "You've got terrible planning skills, and ruined the teams chances of survival. Douche."] ente

Re: [Tutor] A Text Adventure Problem

2013-03-24 Thread bob gailer
ment, consisting of one string or 244 characters. print quips[randint(0, len(quips)-1)] will always print the entire string. Perhaps you meant to put a comma at the end of each line? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maill

Re: [Tutor] Reading Program

2013-04-08 Thread bob gailer
eat for each word in the list repeat for each line in the file. Then take a look at the various GUI packages that have a Python version. tkinter comes with the Python distribution. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist -

Re: [Tutor] Reading Program

2013-04-10 Thread bob gailer
n the Python Shell (display the words with a time delay) >>> txt = open("test1.txt") >>> for word in txt.read().split(): print(word) time.sleep(.4) now press enter again and you should see the words appear with a 0.4 second delay. Hop

Re: [Tutor] Processing Linux command line output

2013-04-24 Thread bob gailer
ution? -- 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

[Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-24 Thread boB Stepp
at is your name?") playerName = input() ...everything works fine from IDLE. However, in the Windows command prompt: E:\Programs\Python\IYOCGwPy\Ch4>python -V Python 3.3.1 E:\Programs\Python\IYOCGwPy\Ch4>guess.py Hello! What is your name? boB Traceback (most recent call last): File &qu

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread boB Stepp
y intent is to use Python 3.3. I was aware that if I were using 2.x, that I should be using raw_input(); however, I was not aware of any security implications. Thank you for that info! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread boB Stepp
Hi Steve, > >> E:\Programs\Python\IYOCGwPy\Ch4>guess.py > > Here you are telling Windows to look up the file association for .py files. > It locates some program, and runs it with guess.py as the argument. Looking > at the result: > >> Hello! What is your name?

Re: [Tutor] Runs in IDLE with F5, but not in Windows Command Prompt

2013-04-25 Thread boB Stepp
On Thu, Apr 25, 2013 at 8:45 AM, Marc Tompkins wrote: > On Thu, Apr 25, 2013 at 5:40 AM, boB Stepp wrote: > Remember that input(), in Python 2, executes what's passed to it. If your > input is boB, then Python tries to execute the statement boB - and unless > you've

Re: [Tutor] cant autoincrement

2013-04-26 Thread bob gailer
ite.org:8080/cgi-bin/mailman/listinfo/sqlite-users - as this is the preferred place to ask sqlite questions. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread bob gailer
ine 1, in TypeError: float() argument must be a string or a number How can I fix this. Examine the argument to float. Ensure it is a string or a number. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscrib

[Tutor] Helpful little book

2013-04-28 Thread boB Stepp
knew them then. HTH, boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-28 Thread boB Stepp
en knowing how to swim, but this approach has yielded many valuable Perl scripts at work, so I am willing to take this plunge willy-nilly! Any thoughts on how to approach this will, as always, be greatly appreciated! Cheers! boB ___ Tutor maillist

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-28 Thread boB Stepp
On Sun, Apr 28, 2013 at 7:47 PM, Steven D'Aprano wrote: > On 29/04/13 06:05, boB Stepp wrote: >> >> At work I use a commercial program for radiation therapy planning. >> This program has an extensive built-in, proprietary scripting language >> that is accessible t

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-28 Thread boB Stepp
d build the > classes. But there are lots of OOP GUI frameworks to use as a starter for > your heirarchy... > > FWIW What I've suggested is quite similar to how the earliest Windows > programs were built with a data resource file defining the look and a code > file defining th

Re: [Tutor] Helpful little book

2013-04-29 Thread boB Stepp
On Mon, Apr 29, 2013 at 4:16 AM, Alan Gauld wrote: > On 28/04/13 20:03, boB Stepp wrote: >> >> I have found the following book quite helpful and keep it handy: >> >> "Python Pocket Reference" by Mark Lutz, 4th ed., c. 2010. >> > > I have an earlie

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-29 Thread boB Stepp
of the called script?(via a file maybe?) > In the Pinnacle environment all variables are global for the opened plan that first started running a HotScript. So if we had the variable, "Store.At.TempVariable.String", then it would maintain the most recent value for the most rece

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-29 Thread boB Stepp
On Mon, Apr 29, 2013 at 4:08 AM, Alan Gauld wrote: > On 29/04/13 03:57, boB Stepp wrote: > [Major snip] > >> Unfortunately in most instances the window would have to be generated >> at runtime. > > > The whole window? Or just a panel within it? > If its only fo

[Tutor] New book: Data Structures and Algorithms in Python. Opinions?

2013-04-30 Thread boB Stepp
Java with essentially the same title and can tell me if I have made a good purchase or not. This is a topic I need to look into at some point and, if nothing else, it is another Python-based book! Cheers! boB ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] Continuation of long lines of string characters

2013-04-30 Thread boB Stepp
up the string literal into multiple parts separated by + and break after the + . This seems to use Python's built-in line continuation of anything between parens. Is this the preferred way to do this? Thanks! boB ___ Tutor maillist - Tutor@python.o

Re: [Tutor] Continuation of long lines of string characters

2013-04-30 Thread boB Stepp
'multiple parts separated by + and break after the + > . This seems to' >'use Python\'s built-in line continuation of anything > between parens. Is' >'this the preferred way to do thi

Re: [Tutor] Using graphics

2013-05-05 Thread boB Stepp
es Tkinter to create a new window, you shouldn't run a livewires program from IDLE..." The only other thing that I can think of is that you may not be importing all of the needed modules. Check your code with the author's carefully to see that you have done so. HTH, boB __

[Tutor] Clear screen questions

2013-05-05 Thread boB Stepp
it did not clear the screen, but it did do something unexpected that I would like to understand. Upon hitting the clear screen code the active window switched from the Python shell window to the Python edit window. Why is this so? As always thanks! boB ___ Tu

Re: [Tutor] Clear screen questions

2013-05-05 Thread boB Stepp
On Sun, May 5, 2013 at 7:54 PM, Steven D'Aprano wrote: > On 06/05/13 10:17, boB Stepp wrote: >> [...] > > But even on Windows that will not work, if you are running under IDLE. And > unfortunately there is no official way to tell if you are running under > IDLE, or any

Re: [Tutor] Making a Primary Number List generator

2013-05-12 Thread boB Stepp
n clarifications of technical points that I had puzzled over in my other texts oriented at adults. If nothing else, the OP could find one of these, skim through it to get the true basics, and then go back to another, more "adult" source. Cheers! boB ___

Re: [Tutor] Python Idle Crashing

2013-05-17 Thread bob gailer
On 5/16/2013 8:49 PM, Alan Gauld wrote: don't run programs on real data using IDLE. IDLE is for developing programs not running them. That is really scary. Why do you say that? The IDLE documentation does NOT say that! -- Bob Gailer 919-636-4239 Chapel Hi

[Tutor] Fwd: spyder

2013-05-19 Thread bob gailer
Original Message Subject:spyder Date: Sat, 18 May 2013 19:20:12 -0400 From: bob gailer To: ricar...@gmail.com Following your recommendation I installed spyder using the Windows installer. Now what do I do to run it. I found no useful guidance in the online

Re: [Tutor] Random Number Game: Returns always the same number - why?

2013-05-20 Thread boB Stepp
er = random.randint(1, 100) > > while Count <= 100: > print (Random_Number) > > Count = Count + 1 > Your variable assignment for Random_Number is outside of your while loop. Therefore its value never changes. Put it inside the while loop just before the print statemen

[Tutor] Configuring Emacs for Python development?

2013-05-21 Thread boB Stepp
kground or experience to judge which would work best for me. Additionally this latest version of Emacs apparently has made some improvements to the Python.el mode and it is not clear to me what suggestions will or will not work with this. Anyone care to help me with this? As always, t

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

2013-05-22 Thread boB Stepp
ove referring strictly to while you are still debugging the program? Or do the above comments that I asked for clarification refer to the finished product? Thanks! boB ___ 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-22 Thread boB Stepp
t to be correct and bug-free. c) I should make sure I do NOT try to catch errors just to keep the program running from things I failed to anticipate (Probably from being a novice programmer!). So the conclusion I am drawing is that I WANT my program to crash if something I did not anticipate/plan

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

2013-05-22 Thread boB Stepp
Thanks, Steve, for your last two posts. You have made things much clearer for me. On Wed, May 22, 2013 at 9:49 AM, Steven D'Aprano wrote: > On 22/05/13 23:37, boB Stepp wrote: >> >> On Wed, May 22, 2013 at 8:07 AM, Steven D'Aprano >> wrote: >>> [...

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

2013-05-22 Thread boB Stepp
On Wed, May 22, 2013 at 9:45 AM, Steven D'Aprano wrote: > On 22/05/13 23:31, boB Stepp wrote: >> >> On Wed, May 22, 2013 at 7:50 AM, Steven D'Aprano >> wrote: [...] >>> 3) your job as a programmer is *not* to stop your program from raising an &g

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

Re: [Tutor] Presenting text in different ways by using quotes!

2013-05-23 Thread boB Stepp
done. You just have to play around with the spacing, both horizontally and vertically. HTH, boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Difference between types

2013-05-23 Thread boB Stepp
the type itself inside > which one can put any character, setting it as type str? > I asked a similar question a while back. Here is a link to my original question in the ActiveState Tutor archives: http://code.activestate.com/lists/python-tutor/91223/ If you look at the bottom it shows

Re: [Tutor] challenge-chapter 2

2013-05-24 Thread bob gailer
pt 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] a little loop

2013-05-29 Thread boB Stepp
e the details? BTW, interesting article 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 wrote: > On 29 May 2013 16:38, boB Stepp wrote: >> On Tue, May 28, 2013 at 9:34 PM, Steven D'Aprano wrote: >>> >>> However, a word of warning: although you *can* assemble a new string >>> character by cha

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] 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] Help with Python in ArcGIS 10.1!

2013-06-23 Thread bob gailer
pt or Python shell? but nothing happened. What did you 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

Re: [Tutor] Error in Game

2013-07-03 Thread bob gailer
s not a good idea to use recursion to navigate a game structure. It is better to have each function 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 Ga

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

2013-07-10 Thread bob gailer
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

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
more detail about "how to ask good questions" 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 _

Re: [Tutor] Comparison Textboxes

2013-08-26 Thread bob gailer
f and retrieve the results. There is NO need to re-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] [Python-Help] Please help replace Long place-names with short place-names in many files with Python

2013-09-01 Thread bob gailer
to do 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.o

[Tutor] fit data to equation

2013-09-05 Thread bob gailer
ation, y=a+b*exp(k*x), 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 u

Re: [Tutor] Field Width

2013-09-19 Thread bob gailer
tal)) % start of first format specification - = left justify 30 = field length %s = treat value as string $ = itself % start of seconb format specification 9.2f = same meaning as in format() % - format operator ("The cost of the carpet is ", subtotal) = tuple of values to be formatted.

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 unsubs

Re: [Tutor] Help on class

2013-09-27 Thread bob gailer
how() > print("----") > b=employee("test",1003) > b.show() > print("") > c=employee() > c.show() -- 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] Arbitrary-argument set function

2013-10-02 Thread bob gailer
at each step or "desk check" it - pretend you are the computer and go step by step, making sure you know what each line does. No guessing. You always have the interactive prompt 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] how to generate random numbers in Python

2013-10-03 Thread bob gailer
org/mailman/listinfo/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
nyone spot what should be changed? Try: directive = "INSERT INTO %s VALUES (?,?,?,?,?,?,?);" % (Table, ) (Python 2.7 on Ubuntu ) Thanks in advance. Alex ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mai

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] Cannot understand object initiation

2013-10-12 Thread bob gailer
a callable 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 Chap

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

2013-10-21 Thread bob gailer
rily complex and somewhat hard to read. Especially for a rank beginner (the OP) Also 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

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

2013-10-22 Thread bob gailer
ations. I recall one student 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 __

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] UnicodeDecodeError while parsing a .csv file.

2013-10-28 Thread bob gailer
byte"and therefore a continuation byte was expected but where the 0xe9was found. BTWhen I divide 1173 by 126 I get something close to 9 characters per lne. That is not possible, as there would have to be at least 16 characters in each line. Best you send us at least the first 130 lines so we can play 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] Python String Help

2013-10-29 Thread bob gailer
nts that tell me "You may want to iterate over the letters ch 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 t

Re: [Tutor] Geometric sequence

2013-10-30 Thread bob gailer
On 10/30/2013 1:08 PM, Peter O'Doherty wrote: Hi List, I know a geometric sequence can be produced by: series = [2**x for x in range(7)] But I would like to curtail the sequence before the last element excedes a certain value. import itertools series = [2**x for x in itertools.takewhile(lamb

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

2013-10-31 Thread bob gailer
" > elif n == "J" or n == "K" or n == "L": > n = 5 > elif n == "M" or n == "N" or n == "O": > n = 6 > elif n == "P" or n == "Q" o

Re: [Tutor] Dictionary from a text file

2013-10-31 Thread bob gailer
x27;Patch_501', 'release' : '13/09/11' }, 'ESXi500-20001' : { 'call' : Patch, 'name' :'ExpressPatch501', 'release' : '13/09/11' }, }, }, [snip] Does it have to be in a dictionary format? I'd rather use sq

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

2013-10-31 Thread bob gailer
inting 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
ot;L": n = 5 all the numbers should be characters e.g. n = "5" etc. There are many ways to get the desired output. One is: collect the characters in one list, say numberList Then use slicing to insert the "-" e.g. numberList[3:3] = "-&

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 desi

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

2013-10-31 Thread bob gailer
rmatting. Each %s is replaced 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 subscri

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 s

Re: [Tutor] Automation

2013-11-03 Thread bob gailer
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

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