[Tutor] Relative import help

Dave Angel d at davea.name
Sat Sep 22 14:44:15 CEST 2012


On 09/22/2012 08:33 AM, Matthew Ngaha wrote:
>> You probably have a path that reaches into Domestic or Europe sub-package.
>> That can happen if e. g. Project/Domestic/Europe is your current working
>> directory.
>>
>> Try to cd into the Project folder's parent directory and see if
>>
>> $ python -c 'import Project.Domestic.Europe.winners'
>>
>> works.
> hey i am very new to programming:) what do you mean by Try to cd? how
> and where should i do that to type the code you provided?
>

cd is a shell command;  you do it before starting Python.  You didn't
mention what OS you're running, but cd should be about the same for
Linux, Windows, or Mac.

davea at think:~/pythonProject$ cd ..
davea at think:~$

-- 

DaveA



More information about the Tutor mailing list