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
> 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
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
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