Code Monkey home page Code Monkey logo

webrepl's Introduction

Webrepl

Bu çalışma, https://github.com/kost/webrepl-python çalışması düzenlenerek oluşturulmuştur.

Bu modül herhangi bir bağımlılık gerektirmez. Linkteki daha gelişmiş bir modül; https://github.com/Carglglz/upydev , fakat bağımlılıkları mevcut.

Kullanım

import webrepl

wr = Webrepl(host="192.168.1.38", password="123456")
wr.send("import os;os.listdir()")
wr.get_version()

Basitçe başka Thread'de çalıştırılabilir.

wr = Webrepl(host="192.168.1.38", password="123456")
wr.start_with_thread()

# Veri alışverişi şöyle yapılır;

# Veriyi gönderiyoruz ve bir kod döndürüyor bize
read_code = wr.send("os.listdir()")

# Arada cevapları kontrol ediyoruz. Bizim kodumuz cevapların içinde varsa,
if read_code in wr.messages:
  # Kodu ve cevabı alabiliyoruz
  code, resp = dev.messages.pop(i)

Metodlar

  • connect
  • disconnect
  • login
  • send -> Cevabı geri döndürür
  • read
  • get_version -> (1, 3, 0) gibi... döndürür
  • put_file -> local_file: Bizdeki dosya yolu, remote_file: Karşıda oluşturulacak dosya
  • put_file_content -> file_content: Dosya içeriği, remote_file: Karşıda oluşturulacak dosya
  • get_file_content -> remote_file: Karşıdaki dosya
  • get_file -> remote_file: Karşıdaki dosya, local_file: Bizdeki oluşturulacak dosya
  • listdir
  • remove_file
  • mkdir
  • rmdir
  • setup_files -> Bağlantı kurulduğunda karşıya otomatik yüklenmesini istediğim dosyalar. Henüz dosyaları ayarlamadım
  • reset
  • baudrate -> Henüz ayarlanmadı

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.