Skip to main content

A simple file search tools, you can easily sum all the files lines.

Project description

This is two function in this package, the first is visit and it visit all the file in the direction which you choose and the file whick you choose in type. It descriped as follow:
def visit(path,prex="",feature=print,istop=True):
'''
[path] is the path you want to visit
[prex] is the suffix you want to filter, the default is "", that is means visit all
[feature] is the function you want to call, default to call the print function and print all the file name with the path,and you cant use it to call you own function
[is top] to check the call is the top level, you may not use it
eg. you can can is like this -- visit(".","py",lines)
and if you just import visitor you can write like this -- visitor.visit(".","py",visitor.lines)
any problem or advice mailto hanyueqi123@163.com, thank you.
'''
An other function is line(), it sum the line all the file, and you can realize you own method by the name parameter and it will call by visit(). It descriped as follow:
def lines(file_name):
'''
This functon is to count the line in the file
[file_name] is the single file you want to visitor
'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_visitor-0.1.11.zip (1.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page