Re: import os or import os.path

2011-09-06 Thread Joe Riopel
On Tue, Sep 6, 2011 at 5:25 PM, Jabba Laci wrote: > Hi, > > If I want to use the 'os.path' module, it's enought to import 'os': > > import os > if os.path.isfile('/usr/bin/bash'): >    print 'got it' > > In other source codes I noticed that people write 'import os.path' in > this case. Which is be

Re: import os or import os.path

2011-09-06 Thread Mark Hammond
On 7/09/2011 7:47 AM, Ian Kelly wrote: On Tue, Sep 6, 2011 at 3:25 PM, Jabba Laci wrote: Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'): print 'got it' In other source codes I noticed that people write 'import os.path'

Re: import os or import os.path

2011-09-06 Thread Ian Kelly
On Tue, Sep 6, 2011 at 3:25 PM, Jabba Laci wrote: > Hi, > > If I want to use the 'os.path' module, it's enought to import 'os': > > import os > if os.path.isfile('/usr/bin/bash'): >    print 'got it' > > In other source codes I noticed that people write 'import os.path' in > this case. Which is be

import os or import os.path

2011-09-06 Thread Jabba Laci
Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'): print 'got it' In other source codes I noticed that people write 'import os.path' in this case. Which is better practice? Thanks, Laszlo -- http://mail.python.org/mailman/