[BangPypers] BangPypers Digest, Vol 8, Issue 15

Anand Balachandran Pillai abpillai at gmail.com
Thu May 1 07:36:05 CEST 2008


This is a common pitfall encountered by the brand-newbie.
Use a good editor which does a good job of "untabifying"
your code.

I use emacs+python-mode. I use tabs for writing my code
since it is easy to indent code using tabs in emacs. I have defined
a macro which converts tabs to spaces when saving the file.

Make sure you use some good editor which allows you
complete control over your tabs and spaces. Refer to previous
discussions on Python editors in this list if you want some guidance.

--Anand

On Wed, Apr 30, 2008 at 8:01 PM, Banibrata Dutta
<banibrata.dutta at gmail.com> wrote:
> As Rohan mentions...
>
> "Be careful: do not mix tabs and spaces in a code block;"
>
>  It is one of the first pitfalls a Python newbie comes-accross, if you
>  do not use a good Python source editor / IDE.
>
>  There are some file editors that do automatic indentation by "tab"
>  insertion while writing code, but when you go back to edit that line,
>  it seems to insert spaces.
>
>
>
>  On 4/30/08, Rohan Sharma <gates.plusplus at gmail.com> wrote:
>  > I'm not sure what the problem is. Could you show the snippets you are
>  > referring to?
>  >
>  > An else-if ladder looks like this:
>  >
>  > x = int(raw_input())
>  > if x < 0:
>  >        print "Negative"
>  > elif x == 0:
>  >        print "Zero"
>  > else:
>  >        print "Positive"
>  >
>  > Be careful: do not mix tabs and spaces in a code block; I suggest
>  > using tabs exclusively.
>  >
>  > On Wed, Apr 30, 2008 at 5:18 PM, srinivasarao puvvala
>  > <srinivas_puvvala at yahoo.co.in> wrote:
>  > >
>  > > hi,
>  > > i have recently started learning python programming.
>  > > i got confused with "identation" problems.
>  > > when ever i write if else if statements and try excute those i got errors like
>  > > "unexcpected indent" "syntax error".
>  > > i have tried diffrent example provided by the python tutorial.
>  > > but i cann't slove that problem.
>  > > pls any body help me to give the proper idea on "identation" and give me code of if else if statements which will definatley excute if i copy the code.
>  > > pls help me .
>  > >
>  > >
>  > > --- On Tue, 29/4/08, bangpypers-request at python.org <bangpypers-request at python.org> wrote:
>  > >
>  > > From: bangpypers-request at python.org <bangpypers-request at python.org>
>  > > Subject: BangPypers Digest, Vol 8, Issue 15
>  > > To: bangpypers at python.org
>  > > Date: Tuesday, 29 April, 2008, 3:30 PM
>  > >
>  > > Send BangPypers mailing list submissions to
>  > >       bangpypers at python.org
>  > >
>  > > To subscribe or unsubscribe via the World Wide Web, visit
>  > >       http://mail.python.org/mailman/listinfo/bangpypers
>  > > or, via email, send a message with subject or body 'help' to
>  > >       bangpypers-request at python.org
>  > >
>  > > You can reach the person managing the list at
>  > >       bangpypers-owner at python.org
>  > >
>  > > When replying, please edit your Subject line so it is more specific
>  > > than "Re: Contents of BangPypers digest..."
>  > >
>  > >
>  > > Today's Topics:
>  > >
>  > >    1. Re: How can I read an excel sheet using python ? (KartheeK)
>  > >    2. Re: How can I read an excel sheet using python ?
>  > >       (Anand Balachandran Pillai)
>  > >    3. Re: How can I read an excel sheet using python ? (Maxin B John)
>  > >
>  > >
>  > > ----------------------------------------------------------------------
>  > >
>  > > Message: 1
>  > > Date: Mon, 28 Apr 2008 11:13:34 +0100 (BST)
>  > > From:
>  > >  KartheeK <kartheekpn at yahoo.co.in>
>  > > Subject: Re: [BangPypers] How can I read an excel sheet using python ?
>  > > To: bangpypers at python.org
>  > > Message-ID: <434410.48055.qm at web8501.mail.in.yahoo.com>
>  > > Content-Type: text/plain; charset="iso-8859-1"
>  > >
>  > > Hi,
>  > >
>  > > Why dont u export it to a ,txt file and then read it as a normal file..
>  > >
>  > > KartheeK
>  > >
>  > > sambasivareddy <sambasivareddy.s at patni.com> wrote:              Hi all,
>  > >
>  > >   Need help on ?How can I read an excel sheet using python??
>  > >   If any one have any example please send to me. Thanks in advance.
>  > >
>  > >     Thanks and Regards,
>  > >   Sambasivareddy.S
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > http://www.patni.com
>  > >  World-Wide Partnerships. World-Class Solutions.
>  > >  _____________________________________________________________________
>  > >
>  > >  This e-mail message may contain proprietary, confidential or legally
>  > > privileged information for the sole use of the person
>  > >  or entity to whom this
>  > > message was originally addressed. Any review, e-transmission dissemination or
>  > > other use of or taking of any action in reliance upon this information by
>  > > persons or entities other than the intended recipient is prohibited. If you
>  > > have received this e-mail in error kindly delete  this e-mail from your
>  > > records. If it appears that this mail has been forwarded to you without proper
>  > > authority, please notify us immediately at netadmin at patni.com and delete this
>  > > mail.
>  > >  _____________________________________________________________________
>  > > _______________________________________________
>  > > BangPypers mailing list
>  > > BangPypers at python.org
>  > > http://mail.python.org/mailman/listinfo/bangpypers
>  > >
>  > > -------------- next part --------------
>  > > An HTML attachment was
>  > >  scrubbed...
>  > > URL:
>  > > <http://mail.python.org/pipermail/bangpypers/attachments/20080428/e72362aa/attachment-0001.htm>
>  > >
>  > > ------------------------------
>  > >
>  > > Message: 2
>  > > Date: Mon, 28 Apr 2008 15:50:15 +0530
>  > > From: "Anand Balachandran Pillai" <abpillai at gmail.com>
>  > > Subject: Re: [BangPypers] How can I read an excel sheet using python ?
>  > > To: "Bangalore Python Users Group - India"
>  > > <bangpypers at python.org>
>  > > Message-ID:
>  > >       <8548c5f30804280320r39c08c9as3b88b1d884c4b85c at mail.gmail.com>
>  > > Content-Type: text/plain; charset=UTF-8
>  > >
>  > > http://snippets.dzone.com/posts/show/2036
>  > >
>  > > You need pywin32 for this.
>  > >
>  > > Why not google stuff yourself before posting to the list ? Saves everyones
>  > > time.
>  > >
>  > > --Anand
>  > >
>  > > On Mon, Apr 28, 2008 at 3:43 PM, KartheeK <kartheekpn at yahoo.co.in> wrote:
>  > > > Hi,
>  > > >
>  > > > Why dont u export it to a ,txt file and then read it as a normal file..
>  > > >
>  > > >
>  > >  KartheeK
>  > > >
>  > > >
>  > > > sambasivareddy <sambasivareddy.s at patni..com> wrote:
>  > > >
>  > > >
>  > > >
>  > > > Hi all,
>  > > >
>  > > > Need help on "How can I read an excel sheet using python"?
>  > > > If any one have any example please send to me. Thanks in advance.
>  > > >
>  > > >
>  > > > Thanks and Regards,
>  > > > Sambasivareddy.S
>  > > >
>  > > >
>  > > > http://www.patni.com
>  > > >  World-Wide Partnerships. World-Class Solutions.
>  > > >  _____________________________________________________________________
>  > > >
>  > > >  This e-mail message may contain proprietary, confidential or legally
>  > > > privileged information for the sole use of the person or entity to whom
>  > > this
>  > > > message was originally addressed. Any review, e-transmission dissemination
>  > > > or other use of or taking of any action in reliance upon this information
>  > > by
>  > > > persons or entities other than the intended recipient is prohibited.
>  > >  If
>  > > you
>  > > > have received this e-mail in error kindly delete this e-mail from your
>  > > > records. If it appears that this mail has been forwarded to you without
>  > > > proper authority, please notify us immediately at netadmin at patni.com and
>  > > > delete this mail.
>  > > >  _____________________________________________________________________
>  > > > _______________________________________________
>  > > >
>  > > > BangPypers mailing list
>  > > > BangPypers at python.org
>  > > > http://mail.python.org/mailman/listinfo/bangpypers
>  > > >
>  > > >
>  > > > _______________________________________________
>  > > >  BangPypers mailing list
>  > > >  BangPypers at python.org
>  > > >  http://mail.python.org/mailman/listinfo/bangpypers
>  > > >
>  > > >
>  > >
>  > >
>  > >
>  > > --
>  > > -Anand
>  > >
>  > >
>  > > ------------------------------
>  > >
>  > > Message: 3
>  > > Date: Mon, 28 Apr 2008 11:29:07 +0100 (BST)
>  > > From: Maxin B John <maxin_john at yahoo.co.uk>
>  > > Subject: Re:
>  > >  [BangPypers] How can I read an excel sheet using python ?
>  > > To: bangpypers at python.org
>  > > Message-ID: <91803.62659.qm at web26611.mail.ukl.yahoo.com>
>  > > Content-Type: text/plain; charset="iso-8859-1"
>  > >
>  > >   Dear  Sambasivareddy,
>  > >   Hi all,
>  > >
>  > >
>  > >
>  > > Need help on "How can I read an excel sheet using python"?
>  > >
>  > >   Try the xlrd module (http://pypi.python.org/pypi/xlrd/0.5.2).
>  > >
>  > >
>  > >
>  > > If any one have any example please send to me. Thanks in advance.
>  > >
>  > > Example is available in that module itself.
>  > >
>  > > Thanks and Regards,
>  > >
>  > > Sambasivareddy.S
>  > >
>  > > Regards,
>  > >
>  > >   Maxin B John
>  > >   Kerala
>  > >
>  > >
>  > >
>  > > ---------------------------------
>  > > Sent from Yahoo! Mail.
>  > > A Smarter Email.
>  > > -------------- next part --------------
>  > > An HTML attachment was
>  > >  scrubbed...
>  > > URL:
>  > > <http://mail.python.org/pipermail/bangpypers/attachments/20080428/20b60769/attachment-0001.htm>
>  > >
>  > > ------------------------------
>  > >
>  > > _______________________________________________
>  > > BangPypers mailing list
>  > > BangPypers at python.org
>  > > http://mail.python.org/mailman/listinfo/bangpypers
>  > >
>  > >
>  > > End of BangPypers Digest, Vol 8, Issue 15
>  > > *****************************************
>  > >
>  > > ________________________________
>  > > Get the freedom to save as many mails as you wish. Click here to know how.
>  > > _______________________________________________
>  > > BangPypers mailing list
>  > > BangPypers at python.org
>  > > http://mail.python.org/mailman/listinfo/bangpypers
>  > >
>  > _______________________________________________
>  > BangPypers mailing list
>  > BangPypers at python.org
>  > http://mail.python.org/mailman/listinfo/bangpypers
>  >
>
>
>  --
>  regards,
>  Banibrata
>  http://www.linkedin.com/in/bdutta
>
>
> _______________________________________________
>  BangPypers mailing list
>  BangPypers at python.org
>  http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
-Anand


More information about the BangPypers mailing list