threadedproxyobject


Namethreadedproxyobject JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/threadedproxyobject
SummaryThreaded Proxy Object
upload_time2024-06-06 01:35:47
maintainerNone
docs_urlNone
authorJohannes Fischer
requires_pythonNone
licenseMIT
keywords threads proxyobject
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Threaded Proxy Object

## pip install threadproxyobject

### Tested against Windows 10 / Python 3.11 / Anaconda


```PY
import pandas as pd
import random
from time import sleep
from threadedproxyobject import ThreadedProxyObject, ThreadedProxyObjectMultiExecute


def funct(x, y):
    return random.randint(x, y)


def funct2(x, y):
    return [x + y]


def funct3(x, y):
    while True:
        print(random.randint(x, y))
        sleep(1)


test = ThreadedProxyObject(funct, args=(1, 200))
test.start()
print(test)
sleep(1)
print((test) ** 10)

test2 = ThreadedProxyObject(funct2, args=(1, 200))
test2.start()
print((test2))
sleep(1)
test2.append(3)
print(test2)

test3 = ThreadedProxyObjectMultiExecute(fu=funct, args=(1, 200))
test3()
print((test3))
sleep(1)
print(test3 / 10)

test4 = ThreadedProxyObjectMultiExecute(fu=funct2, args=(1, 200))
test4()
sleep(1)
print(test4 * 10)

test5 = ThreadedProxyObjectMultiExecute(fu=funct3, args=(1, 200))
test5()
print((test5))
test5.kill()
test6 = ThreadedProxyObjectMultiExecute(fu=funct, daemon=False, args=(1, 200))
test6.start_timer_call(3)
sleep(4)
print((test6))
print(test6 + 10)
test6.stop_timer_call()


liste = [
    ThreadedProxyObjectMultiExecute(
        fu=funct, daemon=True, args=(1, 200)
    ).start_timer_call(3)
    for x in range(100)
]
sleep(2)
df = pd.DataFrame(liste)
print(df[0] * 2)

# 45
# 34050628916015625
# [201]
# [201, 3]
# 129
# 12.9
# [201, 201, 201, 201, 201, 201, 201, 201, 201, 201]
# 141
# N/A
# 151
# 161
# 0     128
# 1     314
# 2     220
# 3     102
# 4     220
#      ... 
# 95     72
# 96    314
# 97     24
# 98    144
# 99     24
# Name: 0, Length: 100, dtype: object

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/threadedproxyobject",
    "name": "threadedproxyobject",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "threads, ProxyObject",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/2a/f5bbd842f0c14265a605b44e4e39879f6776b07818e2f9e24c1a4afc5922/threadedproxyobject-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Threaded Proxy Object\r\n\r\n## pip install threadproxyobject\r\n\r\n### Tested against Windows 10 / Python 3.11 / Anaconda\r\n\r\n\r\n```PY\r\nimport pandas as pd\r\nimport random\r\nfrom time import sleep\r\nfrom threadedproxyobject import ThreadedProxyObject, ThreadedProxyObjectMultiExecute\r\n\r\n\r\ndef funct(x, y):\r\n    return random.randint(x, y)\r\n\r\n\r\ndef funct2(x, y):\r\n    return [x + y]\r\n\r\n\r\ndef funct3(x, y):\r\n    while True:\r\n        print(random.randint(x, y))\r\n        sleep(1)\r\n\r\n\r\ntest = ThreadedProxyObject(funct, args=(1, 200))\r\ntest.start()\r\nprint(test)\r\nsleep(1)\r\nprint((test) ** 10)\r\n\r\ntest2 = ThreadedProxyObject(funct2, args=(1, 200))\r\ntest2.start()\r\nprint((test2))\r\nsleep(1)\r\ntest2.append(3)\r\nprint(test2)\r\n\r\ntest3 = ThreadedProxyObjectMultiExecute(fu=funct, args=(1, 200))\r\ntest3()\r\nprint((test3))\r\nsleep(1)\r\nprint(test3 / 10)\r\n\r\ntest4 = ThreadedProxyObjectMultiExecute(fu=funct2, args=(1, 200))\r\ntest4()\r\nsleep(1)\r\nprint(test4 * 10)\r\n\r\ntest5 = ThreadedProxyObjectMultiExecute(fu=funct3, args=(1, 200))\r\ntest5()\r\nprint((test5))\r\ntest5.kill()\r\ntest6 = ThreadedProxyObjectMultiExecute(fu=funct, daemon=False, args=(1, 200))\r\ntest6.start_timer_call(3)\r\nsleep(4)\r\nprint((test6))\r\nprint(test6 + 10)\r\ntest6.stop_timer_call()\r\n\r\n\r\nliste = [\r\n    ThreadedProxyObjectMultiExecute(\r\n        fu=funct, daemon=True, args=(1, 200)\r\n    ).start_timer_call(3)\r\n    for x in range(100)\r\n]\r\nsleep(2)\r\ndf = pd.DataFrame(liste)\r\nprint(df[0] * 2)\r\n\r\n# 45\r\n# 34050628916015625\r\n# [201]\r\n# [201, 3]\r\n# 129\r\n# 12.9\r\n# [201, 201, 201, 201, 201, 201, 201, 201, 201, 201]\r\n# 141\r\n# N/A\r\n# 151\r\n# 161\r\n# 0     128\r\n# 1     314\r\n# 2     220\r\n# 3     102\r\n# 4     220\r\n#      ... \r\n# 95     72\r\n# 96    314\r\n# 97     24\r\n# 98    144\r\n# 99     24\r\n# Name: 0, Length: 100, dtype: object\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Threaded Proxy Object",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/threadedproxyobject"
    },
    "split_keywords": [
        "threads",
        " proxyobject"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8bb7ff599ca4014b002edee4786c0022c215c33cb2051a29493bb942d8516f97",
                "md5": "816cbf1a4d71057a15ae840de7154629",
                "sha256": "5f9f246339fc0679eea41796933b7a61cd40b2cb2f6f81a734c575aa6420cd89"
            },
            "downloads": -1,
            "filename": "threadedproxyobject-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "816cbf1a4d71057a15ae840de7154629",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6661,
            "upload_time": "2024-06-06T01:35:43",
            "upload_time_iso_8601": "2024-06-06T01:35:43.087360Z",
            "url": "https://files.pythonhosted.org/packages/8b/b7/ff599ca4014b002edee4786c0022c215c33cb2051a29493bb942d8516f97/threadedproxyobject-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c72af5bbd842f0c14265a605b44e4e39879f6776b07818e2f9e24c1a4afc5922",
                "md5": "ff28597f845f9e6f69aa36b411cf1948",
                "sha256": "930fa60fd67de866d25f138af23e777c6949fb073d6b2362714207c903f3b0fc"
            },
            "downloads": -1,
            "filename": "threadedproxyobject-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ff28597f845f9e6f69aa36b411cf1948",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6579,
            "upload_time": "2024-06-06T01:35:47",
            "upload_time_iso_8601": "2024-06-06T01:35:47.089084Z",
            "url": "https://files.pythonhosted.org/packages/c7/2a/f5bbd842f0c14265a605b44e4e39879f6776b07818e2f9e24c1a4afc5922/threadedproxyobject-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-06 01:35:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "threadedproxyobject",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "threadedproxyobject"
}
        
Elapsed time: 0.69012s