Skip to main content

Library for calling methods over sockets

Project description

Installing

To install use the command python -m pip install Network-Script.

Basic Tutorial

Server

To start off import the Server class:

from netsc import Server

Then create a subclass of the Server class, defining bind_addr and possibly sock_family, sock_type, and sock_proto:

class MyServer(Server):
    bind_addr = ('', 1920)

Then create an instance, define the object it wraps, and accept a connection:

server = MyServer(wrapped_obj)
server.accept()

Client

To start off import the Client class:

from netsc import Client

Then create a subclass of the Client class, possibly defining sock_family, sock_type, and sock_proto:

class MyClient(Client):
    pass

Then create an instance, define the object it wraps, and connect to a server:

client = MyClient(wrapped_obj)
client.connect(('localhost', 1920))

From then

From now on one end can call the poll method, and the other end can then call any method and get any attribute of the wrapped class. Note concerning attributes: to get an attribute the attribute must be listed in the attrs attribute of the end initiating the attribute get.

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

Network Script-1.0.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

Network_Script-1.0.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file Network Script-1.0.3.tar.gz.

File metadata

  • Download URL: Network Script-1.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for Network Script-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7bcb1d6fcb667003af7ac9cc2a2268955277ab033ec46bb88e05c396cc7e3477
MD5 849102dc7a21bf3be5d56478dfc80d83
BLAKE2b-256 58a345575d5655ba8ed37ac5afe2f18f6cf387b7faa51c57f57373f624787d07

See more details on using hashes here.

File details

Details for the file Network_Script-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: Network_Script-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for Network_Script-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce94ad81d1af87deedfa99fe5a819980a07a0b9408d90ee791e8e5bcf0df48bb
MD5 c096fe9b41e0f68ea0d1bcf6df2d8f0d
BLAKE2b-256 df393c7f02bf5330d906e908bdc37e4b40ab205ed00e379d112a010df80a3a6f

See more details on using hashes here.

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