Skip to main content

A python package to help transfer data between programs.

Project description

This python package is designed to transfer binary data between Python scripts easily. This package uses a filesystem server to store data even when your program is closed and is not limited to RAM storage, but instead, your Hard Drive storage.



Basic Usage:


Script 1:
    import localsockets
    s = localsockets.socket()
    id = s.id
    # send s.id to the other script
    # wait until other script connects
    while not s.connected():
        pass
    # Now something has connected to our server. 
    s.send(b'hello') # send some data
    # servers can also receive data
    s.opend() # False
    s.connected() # False
    s.open() # reopen the server. Now you can reconnect. 

Script 2
    import localsockets
    id = # your received id
    s = localsockets.socket(id)
    s.connected() # True
    s.recv(1024) # receive up to 1024 bytes of data; returns b'hello'
    # connections can also send data
    s.close() # disconnect
    s.opened() # False
    s.connected() # False

Saving servers to a custom directory:
    import localsockets
    localsockets.SERVER_DIR = "< Your new directory > "

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

localsockets-0.0.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

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