Re: [Tutor] Question on regular expressions

2013-02-12 Thread Mark Lawrence
>> x=a.rindex(b) >>> y=a.rindex(' end') >>> a[x+len(b):y] 'AnotherArbitraryAmountOfText' >>> c="garbage in, garbage out" >>> x=c.rindex(b) Traceback (most recent call last): File "", line 1, in ValueError: substring not found >>> -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Mark Lawrence
-- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Binary Addition

2013-02-13 Thread Mark Lawrence
ese functions within the outer while loop? The trys aren't matched up with anything, you need something else, usually one or more except clauses. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Mark Lawrence
ite to learn about them. Your book was written for python 2 it seems In Python 3 the syntax error is caused by print not having brackets, not the as it happens the incorrect call to raw_input. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@pyth

Re: [Tutor] There's a Programmer in Me

2013-02-26 Thread Mark Lawrence
advice. http://pythonmentors.com/ -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] There's a Programmer in Me

2013-02-26 Thread Mark Lawrence
On 26/02/2013 13:57, Tim Golden wrote: On 26/02/2013 13:54, Mark Lawrence wrote: On 26/02/2013 13:02, Khalid Al-Ghamdi wrote: Hi All, I'm not a programmer by profession, but I want to learn python. I've got lots of Ideas that want to realize, but I always run into these stupid hiccu

Re: [Tutor] Second follow up

2013-02-26 Thread Mark Lawrence
://mail.python.org/mailman/listinfo/tutor I'd like to see your project when it's finished as a text based rocket propelled grenade seems very interesting, or are we talking cross purposes owing to a major lack of data? -- Cheers. Mark Lawrence ___ Tuto

Re: [Tutor] Second follow up

2013-02-26 Thread Mark Lawrence
NDENT # write your code here, indented by FOUR spaces or ONE tab Does that help? Get thee behind me Satan/Steven, tabs indeed :) -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Mark Lawrence
l. Then write some code, test it and if you have problems please get back to us. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unit test cases for Object intraction using mox/unittest

2013-03-08 Thread Mark Lawrence
you also be kind enough not to post the same question two minutes apart on two different Python mailing lists. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] Unit test cases for Object intraction using mox/unittest

2013-03-08 Thread Mark Lawrence
On 08/03/2013 12:38, jitendra gupta wrote: The self same question has been asked on the tutor mailing, I suggest we all answer over there rather than scattering seeds to the wind. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To

[Tutor] Bar Operator ??

2013-03-09 Thread Mark Lybrand
date formatting for example). So what is this "|pluralize" syntax? Thanks in andvance {{ poll.question }} {% for choice in poll.choice_set.all %} {{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}{% endfor %} Vote ag

Re: [Tutor] 'Last' in Python?

2013-03-10 Thread Mark Lawrence
lor/Google-Python-Exercises/blob/master/list1.py -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Bar Operator ??

2013-03-11 Thread Mark Lybrand
Thanks. I think I kind of get it. It probably will take a while for the nuances of the filter to sink. Some things are filters that don't seem like they should be, but that seems like my problem. Mark :) On Sun, Mar 10, 2013 at 11:33 PM, Danny Yoo wrote: > > > > It's a

Re: [Tutor] BMI calc

2013-03-12 Thread Mark Lawrence
get syntax errors as print is a function, not a statement as in Python 2. Is this your problem? If not please cut and paste the exact syntax error for us to see. Then we'll sort the rest of the problems :) -- Cheers. Mark Lawrence ___ Tuto

Re: [Tutor] BMI calc

2013-03-12 Thread Mark Lawrence
On 13/03/2013 02:08, Dave Angel wrote: On 03/12/2013 09:46 PM, Mark Lawrence wrote: On 13/03/2013 00:05, Soliman, Yasmin wrote: Hello all, I'm new to python and its been a stuggle so far. I'm attempting to create a BMI calculator in Wing 101 4.1. I keep getting syntax errors: de

Re: [Tutor] increment a counter inside generator

2013-03-13 Thread Mark Lawrence
the size of the range it represents. There are no consistent performance advantages." -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Text Processing Query

2013-03-14 Thread Mark Lawrence
7; and 'FAB FRAGMENT' in line: flag = 1 elif line[0:6]=='COMPND' and 'CHAIN' in line and flag = 1: print line flag = 0 Notice that the flag is set to 1 only on "FAB FRAGMENT", and it's reset to 0 after the next &q

[Tutor] Random Python Tip

2013-03-15 Thread Mark Lybrand
I seem to remember a web page that generated a random Python programming tip. However my Google Fu is weak today. Does anyone recall the URL of what I am talking about? -- Mark :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] func-question_y_n.py

