Re: [Tutor] Algorithm for sequence matching

2011-07-02 Thread bob gailer
a dummy like me can understand. Also tell us what you tried and how it failed. -- 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 editor for Ipad

2011-07-21 Thread bob gailer
. -- 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] Stack problem usind Python2.6

2011-07-21 Thread bob gailer
e should be true (() returns False which is correct I can't find the error please help me What do you tkink matches returns, and why? Therein is the problem. Also FWIW you import Stack them redefine it. Why? -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] List problem

2011-07-24 Thread bob gailer
o do the append method to fix it? -- Dave Merrick merrick...@gmail.com <mailto:merrick...@gmail.com> Ph 03 3423 121 Cell 027 3089 169 _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/lis

Re: [Tutor] How do I learn python for web development

2011-07-31 Thread bob gailer
of the worst things you can do in an application. If the message isn't important enough to require it to stay visible until the user explicitly closes it, then it shouldn't go into a dialog in the first place. -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] Accessing Specific Dictionary items

2011-08-01 Thread bob gailer
'Schenectady', 'region_name': 'NY', 'area_code': 518}, {'city': 'Athens', 'region_name': '35'}] IMHO this is overkill. Consider instead using City-Region as the key and storing the pther attributes in a tuple. There

Re: [Tutor] Indexing a list with nested tuples

2011-08-02 Thread bob gailer
tain selection from the user. What Why did you expect to be able to alter the value of a tuple element? Tuples are immutable! Use a list instead. HTH -- 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] Indexing a list with nested tuples

2011-08-03 Thread bob gailer
for one of the 4 strings, strength, health, wisdom, or dexterity). DON'T USE TUPLES. WHY DO YOU INSIST ON THEM? What does the error message( unsupported operand type(s) for -: 'str' and 'int') tell you? Why would selection be a string rather than an in

Re: [Tutor] Better way to compare values?

2011-08-28 Thread bob gailer
if a + b == 10: #print('Si!') return(True) else: #print('Nein!') return(False) makes10(10,9) #makes10(9,9) #makes10(1,9) In particular, the 'if (a == 10) or (b == 10): line... is there a shorter/more compact/more correct (i.e. pythonic) way o

[Tutor] Fwd: Re: largest palindrome number

2011-08-30 Thread bob gailer
Original Message Subject:Re: [Tutor] largest palindrome number Date: Tue, 30 Aug 2011 23:24:09 +0530 From: surya k To: bob gailer Mr Gailer, That's an amazing way of writing palindrome function. Actually, I'm still using my old C logic's he

Re: [Tutor] meaning of % in: if n % x == 0:

2011-08-31 Thread bob gailer
% is not remainder - it is modulo. Difference shows up when left agument is negative. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] paper scissors

2011-09-22 Thread bob gailer
beats " + computer wins += 1 # simpler than wins = wins + 1 else: print "You lose! " + computer + " beats " + player loses +=1 print """Game Summary Wins: %s Loses:" %s""" % (wins,loses)

Re: [Tutor] paper scissors

2011-09-23 Thread bob gailer
es) Any explanation you have would be helpful. Thanks for taking the time to help the newbie! Joey On Thu, Sep 22, 2011 at 6:35 PM, bob gailer <mailto:bgai...@gmail.com>> wrote: On 9/22/2011 1:04 PM, Joseph Shakespeare wrote: Hello, Hi - please use a meaningful subjec

Re: [Tutor] raw_input() slice list

2011-09-27 Thread bob gailer
.8,0.8 cax = plt.axes([l+w+0.025, b, 0.025, h], ) cbar=plt.colorbar(CS, cax=cax, drawedges=True) #save map as *.png and plot netcdf file

Re: [Tutor] String switch

2011-10-02 Thread bob gailer
quot;" and ''' and that \" and \' are escaped and therefore not delimiters. Write a program that attempts to meet these requirements, show it to us, tell us that is succeeds or where it fails and let's go from there. -- Bob Gailer 919-636-4239 Chapel Hill NC _

Re: [Tutor] Can't figure out the syntax error!

2011-10-03 Thread bob gailer
ook me", tries, "tries. Can you beat me?") input("\n\nPress enter key to exit.") ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- Bob Gaile

