Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected indent / invalid syntax
#3
Quote:"""Above will create a folder called comppdf, and wsgeo wherever the WOGCC
File Downloads file is run from as well as a text file for my api file to
reside."""
This type of comment should immediately follow the 'def' for a method, and should be indented.
For example, above should be like this:
[python]
import requests
from bs4 import BeautifulSoup
from pathlib import Path


class GetCompletions:
    def __init__(self, infile):
        """Above will create a folder called comppdf, and wsgeo wherever the WOGCC
           File Downloads file is run from as well as a text file for my api file to
           reside.
        """
Also, in line:
from pathlib import path
path needs upper case like:
from pathlib import Path
Reply


Messages In This Thread
Unexpected indent / invalid syntax - by tjnichols - May-13-2018, 08:56 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-14-2018, 02:26 AM
RE: Unexpected indent / invalid syntax - by nilamo - May-14-2018, 06:24 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-14-2018, 11:14 PM
RE: Unexpected indent / invalid syntax - by wavic - May-14-2018, 11:50 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-15-2018, 12:25 AM
RE: Unexpected indent / invalid syntax - by nilamo - May-15-2018, 04:01 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-15-2018, 09:25 PM
RE: Unexpected indent / invalid syntax - by nilamo - May-15-2018, 09:55 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-16-2018, 01:06 AM
RE: Unexpected indent / invalid syntax - by wavic - May-16-2018, 02:23 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-16-2018, 03:04 PM
RE: Unexpected indent / invalid syntax - by wavic - May-16-2018, 03:07 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-16-2018, 03:13 PM
RE: Unexpected indent / invalid syntax - by wavic - May-16-2018, 03:26 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-16-2018, 05:03 PM
RE: Unexpected indent / invalid syntax - by Larz60+ - May-16-2018, 05:37 PM
RE: Unexpected indent / invalid syntax - by wavic - May-16-2018, 05:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndentationError: unexpected indent in views.py ift38375 1 2,545 Dec-08-2019, 02:33 PM
Last Post: michael1789
  IndentationError: unexpected indent salahhadjar 2 4,425 Nov-04-2018, 06:10 PM
Last Post: salahhadjar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020