2013-03-15 Thread Mark Lawrence
our response!") answer = input(question) return answer Sorry for this layout, I myself was getting a little dizzy reading it. Thank you for your assistance! Sincerely in Christ, Christopher -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] func-question_y_n.py

2013-03-15 Thread Mark Lawrence
On 15/03/2013 23:37, Christopher Emery wrote: Hello Hugo, Mark, Dave, For Mark: Thank you for your answer at the end of your email. If you don't mind me stating for future can you explain things a little more so I may understand the why to your statement "WHy the unneeded parenth

Re: [Tutor] Loop Exception Handles

2013-03-15 Thread Mark Lawrence
a number!") for i in range(number): name = input("Enter player name: ") names.append(name) print() Assuming that you get your while loop to work correctly, how many times will the for loop above run if you enter 1? -- Cheers. Mark Lawrence __

Re: [Tutor] help related to unicode using python

2013-03-20 Thread Mark Lawrence
oblems ask for help. I'd strongly suggest using Python 3.3 if you can for your processing. It's vastly superior to earlier, buggy unicode implementations in Python. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Modules

2013-03-27 Thread Mark Lawrence
s http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to check if user input is an integer

2013-03-29 Thread Mark Lawrence
ou're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to check if user input is an integer

2013-03-29 Thread Mark Lawrence
s much, although in this case it's easy enough to work out. Also state your OS and Python version. TIA. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist

Re: [Tutor] Tkinter Documentation

2013-03-30 Thread Mark Lawrence
On 30/03/2013 23:16, Clyde Wilson wrote: Is there a fairly complete set of documentation on-line for Tkinter? I'm using Python 3.3 on Windows. http://docs.python.org/3/library/tkinter.html -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPyth

Re: [Tutor] Traceback problem

2013-03-31 Thread Mark Lawrence
urce but this error often occurs when you've missed a closing bracket of some kind. A combination of any semi-decent editor that's got syntax highlighting and the MKI eyeball can often fix this :) -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/Googl

Re: [Tutor] create a facebook Application for linux desktop

2013-03-31 Thread Mark Lawrence
really have to post this one hour and 28 minutes after your first post with a slightly different title? -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist -

Re: [Tutor] argparse iterable

2013-04-01 Thread Mark Lawrence
"./h.py", line 16, in for k,v in parser.parse_args(): TypeError: 'Namespace' object is not iterable $ How can I get parser to be iterable? After I get it to iter, I suppose that I'll be bitten by the boolean and integer type conversions. I'm not sure how to handle

Re: [Tutor] argparse iterable

2013-04-01 Thread Mark Lawrence
On 02/04/2013 02:37, Dave Angel wrote: On 04/01/2013 09:31 PM, Mark Lawrence wrote: for a in vars(parser.parse_args()): print('This arg is %s' % a) http://docs.python.org/3/library/argparse.html#the-namespace-object Please don't ask me for an explanation as it took me

Re: [Tutor] argparse iterable

2013-04-01 Thread Mark Lawrence
python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] argparse iterable

2013-04-02 Thread Mark Lawrence
or us? :) -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help required

2013-04-04 Thread Mark Lawrence
adlines() timestamps = [] energies = [] for line in lines: splits = line.split(',') # I'll admit not the best name timestamps.append(float(splits[0])) energies.append(float(splits[1])) # process timestamps and energies to your heart's content

Re: [Tutor] Proper uses of classes

2013-04-05 Thread Mark Lawrence
nts. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] loop questions

2013-04-06 Thread Mark Lawrence
m = raw_input(“Enter an integer: “) num = int(m) try: num = int(m) except ValueError: doSomething I'll leave you to restructure the loop. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence

Re: [Tutor] (no subject)

2013-04-06 Thread Mark Lawrence
int '\nThank you for using this program! Bye.' break else: print 'Not quitting' -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Mark Lawrence
lretrieve -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-09 Thread Mark Lawrence
ap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to make a python script run on startup