Re: [Tutor] Tables

2011-10-03 Thread bob gailer
ussion and work with help. -- 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] arrary stastic

2011-10-04 Thread bob gailer
{'E': [1]}) (1, '-', {'E': [2]}) (2, '-', {'E': [2]}) which is not what you want! As requested before, show us the output you do want. Not a description but the actual output. -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] String switch

2011-10-04 Thread bob gailer
execute it? The more detailled and explicit you are the easier it is to help you. -- 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] extract information from txtfile

2011-10-05 Thread bob gailer
gives you grief then tackle it one task at a time. For example, open, read, print, close a file. Then add another level of complication, for example open, read, split, print, close a file. The part that makes no sense to me is score = OS.system(str). What will str be and what do

Re: [Tutor] String switch

2011-10-05 Thread bob gailer
On 10/5/2011 5:51 PM, Christopher King wrote: There is a program that will open another program, write code at the top of the program. The code at the top will cause the program to print all strings afterwards in swap case. Please provide a sample program that you wish to modify. -- Bob

Re: [Tutor] String switch

2011-10-06 Thread bob gailer
x27;t do this with Python 2, as print is a statement and can't be redefined. You could alter the program - find all occurrences of "print" used as a statement, and replace them with a function call. So print "asdf" would become swapprint("asdf") and at the to

Re: [Tutor] Help!

2011-10-07 Thread bob gailer
uot; beats " + computer wins += 1 # simpler than wins = wins + 1 else: print "You lose! " + computer + " beats " + player loses +=1 print """Game Summary Wins: %s Loses:" %s""" % (wins,loses) # u

Re: [Tutor] Runtime error while Test data creation

2011-10-07 Thread bob gailer
bership_pkg_option_id, membership_status_id, membership_source_id, src_input_channel_id, src_market_id, person_id_ref, membership_id, member_start_dt, current_term_start_dt, started_as_trial, created_by, modified_by, create_dt, modified_dt, enterprise_person_id) values (?,?,?,?,?,?,?,?,?,?,?,?

Re: [Tutor] Runtime error while Test data creation

2011-10-07 Thread bob gailer
see if the program runs to completion. On Fri, Oct 7, 2011 at 1:35 PM, bob gailer <mailto:bgai...@gmail.com>> wrote: On 10/7/2011 2:19 PM, Guess?!? wrote: Hello all, I am trying to create some test data for a search module that I am building. Since I dont wa

Re: [Tutor] Runtime error while Test data creation

2011-10-07 Thread bob gailer
modified_dt, enterprise_person_id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", record) conn.commit() i = i + 1 c.close() ___________ Tutor maillist -Tutor@python.org <mailto:Tutor@python.org> To unsubsc

Re: [Tutor] START-UP PROJECT

2011-10-08 Thread bob gailer
publibfp.dhe.ibm.com/epubs/pdf/dfsc4a01.pdf. Chapter 1 is a good starting place. There are references to mainframe-specific stuff that you may safely ignore. If this inspires you or not, let me know. I would enjoy some partnership working on this. -- Bob Gail

Re: [Tutor] Python coding help

2011-10-09 Thread bob gailer
. They "test" f2c. The test code is complicated by the use of % for formatting. You might be better off doing it this way to avoid the complication of learning % formatting. t = 212 print "f2(" + t +") = " + f2c(t) + " expected: 100" Now you are to

Re: [Tutor] Generic For Loop

2011-10-12 Thread bob gailer
lt; 11: i += 1 loop body Your choice - that's all know of - and the for is easier to read and write than the while. -- 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] Windows vs Linux processing speed.

2011-10-14 Thread bob gailer
;)):pass print time.time() - start HTH -- 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] Socket and Ports

2011-10-16 Thread bob gailer
wait to receive data. All the socket software (Python or other) does is receive a string. What you do with it is up to you. If you apply eval or exec to it than anything could happen. No one can IMHO cause any action via socket. [snip] -- Bob Gailer 919-636-4239

Re: [Tutor] A better way to estimate the value of Pi?

2011-10-17 Thread bob gailer
too small to convert to float, raising an overflow exception. Allof this raises the question - what computer algorithms successively approximate pi exactly? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tuto

