[Tutor] Printing with no newline :(

2011-11-05 Thread Joe Batt
I am learning Python 3 and programming and am very new so please bear with me… I am writing a program to pull out specific characters in a sequence and then print then out. So far so good however when the characters are printed out they pint on separate lines as opposed to what I want, all on th

Re: [Tutor] getting nasty TypeError:

2011-11-05 Thread Steven D'Aprano
Nathaniel Trujillo wrote: I get the following error message. Traceback (most recent call last): File "C:\Python31\blackjack.py", line 184, in main() File "C:\Python31\blackjack.py", line 181, in main game.play() File "C:\Python31\blackjack.py", line 132, in play print(player)

Re: [Tutor] getting nasty TypeError:

2011-11-05 Thread Dave Angel
On 11/05/2011 10:02 PM, Nathaniel Trujillo wrote: Hello. I am currently working with Python version 3.1.1 . I am working out of the book called Python Programming for the Absolute Beginner Third Edition which teaches version 3.1.1 . I wrote the following blackjack program that is on page 275 and

[Tutor] getting nasty TypeError:

2011-11-05 Thread Nathaniel Trujillo
Hello. I am currently working with Python version 3.1.1 . I am working out of the book called Python Programming for the Absolute Beginner Third Edition which teaches version 3.1.1 . I wrote the following blackjack program that is on page 275 and I imported the modules that you see below. First the

Re: [Tutor] Having trouble visiting the subscribers list.

2011-11-05 Thread Steven D'Aprano
Nathaniel Trujillo wrote: I recently subscribed to tutor and I am trying to visit the subscribers list so I can ask a question but I was'nt given an admin address. Not only that but I don't know what an admin address is. Your help is greatly appreciated. Why do you want to see the list of subsc

Re: [Tutor] Having trouble visiting the subscribers list.

2011-11-05 Thread Dave Angel
On 11/05/2011 08:57 PM, Nathaniel Trujillo wrote: I recently subscribed to tutor and I am trying to visit the subscribers list so I can ask a question but I was'nt given an admin address. Not only that but I don't know what an admin address is. Your help is greatly appreciated. You've figured o

[Tutor] Having trouble visiting the subscribers list.

2011-11-05 Thread Nathaniel Trujillo
I recently subscribed to tutor and I am trying to visit the subscribers list so I can ask a question but I was'nt given an admin address. Not only that but I don't know what an admin address is. Your help is greatly appreciated. ___ Tutor maillist - Tut

Re: [Tutor] Writing processed text to another file(beginner)

2011-11-05 Thread Dave Angel
On 11/05/2011 03:31 PM, Mayo Adams wrote: Thank you for your reply, this is all I needed to know: the loop is over when you outdent back to line up with the for statement Indeed, the indentation rules are very simple. I just wanted to be sure about what they were. Sounds good. Three

Re: [Tutor] Writing processed text to another file(beginner)

2011-11-05 Thread Dave Angel
On 11/05/2011 03:04 PM, Mayo Adams wrote: Code to build a list z to contain all the first words in each line of a text file: z=[] f=open('C:/atextfile.txt') for aLine in f: str=aLine a=str.split() z.append(a) I would like to work further with the list z once the file has been stripped, an

[Tutor] Writing processed text to another file(beginner)

2011-11-05 Thread Mayo Adams
Code to build a list z to contain all the first words in each line of a text file: z=[] f=open('C:/atextfile.txt') for aLine in f: str=aLine a=str.split() z.append(a) I would like to work further with the list z once the file has been stripped, and the list is complete but am so clueless ab

Re: [Tutor] regexp

2011-11-05 Thread Dinara Vakhitova
Oh, sorry, of course it should be without brackets: 'a*b*c*...' > [a*b*c*d*...x*y*z*] 2011/11/5 Dinara Vakhitova > Steven, Walter, Dave, Peter and Albert, > > First of all, thank you very much for your suggestions, I appreciate a lot > your help. I would only like to mention that I would have

Re: [Tutor] regexp

2011-11-05 Thread Dinara Vakhitova
Steven, Walter, Dave, Peter and Albert, First of all, thank you very much for your suggestions, I appreciate a lot your help. I would only like to mention that I would have never asked something to be done for me just because it's my homework, I posted this question only because I couldn't find a

Re: [Tutor] regexp

2011-11-05 Thread Albert-Jan Roskam
Hi, I would know if or how it could be done with regexes, but isn't the following simple code a solution? It requires that the text be split up into separate words. Or am I overlooking something? >>word = 'ym' >>> [letter for n, letter in enumerate(word) if letter > word[n-1]] == >>> list(word

Re: [Tutor] regexp

2011-11-05 Thread Peter Otten
Steven D'Aprano wrote: > Good luck with the question! If you do solve it, please come back and > tell us how you did it. I for one am curious now whether or not it can > be done using Python regexes. Perhaps someone else might have a > solution. You could try the python-l...@python.org mailing lis

Re: [Tutor] Help with re in Python 3

2011-11-05 Thread Andreas Perstinger
On 2011-11-04 20:59, Albert-Jan Roskam wrote: It seems that you are not opening the file properly. You could do f = file('///Users/joebatt/Desktop/python3.txt','r') or: withfile('///Users/joebatt/Desktop/python3.txt','r') as f: OP is using Python 3, where "file" is removed. Thus, you have to us