2013-04-09 Thread Alexander Mark
There is a startup folder, usually on the start menu, you can add the script to. --ame On Apr 9, 2013, at 4:20, daedae11 wrote: > On Windows, how to make a python script run on startup? > > > ___ > Tutor maillist - Tutor@python.org > To unsubscr

Re: [Tutor] Impossible Else as Exception

2013-04-09 Thread Mark Lawrence
read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] File not found error, but it is in the folder!

2013-04-10 Thread Mark Lawrence
\Q1 FY13\\BEP_Tool4DOS\\FY13Q1_responses') ['Algeria_688_RVF.txt', 'Egypt_31060_RVFEnvir ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.or

Re: [Tutor] creating dictionary from a list

2013-04-13 Thread Mark Lawrence
index_values.append(lst.index(item)) But I can't quite get it to understand that i want all items between position 0 and 2 in the list to be assigned to item at 0 in the dictionary and so forth. Ideas? Don't fight Python, unlike this chap[1] :) Basically if you're looping

Re: [Tutor] creating dictionary from a list

2013-04-13 Thread Mark Lawrence
27;Sat Apr 13': ['1:00pm', 'Get flag from dhariwal']} Sat Apr 13 is appearing after Sun Apr 14. How do you sort this? http://docs.python.org/3/library/collections.html#collections.OrderedDict -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] creating dictionary from a list

2013-04-13 Thread Mark Lawrence
27;Sun'))__: ^ SyntaxError: invalid syntax Please compare your original line with the line above and note the differences. That'll account for the syntax error, which appears to ha

Re: [Tutor] creating dictionary from a list

2013-04-13 Thread Mark Lawrence
On 13/04/2013 20:30, Saad Bin Javed wrote: On 04/14/2013 12:08 AM, Mark Lawrence wrote: On 13/04/2013 19:45, Saad Javed wrote: for item in lst: if item.startswith(('Mon','Tue','Wed','Thu','Fri',&#

Re: [Tutor] creating dictionary from a list

2013-04-13 Thread Mark Lawrence
-- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python lists/nested lists

2013-04-13 Thread Mark Lawrence
che', 102.3] and I would like to print out all the patients with a temp > 100 how would I do so? for patient in sick_patients: if patient[-1] > 100: print(patient) The above works if you fix the syntax errors in sick_patients, you do't need all the

Re: [Tutor] Issue With a Python Game

2013-04-14 Thread Mark Lawrence
!= None, 'Level %s (around line %s) in %s i s missing a "@" or "+" to mark the start point.' % (levelNum+1, lineNum, filenam e) AssertionError: Level 1 (around line 10) in levels.txt is missing a "@" or "+" t o mark the start point. The Code: impo

Re: [Tutor] (no subject)

2013-04-15 Thread Mark Lawrence
as. average = sum(hrList) / len(hrList) print average -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] Help on python

2013-04-15 Thread Mark Lawrence
something like "python natural language processing" into your favourite search engine. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Sys.argv read parameters

2013-04-17 Thread Mark Lawrence
ted as of Python 3.2. There is also an awesome third party module here https://github.com/docopt/docopt -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tut

Re: [Tutor] hard time importing a module

2013-04-19 Thread Mark Lawrence
ttp://tinyurl.com/cuwdhjk -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why do I get an "unvalid syntax" on the print line for number1

2013-04-23 Thread Mark Lawrence
a function and not a statement. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] why does this not work

2013-04-23 Thread Mark Lawrence
"Shutdown aborted!" else: return "Sorry, I didn't understand you" But when I run it I see this message: It looks like output other than yes/no does not return "Sorry, I didn't understand you." So can anyone explain to me what I did wrong. Roelof PEBKAC o

Re: [Tutor] trouble installing library

2013-04-24 Thread Mark Lawrence
re using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] trouble installing library

2013-04-24 Thread Mark Lybrand
me only > uses double quotes. So just change it to the following: > > python -c "import googlemaps" > > > > Reference: Parsing C++ Command-Line Arguments > http://msdn.microsoft.com/en-us/library/17w5ykft%28v=vs.100%29 > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Mark :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why do I not get the same results for these two functions when I pass 7 as an argument?

2013-05-03 Thread Mark Lawrence
eturn payment - 50 else: return payment Python comparisons are chained. days >= 3 < 7 is saying "days is greater or equal to 3 and 3 is less than 7". You need 3 <= days < 7. -- If you're using GoogleCrap™ please read this http://w

