Coder Social home page Coder Social logo

pythonstudy's Introduction

PythonStudy

首先程序的功能是:输入一个要匹配关键字的文本目录,然后即可输出该目录下所有txt的的关注点个数; 那么程序功能如何实现呢? 主要就是在关注点的txt文件里面用readline().strip(),然后用while循环in到太空旅客的txt文本里面,每匹配一个关注点成功即加一,然后读取下一行关注点,这样就可以输出一个txt所有关注点的个数了,那么如何输入目录来实现自动匹配该目录下所有txt文本呢,我百度了一下,并使用了OS模块,然后通过GetFileList()函数来建立目录下所有txt文件的列表,用for循环遍历txt文本并执行关键操作。

pythonstudy's People

Contributors

tingshine avatar

Watchers

James Cloos avatar

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.