Ramit,
This seems to be more logic now I hope :)
#
import ast
fname = 0
lname = 1
country = 2
city = 3
tel = 4
notes = 5
## Read data from file
def load_book():
load_book = open('c:/Python27/Toli/myfile.txt', 'r')
load_book =
Ramit,
This seems to be more logic now I hope :)
#
import ast
fname = 0
lname = 1
country = 2
city = 3
tel = 4
notes = 5
## Read data from file
def load_book():
load_book = open('c:/Python27/Toli/myfile.txt', 'r')
load_book =
**
Absolutely! Too bad your version would be considered the more
“complicated” version ;)
I`m sure about that, but I`am also sure that every beginner passed true
that way.
** **
With the main navigation menu I will only have the option to select a
nickname and when a nickname is
From: Anatoli Hristov [mailto:toli...@gmail.com]
Sent: Wednesday, March 28, 2012 5:36 PM
To: Prasad, Ramit
Cc: python-list@python.org
Subject: Re: RE: Advise of programming one of my first programs
Um, at least by my understanding, the use of Pickle is also dangerous if
you
From the Zen of Python, Simple is better than complex. It is a good
programming
mentality.
Complex is better than complicated. :p
Absolutely! Too bad your version would be considered the more “complicated”
version ;)
With the main navigation menu I will only have the option to select a
The use of eval is dangerous if you are not *completely* sure what is
being passed in. Try using pickle instead:
http://docs.python.org/release/2.5.2/lib/pickle-example.html
Um, at least by my understanding, the use of Pickle is also dangerous if
you
are not completely sure what is
You are correct it is not. :) You code is overly complex making it harder
to understand. Try and reduce the problem to the least number of tasks you
need.
From the Zen of Python, Simple is better than complex. It is a good
programming
mentality.
Complex is better than complicated. :p
2.
Um, at least by my understanding, the use of Pickle is also dangerous if
you
are not completely sure what is being passed in:
Oh goodness yes. pickle is exactly as unsafe as eval is. Try running this
code:
from pickle import loads
Thu, Mar 29, 2012 at 9:36 AM, Anatoli Hristov toli...@gmail.com wrote:
Um, at least by my understanding, the use of Pickle is also dangerous
if you are not completely sure what is being passed in:
Oh goodness yes. pickle is exactly as unsafe as eval is. Try running
this code:
from
Thank you Ramit for your advice`s. I`m reading a book ( Learning Python,
Second Edition ) by Mark Lutz and David Ascher and now I just finished the
Basic Function lesson :) I will keep in mind what you have advised me, but
will implement it later when I have more experience with the book, because
It is considered polite to post your reply either after the quoted text
or interspersed as I have done below.
By the way I dont know why your mail was in my junk I just saw it.
Probably because I only reply back to the list and let the list
forward to you.
And here is my last code I did for
On 03/27/12 10:32, Prasad, Ramit wrote:
fileread = open('myfile.txt','r')
tbook = eval(fileread.read())
fileread.close()
The use of eval is dangerous if you are not *completely* sure what is
being passed in. Try using pickle instead:
http://docs.python.org/release/2.5.2/lib/pickle-example.html
This was difficult, now I feel more confused it works, but I`m sure its
not the way you wanted :)
The use of eval is dangerous if you are not *completely* sure what is
being passed in. Try using pickle instead:
http://docs.python.org/release/2.5.2/lib/pickle-example.html
I`m sure about
Thanks, but I`m still far from for dose details I thing:)
Regards
Anatoli
On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase python.l...@tim.thechases.comwrote:
On 03/27/12 10:32, Prasad, Ramit wrote:
fileread = open('myfile.txt','r')
tbook = eval(fileread.read())
fileread.close()
The use of
On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote:
### CODE #
fileread = open('myfile.txt','r')
tbook = eval(fileread.read())
fileread.close()
The use of eval is dangerous if you are not *completely* sure what is
being passed in. Try using pickle instead:
def load_book():
load_book = open('c:/Python27/Toli/myfile.txt', 'r')
load_book = eval(load_book.read())
return load_book
def write_book(tbook):
write_book = open('c:/Python27/Toli/myfile.txt', 'w')
write_book.write(str(tbook))
def details(choice):
sb =
On 03/27/12 16:53, Anatoli Hristov wrote:
On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase wrote:
On 03/27/12 10:32, Prasad, Ramit wrote:
fileread = open('myfile.txt','r')
tbook = eval(fileread.read())
fileread.close()
The use of eval is dangerous if you are not *completely* sure what is
being
On Tue, Mar 27, 2012 at 5:59 PM, Evan Driscoll drisc...@cs.wisc.edu wrote:
The use of eval is dangerous if you are not *completely* sure what is
being passed in. Try using pickle instead:
http://docs.python.org/release/2.5.2/lib/pickle-example.html
Um, at least by my understanding, the use
Hi guys just wanted to share one of my first programs. Could you please
tell me, do I use a right logic ?
It works fine what I wanted to do, but is it writen in the right way? My
next step is to make it write the changes of the dictionary on the file :)
When you do get that far, you should
19 matches
Mail list logo