[Tutor] folder and module

linda.s samrobertsmith at gmail.com
Mon Sep 18 11:26:59 CEST 2006


> Hi Linda,
>
> what do you get when you try:
>
>  >>> import os
>  >>> os.getcwd()
>
> The current working directory is represented in sys.path as the first
> element:
>
>  >>> import sys
>  >>> sys.path[0]
> ''
>
>
> Not the most intuitive, perhaps.
>
> I suspect you are launching your Python environment from a desktop
> icon. That would explain why import can `see' your Desktop, even
> though it doesn't at first glance seem to be in sys.path.
You are right!!! I launched Python environment from a desktop icon.


More information about the Tutor mailing list