Git Product home page Git Product logo

linuxtools's Introduction

linuxtools

some minitools create in linux os that are program with python

1. wordcounter: 多进程分段读取大文件,并统计词频

默认为10M以下文件,直接单进程读取;10M以上,分128个进程来读取(在本机上试验发现128个进程数的速度是相对较快的,test里面的wordcounter_multiprocesses可以对比不同进程数的读取速度)

采用chardet自动判断文件编码

How to use:

pip install chardet

python wordcounter file1 file2 [--coding=utf-8] [--workers=64]  # 其中file1为要分析的文件名,file2是分析结果要写入的文件名, []里的为可选项,coding为编码,workers为要采用的进程数(默认为cpu数量的64倍)。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.