Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Write Better Python Cleaner Code Imports

plz tell where am i getting wrong

it's constantly showing this :- Bummer! Your file has 1 error(s) on line(s) 8: blank line at end of file

import os
import sys
import logging
from re import match
from re import search

2 Answers

Luc Dachary
Luc Dachary
2,231 Points

Hi Ashmit Pathak, I just made the exercise and I have not faced your problem. Could you make sure you inserted a new line after search import? Your file should be six lines long.

can u plz show it in a code so that i could understand it better and yaa! thanx for your help...

Luc Dachary
Luc Dachary
2,231 Points

Sure Ashmit Pathak, here your are:

import os  # no trailing space
import sys  # no trailing space
import logging  # no trailing space
from re import match  # no trailing space
from re import search  # no trailing space, hit enter once
# empty line below

Thanx for helping me it really worked

Hey there,

Hmm I got some weird end of file thing doing it too. make sure you delete anything after the last thing you type and hit return before submitting. Also you can leave the "from re import match, search" line as it was. That last one's more just a stylistic thing. IT will still work whether you tell it to import the modules in two different commands or one combined one, but lots of programmers like to group them together by way of organising the file.