Hi list,
I finally manage to sort of complete my read-create-edit.py file (after
finding precious free time). I appreciate your review and good/bad
comments to my code. It look and runs ok from my side here :-)
#read_create_edit.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Exercise 3
--
Regards,
bibs M.
Host/Kernel/OS "cc02695" running Linux 2.6.31-5.slh.4-sidux-686
[sidux 2009-02 Αιθήρ - kde-full - (200907141427) ]
www.sidux.com
Albert Sweigart wrote:
Your problem is on this line:
fobj.write('\n'.join(all))
This puts a newline in between each line in "all", but
Luke Paireepinart wrote:
That's because there is NOT a new line at the end of the file.
It's a file you're appending to, it's up to YOU to create that new
line. And all files should end with newlines anyway (on linux).
So modify your code so that you output a new line at the end of your
output
Luke Paireepinart wrote:
On Wed, Dec 9, 2009 at 12:11 PM, biboy mendz <mailto:bibsmen...@gmail.com>> wrote:
Hello all!
I'm trying to use the append mode when opening and writing to a file
but i cant get it to work my way. When run in the present code,
the u
Hello all!
I'm trying to use the append mode when opening and writing to a file
but i cant get it to work my way. When run in the present code,
the user inputs are expectedly 'appended' but not in a newline below the
last
line of the existing file. Instead it starts from where the last line end.
spir wrote:
What is your question?
If it's about the type of exception raised when os.path.exists fails, well,
sure it's hard to find:
print os.path.exists("foo".bar)
==> False
My question is: i'm looking for type of exception that more or less
equivalent to os.path.exists attribute
http://pastebin.ca/1693849
This is end-of-chapter3 exercise of the book Core Python Programming.
I'm reading/searching in the book and other materials but is
unsuccessful. There are at least 50 exceptions listed but I can't find
anything close.
I commented out my modified script to just what
thanks a lot for the clarification Alan and all.
--
Regards,
bibs M.
Host/Kernel/OS "cc02695" running Linux 2.6.31-5.slh.4-sidux-686
[sidux 2009-02 Αιθήρ - kde-full - (200907141427) ]
www.sidux.com
Alan Gauld wrote:
"biboy mendz" wrote
chapter 8: hangman.py
http://inventwithpython.com
chapter 8: hangman.py
expression is: print(letter, end=' ')
it explained:
end keyword argument in print() call makes the print() function put a space
character at the end of the string instead of a newline.
however when run it gives error: SyntaxError: invalid synta