[Tutor] Tutoring

2011-03-25 Thread bob gailer
I have recently become a tutor to several Python students. I enjoy tutoring and they benefit from it. I work with some students using remote access, so we can be geographically far apart. Who do you know who might benefit from receiving one-on-one tutoring? -- Bob Gailer 919-636-4239

Re: [Tutor] String formatting question.

2011-03-31 Thread bob gailer
IMHO % formatting is the easiest to use and understand. I am sorry that it has been slated for removal. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] Importing sub modules

2011-03-31 Thread bob gailer
der or destroy the material! "STRICTLY PROHIBITED" oh I am so scared! So there! -- 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] Passing a Variable

2011-04-03 Thread bob gailer
eturn #If it gets this far, it's because the timer already ran, the player is 'safe', and another check is being performed self.auto_check() Also note if self.auto_check_timer == False: can be simplified to if

Re: [Tutor] Calling another script

2011-04-03 Thread bob gailer
bscription 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] Evaluating program running time?

2011-04-08 Thread bob gailer
c approaches to this? I found the "timeit" module, but that doesn't seem to be quite what I'm looking for. I like to use the time module import time start = time.time() rest of program print time.time() - start I believe that gives best precisioni on *nix On Windows use time.c

Re: [Tutor] Python on TV

2011-04-11 Thread bob gailer
video ... cannot be viewed from your currrent country ..." Sigh. -- 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] Import multiple lines of text into a variable

2011-04-11 Thread bob gailer
o me, as long as the file fits available memory. There will be 2 copies of the file after the split. Another way: textFile = open('myfile','r') for line in textFile: if line.startswith('notes'): notes = textFile.read() -- Bob Gailer 919-636-4239 Chapel Hill NC ___

Re: [Tutor] Python on TV

2011-04-15 Thread bob gailer
On 4/15/2011 3:35 PM, Alan Gauld wrote: "bob gailer" wrote The show should be here - Pause at 1 minute 20 for the Python screnshot: http://fwd.channel5.com/gadget-show/videos/challenge/surprise-special-part-4 I am told "the video ... cannot be viewed from your currrent co

Re: [Tutor] voluntary work :p:

2011-04-25 Thread bob gailer
What magic? Did you see an image of a monitor with 2 to the 38 on it? Did you see "Hint: try to change the URL address."? Did you try that? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubs

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread bob gailer
the 3 files finalmotifs = motif_file.readlines() for line in seqalign: for item in finalmotifs: if item in line: align_file.write('~' * len(line) + '\n') # close the 3 files -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Reading elements in a file

2011-05-05 Thread bob gailer
available as string methods. string.capwords(s[, sep]) string.maketrans(from, to) -- 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

Re: [Tutor] How to extract a value from a matrix.

2011-05-07 Thread bob gailer
does "list that has been opened from a text file" mean? Is the source of the list important (e.g. does it matter whether it comes from a file)? Please provide an example. What does the list look like? How do you determine which element you want? Bob Gailer 919-636-4239 Chap

Re: [Tutor] Python Hard_way 40

2011-05-11 Thread bob gailer
d_city" function. This stores a reference to the function. The following line is the call to the function. city_found = cities['_find'](cities,state) [snip] -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@pytho

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
On 8/2/2011 11:39 PM, Alexander Quest wrote: Hey Bob- thanks for the reply. Here is a more complete part of that code section (the ellipses are parts where I've deleted code because I don't think it's important for this question): Please always reply-all so a copy goes to th

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
On 10/7/2011 5:32 PM, Guess?!? wrote: Hey Bob, Thanks for the suggestions. There is no traceback/stacktrace errors that I can see (may be there is a file that is generated in python or windows directory due to run time failure but I am not able to locate it. Please let me know if you know

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
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 change the file location in program Don't make that assumption. Of course we can figure that ou

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
Always reply-all so a copy goes to the tutor list. Always put your responses following the question rather than at the top of the email. On 10/28/2011 8:28 AM, Adrian wrote: Thats the original alright bob, id like to change keys to lowercase Thanks Adrian Sent from my iPad On 27 Oct 2011

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
Always reply-all so a copy goes to the tutor list. On 2/8/2012 11:04 PM, Michael Lewis wrote: Thanks Bob, Thanks for what if you did not follow my suggestions? Your code is still pretty buggy. Please test it by running it, seeing that the result is not correct, then try the desk checking

Re: [Tutor] Character Buffer Object Error OOPS

2012-02-09 Thread bob gailer
On 2/8/2012 11:04 PM, Michael Lewis wrote: Thanks Bob, My Bad - I did not examine all your code - I broke my own rule. Your code is still a little buggy. The below code is what I came up with without using your suggestion. On a scale, how novice is mine compared to what you offered? I am

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

<    7   8   9   10   11   12   13   14   15   16   >