glob.glob output

Hitesh hitesh287 at gmail.com
Mon Mar 12 14:12:15 EDT 2007


On Mar 12, 1:58 pm, "Hitesh" <hitesh... at gmail.com> wrote:
> import string
> import os
>
> f = open ("c:\\servername.txt", 'r')
> linelist = f.read()
>
> lineLog = string.split(linelist, '\n')
> lineLog = lineLog [:-1]
> #print lineLog
> for l in lineLog:
>     path1 = "\\\\" + l + "\\server*\\*\\xtRec*"
>     glob.glob(path1)
>
> When I run above from command line python, It prints the output of
> glob.glob but when I run it as a script, it does not print
> anything.... I know that there are files like xtRec* inside those
> folders.. and glob.glob does spits the path if run from python command
> line.
>
> I tried something like this but did not work:
> for l in lineLog:
>     path1 = "\\\\" + l + "\\server*\\*\\xtRec*"
>     xtRec = glob.glob(path1)
>     print xtRec
>
> No results...
>
> xtRec = []
> for l in lineLog:
>     path1 = "\\\\" + l + "\\server*\\*\\xtRec*"
>     xtrec = glob.glob(path1)
> print xtRec
>
>  No luck here either.
>
> Seems like I am doing here something reallt silly mistake..
>
> Thank you,
> hj


I am using pythonWin and command line means Interactive Shell.





More information about the Python-list mailing list