GithubHelp home page GithubHelp logo

lucasferro0 / search-in-file Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9.18 MB

Biblioteca criada em Python para realizar algumas ações com arquivo .txt

License: MIT License

Python 99.07% Shell 0.01% HTML 0.16% CSS 0.52% TeX 0.04% JavaScript 0.09% PowerShell 0.11% Batchfile 0.01%

search-in-file's Introduction

Projeto de uma biblioteca em Python para realizar algumas ações com arquivos .txt

1° COMO INSTALAR A BIBLIOTECA ?

Para instalar a biblioteca no seu projeto Python, acesse o link: https://pypi.org/project/SearchInFile/1.0.0/ e siga as intruções.

Ou você pode simplesmente digitar pip install SearchInFile no seu terminal.

Após isso, a biblioteca será instalada no seu projeto.

2° COMO USAR A BIBLIOTECA ?

Para você usar a biblioteca, é necessário realizar o import dela.

Há diversas formas de realizar o import de uma biblioteca e usá-la, veja os exemplos a seguir:


     import search.find

     arquivo = search.find.MyFile('exemplo.txt')  # instancia a classe MyFile(), passando como parâmetro o nome do arquivo .txt

    from search import find

    arquivo = find.MyFile('exemplo.txt')

    from search.find import *
    
    arquivo = MyFile("exemplo.txt")

3° Métodos/funções disponíveis para você usar:


    from search import find

    arquivo = find.MyFile('exemplo.txt')
    
    if arquivo.exist():
      print("A conexão com o arquivo foi realizada com sucesso.")
    else:
      print("A conexão com o arquivo não foi realizada.")

  quantidadeDePalavras = arquivo.qtdPalavras()
  print(quantidadeDePalavras)

  CincoMaioresPalavras = arquivo.maioresPalavras()
  print(CincoMaioresPalavras)

  vogalMaisFrequente = arquivo.vogalFrequente()
  print(vogalMaisFrequente)

  linhaComString = arquivo.findString("exemplo") # Essa função vai encontrar as linhas nas quais tem a string exemplo
  print(linhaComString)

search-in-file's People

Contributors

lucasferro0 avatar trellixvulnteam avatar

Watchers

 avatar

Forkers

trellixvulnteam

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.