Re: [Tutor] close failed in file object destructor:

2011-10-18 Thread bob gailer
to monitor progress how about addind something so you know which print statement was called. Perhaps print "I am here 1", print "I am here 2", etc. Why have the file at all? Why not just start with c = range(1,1000)? -- 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] close failed in file object destructor:

2011-10-18 Thread bob gailer
One more thing - tlock = thread.allocate_lock() should be executed once before starting threads. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] close failed in file object destructor:

2011-10-19 Thread bob gailer
etc. * Why have the file at all? Why not just start with c = range(1,1000)? * Why print the entire list? (print c)? -- 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] close failed in file object destructor:

2011-10-19 Thread bob gailer
know the complete program ...just give me some time .. On 10/19/2011 10:35 PM, bob gailer wrote: On 10/19/2011 11:50 AM, Navneet wrote: Thank you Bob and Dave, Yes the file is as you expected, I don't understand that comment. I thought it is easy to figure out that you have to ch

Re: [Tutor] how to unique the string

2011-10-22 Thread bob gailer
On 10/22/2011 12:09 PM, lina wrote: Hi, I googled for a while, but failed to find the perfect answer, for a string ['85CUR', '85CUR'] how can I unique it as: ['85CUR'] Try set(['85CUR', '85CUR

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-24 Thread bob gailer
h that subsequent calls have different behavior. All of these could be done differently, but reassigning methods makes the most sense to me. -- 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] How to print corresponding keys in Dictionary

2011-10-24 Thread bob gailer
dictionary. This will fail (as any other reverse dictionary approach will) if the values are not hashable -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] changing dictionary to lowercase

2011-10-27 Thread bob gailer
some confusion both in the question and the proposed solutions regarding "lowercase". Re your e.g. - is that the original or the result? It's best to show both. I have to assume that your e.g. is the original since it contains upper case letters. Do you want to change the case o

Re: [Tutor] changing dictionary to lowercase

2011-10-28 Thread bob gailer
, at 22:49, bob gailer <mailto:bgai...@gmail.com>> wrote: On 10/27/2011 2:25 PM, ADRIAN KELLY wrote: Hi all, is it possible to change a dictionary list to lowercase..without having to retype? e.g. definitions={"Deprecated": "No longer in use", "Deprecia

Re: [Tutor] Tutor Digest, Vol 92, Issue 128

2011-10-31 Thread bob gailer
- 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://ma

Re: [Tutor] My program gives no output (was (no subject)

2011-11-11 Thread bob gailer
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 s

Re: [Tutor] list of objects?

2011-11-15 Thread bob gailer
lay the last card in each pile: for pile in piles: print values[pile[-1]], What will your actual display look llike? Will you completely reprint it after each move, or alter it in place? How will you get the moves from the player? -- Bob Gailer 919-636

Re: [Tutor] list of objects?

2011-11-16 Thread bob gailer
e B and put it on pile H. -------- *From:* bob gailer *To:* Elwin Estle *Cc:* "tutor@python.org" *Sent:* Tuesday, November 15, 2011 9:18 PM *Subject:* Re: [Tutor] list of objects? On 11/15/2011 8:40 AM, Elwin Estle wrote: I am attempting to write a text based spider solitaire

Re: [Tutor] Encoding

2011-11-17 Thread bob gailer
characters to be encoded ?? Your question makes no sense to me. Please explain what you mean by encoding letters? An example of input and output might also help. Be sure to reply-all. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist

Re: [Tutor] Guess my number game

2011-11-19 Thread bob gailer
. [snip] Another way of saying that is: Translate those parts of the pseudocode to Python that you can. Tell us where you are stuck. The book certainly gives you enough information to do that. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist

Re: [Tutor] Python 3 dictionary questions

2011-11-23 Thread bob gailer
d your first question. Dictionaries do not have duplicate keys. Your 2nd assignment using the key "Elway" replaced the first. 2) Is there a way to print out the actual value of the key, like Montana would be 0, Tarkington would be 1, etc? Actual value? The actual value of Montana" is "Montana". Sounds like you want the index of the entry as though it were in a list. Dictionaries are not ordered so you can't get that unless you store it as part of the value. -- 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] Random order program

2011-11-27 Thread bob gailer
the desired result. In theory the loop could run for a long time, as you could get an arbitrarily long run of words that are already in the random_word_list. How could you fix that? There are any number of ways to simplify and improve the program. Are you interested in hearing about them?

Re: [Tutor] How to handle conjunction operators

2011-11-27 Thread bob gailer
= name[1:] What I want here is.. If the name starts with 'm' or 'f' or 'b', The first letter should be removed. But this isn't happening here. Hugh answered your question. PLEASE in future post in plain text rather than HTML. -- Bob Gailer 919-636-423

Re: [Tutor] How to handle conjunction operators

2011-11-27 Thread bob gailer
"m" or "f" or "b" gets evaluated first. The result is "m" (the first non-false value) then name[0] == "m" gets evaluated, which may be true or false. the shortest way is name[0] in "mfb" -- 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] Parsing