Re: [Tutor] Argparse functions with N parameters

2013-05-07 Thread Mark Lawrence
parse/optparse? ~Ramit I've just started using docopt. It's brilliant in its simplicity. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist -

Re: [Tutor] help regarding game code

2013-05-12 Thread Mark Lawrence
e.org/ -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variable in format string throwing error

2013-05-13 Thread Mark Lawrence
ins.KeyError: 'x' -- Jim Using over complicated modern string formatting? Stick with the old C style % style and it's much easier. Contrary to popular belief it's not going away :) -- If you're using GoogleCrap™ please read this http://wiki.p

Re: [Tutor] still nosing around

2013-05-21 Thread Mark Lawrence
pid_error has to be called test_stupid_error or similar. I'll leave you to check the nose docs to confirm whether or not my guess is correct. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread Mark Lawrence
in your list. And indirectly to the Gang of Four book, http://en.wikipedia.org/wiki/Design_Patterns IIRC Alex Martelli argued that you don't need a singleton, you need a borg. I'll leave those interested to look this up :) -- If you're using GoogleCrap™ please read

Re: [Tutor] why can you swap an immutable tuple?

2013-05-25 Thread Mark Lawrence
ooney "Coding? You can get a woman to do that!" he said with a sneer. --heard from a physics professor in 1969 -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence ___ Tut

Re: [Tutor] making a string

2013-05-25 Thread Mark Lawrence
On 26/05/2013 04:07, Tim Hanson wrote: I'm new to this, just getting through the first Mark Lutz book. If I start out with : ham=list('spam');ham ['s','p','a','m'] How do I get a string back? __

Re: [Tutor] making a string

2013-05-26 Thread Mark Lawrence
On 26/05/2013 05:10, Jim Mooney wrote: On 25 May 2013 20:49, Tim Hanson wrote: A lot of people tend to be intimidated by Mark Lutz, and so am I, I guess. Interesting coincidence. This is a retirement project and I just decided on the Lutz book, which looked comprehensive, since the book I&#

Re: [Tutor] making a string

2013-05-26 Thread Mark Lawrence
On 26/05/2013 22:40, Jim Mooney wrote: On 26 May 2013 02:51, Mark Lawrence wrote: Basically no. Python 2.7 is guaranteed to be backward compatible with Python 2.6. New or improved functionality will be listed in the "What's New for Python 2.7". In fact if you look at the

Re: [Tutor] bytecode primer, and avoiding a monster download

2013-05-27 Thread Mark Lawrence
I love guessing games! Ah, who am I kidding. No I don't. Been there, seen it, done it, got the t-shirt http://old.nabble.com/Re%3A-Unable-to-install-PyWin32-with-Python-2.6.2-p25202902.html -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGrou

Re: [Tutor] google spreadsheet

2013-05-30 Thread Mark Lawrence
can suggest it would really be a lot of help Thanks and regards, SUMEET SINGH Start here https://developers.google.com/google-apps/documents-list/v1/developers_guide_python I guess!!! -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython.

Re: [Tutor] when is a generator "smart?"

2013-06-03 Thread Mark Lawrence
, you'll probably sleep better for it :) -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___

[Tutor] [OT]Death of VMS

2013-06-12 Thread Mark Lawrence
green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What are these two string-formatting styles called?

2013-06-14 Thread Mark Lawrence
. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] python web related scripts needed

2013-06-16 Thread Mark Lawrence
anner. You show that you've made an attempt to implement something and have run into problems, and we'll help. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whisper

Re: [Tutor] Hi, First question

2013-06-16 Thread Mark Lawrence
what’s wrong in your code? You are reading only the first line. > What does "for line in fhand:" do then? -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Getting the real exception clause

2013-06-16 Thread Mark Lawrence
print(line,end='') fh.close() except Exception as err: print(err) Jim After indictment the bacon smuggler was put on the no-fry list Easy, strip out the exception handling you have above. c:\Users\Mark\MyPython>type a.py with open('nosuchdirectory/text/truthyfal

Re: [Tutor] Getting the real exception clause

2013-06-16 Thread Mark Lawrence
t editor and run the code from the command line? Thinking about it, for years I happily used Mark Hammond's excellent pywin32 stuff to do just this. I only moved to Eclipse and Pydev when I had some heayweight porting of Java code to Python, but that would be a massive overkill for the O

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Mark Lawrence
first bug report to get this fixed. I look forward to seeing your effort on the bug tracker mailing list. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering&#

Re: [Tutor] Best Code testing practice?

2013-06-20 Thread Mark Lawrence
k ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] appending/updating values dict key value pairs

