[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Regexp problem when parsing a string

MRAB

3/21/2010 6:32:00 PM

Alessandro Marino wrote:
> I'm a beginner and I was trying to write a program to
> parse recursively all file names in a directory specified as parameter.
> The problem is that I get a "None" printed to stdout when a file is
> positively matched. While when the file name doesn't match the regexp
> the output seems ok.
>
> C:\>c:\python.exe g:\a.py sample
> ====> foo - bar.txt , first part is: foo
> None
> skipping: foo.txt
>
> Instead I expect an output like this one:
>
> C:\>c:\python.exe g:\a.py sample
> ====> foo - bar.txt , first part is: foo
> None
> skipping: foo.txt
>
> Could anyone help me to figure out why "None" appears in the putput?
>
> Thanks and regards,
> Ale
>
It's caused by:

print saveData(file, m)

The function saveData() returns None, which is then printed.