2011-11-27 Thread bob gailer
ex.X = lonValue vertex.Y = latValue vertexArray.add(vertex) polylineArray.add(currentPoint) cursor = arcpy.InsertCursor(shapefile) row = cursor.newRow() row.Shape = vertexArray cursor.insertRow(row) del cursor _______ Tutor maillist - Tut

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread bob gailer
[1] to access that index When passing to a function, you do this: findindex(*b) ___________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- Bob Gailer 919-636

Re: [Tutor] Coin game

2011-11-28 Thread bob gailer
osses = ''.join(random.choice("HT") for i in range (N)) w = min(tosses.find("TTT") % N + 1,tosses.find("HHH") % N + 1) if w == N: print 'no winner' else: print tosses[:w+2], 'player %s wins.' %((w % 2) + 1,) -- Bob Gailer 919-636-4239 Chap

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread bob gailer
On 11/29/2011 6:40 PM, emile wrote: Dave Angel wrote: ... single use punch cards... You didn't have an IBM 719 CARD punch? (ChAd Restoration Device). Made reuse of punch cards very easy. -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] Programming Collective Intelligence Study Group

2011-11-29 Thread bob gailer
interest like here? Let me know and I will give you guys a heads up when I get everything all set up. I'm interested too. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] is there a better way to organise this code

2011-12-01 Thread bob gailer
ad to copy it elsewhere to even read it. Check out the drop-down box on the upper right. Choose Clean -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.o

Re: [Tutor] unexpected list entry

2011-12-02 Thread bob gailer
27;, 'o', 'o'] Why is that "u" coming in the middle from no where ?? input is returning user entry as unicode. -- 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] where I am going wrong?

2011-12-15 Thread bob gailer
same sum-of-5th-powers as 23154. Compute the sum then see if it is composed of the source digits. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-18 Thread bob gailer
On 12/18/2011 5:45 PM, Stayvoid wrote: Hey there! How to set it right? You may not get an answer as your question is pretty vague. Please clarify, or expand, or tell us what problem you are having or trying to solve. -- Bob Gailer 919-636-4239 Chapel Hill NC

[Tutor] What is ™

2011-12-22 Thread bob gailer
>>> "™" '\xe2\x84\xa2' What is this hex string? -- 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] question about the build-in function reversed in Python2.5

