Re: [Tutor] Doubts galore.

2010-06-10 Thread Steve Willoughby
On Thu, Jun 10, 2010 at 09:43:34PM +0530, prasad rao wrote: > > It would probably be cleaner to use one-line > > conditional statements (sparingly) where they make > > sense on their own, but not to mix multi-line and > > single line styles in the same if-else structure. > > I am a newbie.I cou

Re: [Tutor] Doubts galore.

2010-06-10 Thread prasad rao
> Never NEVER compare for equality with None. > > What you want is: > if doc is None and data is None: > > Also, what is "sys.agv1"? Did you mean sys.argv[1]? yes > >elif doc: > > data=open(doc,'r').read() > > data_c= binascii.hexlify(data) > >else:data_c= bina

Re: [Tutor] Doubts galore.

2010-06-10 Thread Lie Ryan
On 06/11/10 01:14, prasad rao wrote: > Hi > > def cript(doc=None,data =None): >if doc==None and data==None:doc=sys.agv1 >elif doc: > data=open(doc,'r').read() > data_c= binascii.hexlify(data) >else:data_c= binascii.hexlify(data) >if doc: > q=tempfile.Tempor

Re: [Tutor] Doubts galore.

2010-06-10 Thread Steve Willoughby
On Thu, Jun 10, 2010 at 08:44:56PM +0530, prasad rao wrote: > Hi > > def cript(doc=None,data =None): >if doc==None and data==None:doc=sys.agv1 Never NEVER compare for equality with None. What you want is: if doc is None and data is None: Also, what is "sys.agv1"? Did you mean sys.arg