2013-06-22 Thread Mark Lawrence
#x27;: [4, 5, 'c']} as in, shouldn't it be b['a'] = list.append(b.get('a'),'c') which doesn't seem to work. sivaram -- b['a'].append('c') -- "Steve is going for the pink ball - and for those of you who

Re: [Tutor] Data persistence problem

2013-06-22 Thread Mark Lawrence
i". Enjoy :) -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor mail

Re: [Tutor] How convert an int to a string

2013-06-22 Thread Mark Lawrence
r have a non octal digit? -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 2 or 3?

2013-06-23 Thread Mark Lawrence
ng for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change s

Re: [Tutor] List Python Question..Please help

2013-09-27 Thread Mark Lawrence
looking for names where the final letter is the lower case equivalent of the first letter. In that way your code should consist of four lines, the list of names, one for loop, one if statement and one print function, the latter assuming Python 3. Hope this helps. -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List Python Question..Please help

2013-09-27 Thread Mark Lawrence
> and solve it for a single name. for example, take a look at this pseudocode: > > name = 'Guido' > if name first letter == name last letter: # turn this into real Python > using what you have > print 'match' > else: > print 'not a match&#

Re: [Tutor] Regex Question

2013-09-30 Thread Mark Lawrence
hanks! I'd be strongly inclined to use the CSV module from the standard library with an excel-tab dialect name, see http://docs.python.org/3/library/csv.html#module-csv Please try it and if you encounter any problems feel free to get back to us, we don't

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Mark Lawrence
obvious one to use here could be the given sqlite3.OperationalError. Common problems that are caught include NameError, IndexError and ScrewedUpCompletelyError :) -- Cheers. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqlite3 COMMIT directive

2013-10-02 Thread Mark Lawrence
on the bug tracker to get the relevant docs changed, or is "slightly misleading" actually close enough? -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Which Python should a beginner learn?

2013-10-02 Thread Mark Lawrence
esn't. Mark Lawrence ___ 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 Mark Lawrence
en in words and numbers and not the physical dimensions. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.

Re: [Tutor] class decorator question

2013-10-06 Thread Mark Lawrence
are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Processing CSV files

2013-10-08 Thread Mark Lawrence
- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] docopt module: defaults appear to be ignored

2013-10-08 Thread Mark Lawrence
s """ If you haven't already looked at them there are lots of extremely useful examples here https://github.com/docopt/docopt/tree/master/examples. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___

Re: [Tutor] Looking for Words - Help

2013-10-11 Thread Mark Lawrence
Please see http://docs.python.org/3/tutorial/controlflow.html#index-0 -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: htt

Re: [Tutor] Looking for Words - Help

2013-10-11 Thread Mark Lawrence
as infile: lines = infile.readlines() rather than the version for, err, us lazy old bastards ;) Why bother building a list when the modern idiom is simply for line in infile: ? -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence _

Re: [Tutor] Consolidate several lines of a CSV file with firewall rules

2013-10-11 Thread Mark Lawrence
folks, this was answered hours ago on the main Python mailing list. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Looking for Words - Help

2013-10-12 Thread Mark Lawrence
27;Fall'), (4, 'Winter')] Note that the above is taken from an interactive session. If you haven't used this extremely powerful tool please start doing so immediately, it's one of Python's most powerful features. It may well help you to try this by actually ty

Re: [Tutor] Parse text with python

2013-10-17 Thread Mark Lawrence
e read the appropriate section here http://docs.python.org/3/tutorial/introduction.html#strings. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc

Re: [Tutor] Reading CSV files in Pandas

2013-10-19 Thread Mark Lawrence
blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Reading CSV files in Pandas

2013-10-19 Thread Mark Lawrence
On 19/10/2013 15:29, Manish Tripathi wrote: You are far more likely to get a response to the identical question that you've already asked on stackoverflow than you are here. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mar

Re: [Tutor] Passing arguments?

2013-10-20 Thread Mark Lawrence
by reading, digesting and actioning this https://wiki.python.org/moin/GoogleGroupsPython. Better still use a decent email client like Thunderbird. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence ___

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