Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54446

Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?

From Dave Angel <davea@davea.name>
Subject Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?
Date 2013-09-19 20:18 +0000
References <22b99b0a-598f-4500-9de9-5041c2ce2c8f@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.163.1379621946.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 19/9/2013 14:46, William Bryant wrote:

> the word 'def' has  squiggily lines but the program works fine. It says: Syntax Error: expected an indented block. - why?
>

The direct answer is that your terminal program must be broken.  it
should not use "squiggly lines" for any purposes.

But perhaps you're not seeing this in terminal, but in some text editor.
Better specify what that is.

As for the "Syntax Error..."   Better supply the entire traceback.  I
can't see how you consider that error message as "working."

> def restart():

Better give it a different name, since you're using this same name as a
local within the function.

>     print("""
>
>     ~~~~~~~~~~~~~~~~
>
>     Cacluation DONE!
>
>     ~~~~~~~~~~~~~~~~
>
>     """)
>     restart = input("\nEnter yes if you want to make a new list and no if you want to close the program (yes/no):  ")
>     restart

This line does nothing, as has been pointed out before in other
messages. of yours.  You're not printing it, assigning it to something,
calling it, or whatever.

>     if restart == "yes" or restart == "y" or restart == "new list":
>         print("You want make a new list...\n")
>         time.sleep(1)
>         NOS()

There's no such function.

>     elif restart == "no" or restart == "n" or restart == "close":
>         print("Goodbye!")
>         time.sleep(1)
>         print("Goodbye!")
>         time.sleep(1)
>         print("Goodbye!")
>         time.sleep(1)
>         print("Goodbye!")
>         time.sleep(1)
>         print("Goodbye!")
>         time.sleep(1)
>         quit()

No such function.

>     else:
>         print("type y or n")
>         time.sleep(0.5)
>         restart()

You're using recursion when a simple loop is called for.

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-19 11:46 -0700
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? John Gordon <gordon@panix.com> - 2013-09-19 18:51 +0000
    Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? patrick vrijlandt <patrick.vrijlandt@gmail.com> - 2013-09-19 19:08 +0000
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 13:01 -0600
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-19 20:18 +0000
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 17:09 -0600
    Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 00:01 -0700
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Ray Wing <wrw@mac.com> - 2013-09-20 09:04 -0400
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Duncan Booth <duncan.booth@invalid.invalid> - 2013-09-20 13:39 +0000
        Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 22:59 -0700
        Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 23:07 -0700
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-21 10:25 +0000
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 12:53 +0000
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? MRAB <python@mrabarnett.plus.com> - 2013-09-21 17:18 +0100
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 18:09 +0000
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? alex23 <wuwei23@gmail.com> - 2013-09-23 10:39 +1000

csiph-web