2011-12-24 Thread bob gailer
ssion_list. The suite is then executed once for each item provided by the iterator, in the order of ascending indices. Each item in turn is assigned to the target list using the standard rules for assignments, and then the suite is executed. When the items are exhausted (which is immediately wh

Re: [Tutor] [Python-Help] What is lambdas in Python??

2011-12-27 Thread bob gailer
s a list consisting of tuples containing the corresponding items from all iterables (a kind of transpose operation). The /iterable/ arguments may be a sequence or any iterable object; the result is always a list. >>> print map(lambda x, y : x + y, (1,2,3), (4,5,6)) [5, 7, 9] --

Re: [Tutor] x%2

2012-01-10 Thread bob gailer
but not so for negative a. >>> 5%3 2 >>> -5%3 1 >>> FWIW the Python documentation (at least as of 2.7.2 has this wrong!) -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubs

Re: [Tutor] append index out of range

2012-01-12 Thread bob gailer
space-separated-tokens". List indexing starts at 0, so tobetranslatedparts[2] refers to the 3rd item of the list that was created by split(). If that does not help, please show us some sample lines. -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] Trying to access a random value in a list

2012-01-12 Thread bob gailer
nt? Second problem, but not a big one, is when I print the lists of names as they are entered, I get quotations around the name. I bet you are seeing something like ['joe', pete'] since you are printing a list. true? In general copy and paste the undesired output in the email

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread bob gailer
ay to do this, preferably without closing IPython? in "normal" python: import sys reload(sys.modules['mymodule ']) from mymodule import myfunc -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread bob gailer
ntire module, but I confess I don't know how to reload a function using import like that... reload doesn't seem to have any option for that I'll watch this space to see if anyone else knows how. Good idea. And now you know. -- Bob Gailer 919-636

Re: [Tutor] factorial of anumber

2012-02-04 Thread bob gailer
I for one prefer plain text rather than HTML for email. Please in the future post plain text. No colors, no unusual fonts. Makes it a LOT easier to read. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Return T/F vs print T/F

2012-02-04 Thread bob gailer
gram with a call to a function, Python does NOT display the returned value. A function that does not execute a return will return None; in the interactive window nothing is displayed. Is that sufficient? -- Bob Gailer 919-636-4239 Chapel Hill NC _

Re: [Tutor] Return T/F vs print T/F

2012-02-04 Thread bob gailer
>>> a 3 IOW if the line is blank, start with # or is a statement the interpreter does not print anything (unless it is a print statement). For a messy example: >>> if 1:3;a=4;a ... 3 4 -- Bob Gailer 919-636-4239 Chapel Hill NC _

Re: [Tutor] Sandbox Game

2012-02-06 Thread bob gailer
todownload unknowns. I even tried the Play Online and got to another messy connfusing site, Could you give an overview of the game? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] Sandbox Game

2012-02-06 Thread bob gailer
answer the more likely you are to get answers. We volunteer our time to help you; we are not paid money for our service. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] Problem with smtplib

2012-02-06 Thread bob gailer
thing went awry with the internet connection between your computer and the SMTP server. Best strategy I know of is to trap the exception and retry, but for a limited # of times. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tuto

Re: [Tutor] python editor

2012-02-06 Thread bob gailer
"epeat previous command". I can think of several unrelated meanings. Personally I prefer an IDE. My favorites are PyCharm ($) and Python for Windows (free). -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Sandbox Game

2012-02-06 Thread bob gailer
so a lava drop could become a sand grain. That's all for now. Good coding! I don't want to copy the game Is there a Python version out there? , I want to make my own to play around with Py(thon/game). -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Backwards message program

2012-02-06 Thread bob gailer
quot; from it? They are copied. 2 - comparing an integer to a string is always False -- 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] Question on how to do exponents

2012-02-07 Thread bob gailer
ALUE Now you know, and you know how to find out! To delve any deeper you'd have to inspect the c source for pow. I'd assume it uses the c exponent operator -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org

Re: [Tutor] (no subject)

2012-02-07 Thread bob gailer
info/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] Character Buffer Object Error

2012-02-08 Thread bob gailer
old in place. No one else caught this problem! Since this is homework we we probably should not be offering alternative solutions. However I can't resist offering the one-line solution: ''.join(str(int(x)+1) if x.isdigit() else x for x in &#

[Tutor] Ongoing problems with Pam's new computer

2012-02-09 Thread bob gailer
I recommend Pam use another computer to publish events. -- 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] Character Buffer Object Error

2012-02-09 Thread bob gailer
e 12 cats?''' return AlterInput(user_input.split()) Your code: return ' '.join(str(int(num)+1) if num.isdigit() else num for num in user_input) On Wed, Feb 8, 2012 at 6:04 AM, bob gailer <mailto:bgai...@gmail.com>> wrote: On 2/8/2012 12:56 AM, Mi

Re: [Tutor] Character Buffer Object Error OOPS

2012-02-09 Thread bob gailer
learned conditional expressions, list comprehensions and generator expressions then you will be able to write the code I did. That code is just an alternative to what you wrote, "flattening it" as it were. [snip] -- Bob Gailer 919-636-4239 Chap

Re: [Tutor] Ongoing problems with Pam's new computer

2012-02-09 Thread bob gailer
On 2/9/2012 6:56 PM, Steven D'Aprano wrote: bob gailer wrote: Today is the third time Pam (connecting to the web site for event publication) has run into an inexplicable Access error. I don't think this has anything to do with learning Python. You are right. I was surprised to

Re: [Tutor] Running Files with Command Lines

2012-02-12 Thread bob gailer
en are hard to follow, and a lot depends on how your system is configured. Once we see the error you are getting we can better help. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

Re: [Tutor] how to print a string in desired colour

2012-02-12 Thread bob gailer
i tried print 'hello world','blue' Where did you get the idea that that would do what you want? Did you read the documentation regarding print? Please do not post stuff that is obviously wrong! No one can tell you how to create colored output until we know where yo

[Tutor] formatting sql Was: Some help Please

2012-02-15 Thread bob gailer
tanding_Amount,to make an increment? Please, is it the same thing with the withdrawing format, in case i want to decrement the account as in withdrawing?? joseph -- 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] arrays, while loops

2012-02-18 Thread bob gailer
se confirm or explain. -- 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] arrays, while loops

2012-02-20 Thread bob gailer
logic. Another approach is using try and except as others have mentioned. However I doubt whether your course has introduced exception handling. -- 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] __name__=='__main__'

2012-02-20 Thread bob gailer
except ValueError: continue new_text = MultiplyText(text, multiplier) return new_text if __name == '__main__': print GetUserInput() To fix both problems replace multiplier.isdigit() with multiplier = int(multiplier) -- Bob Gailer 919-636-4239 Chapel

Re: [Tutor] how to rewrite area.py

2012-02-21 Thread bob gailer
put('Height: ') while h <= 0: print 'Must be a positive number' h = input('Height: ') print 'Width =',w,' Height =',h,' so Area =',area(w,h) ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Help Designing a simple Program called Life

2012-02-22 Thread bob gailer
the grid to display with the initial state. Then step back, say "well done,Leo" then add code to advance to subsequent states with some limit. I'll post the code that I already have later today. -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] Recognizing real numbers

2012-02-22 Thread bob gailer
l J. Lewis _______ 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] Writing to a file/changing the file name

2012-02-23 Thread bob gailer
7;2' is the question what is "recipe.txt" + 2> If you come up with anything other than "recipe.txt2" then you need to review how Python works. Another idea is: when you get an unexpected result there must be a very good reason for it. Do a little hunting. Each time you

Re: [Tutor] Attribute error message received on Card Game program

2012-02-24 Thread bob gailer
(most recent call last): File "C:/Python27/Card Game.py", line 69, in print my_hand File "C:/Python27/Card Game.py", line 25, in __str__ for card in self.card: AttributeError: 'Hand' object has no attribute 'card' >>> /*Would you please help me as to where I got it wrong with this program

Re: [Tutor] Help with Python Program

2012-02-24 Thread bob gailer
ct), an if-elif-else statement, and the use of Python's random number generator. Do you know how to create a loop? If not, why not? Do you know how to test for low or high? If not why not? If your answers to these questions is no then (IMHO) you are in the wrong class. -- Bob Gailer 91

Re: [Tutor] roman to arabic

2012-02-26 Thread bob gailer
ommand" If I was running your program and saw that I'd have to give up since I have no idea what is expected. print "Please enter command - r for roman-arabic" would be much better. -- 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] initialising all elements of a matrix

2012-02-28 Thread bob gailer
On 2/28/2012 11:40 AM, Peter Otten wrote: def product(factors, product=1): for factor in factors: product *= factor return product can be "simplified" def product(factors): import operator return reduce(operator.mul, factors) -- Bob Gailer 919-636-4239 Chap

Re: [Tutor] how to stop a program in python which is running for long time , I am using windows

2012-02-29 Thread bob gailer
GUI - task manager cmd line - taskkill " running for long time" is relative and irrelevant. Above stops regardless. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] number of mismatches in a string

2012-03-02 Thread bob gailer
the above in the hopes of gaining insight. Perhaps you could restate the problem in a way that makes it crystal clear. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

<    6   7   8   9   10   11   12   13   14   >