Title: Eel with threading doesn't recognize exposed functions. · Issue #703 · python-eel/Eel · GitHub
Open Graph Title: Eel with threading doesn't recognize exposed functions. · Issue #703 · python-eel/Eel
X Title: Eel with threading doesn't recognize exposed functions. · Issue #703 · python-eel/Eel
Description: *Describe the problem I am trying to start an Eel window then run the rest of main.py. Since eel.start() blocks the program, I used threading to run it separately. This works exactly how I want it to, except for a strange error. Whenever...
Open Graph Description: *Describe the problem I am trying to start an Eel window then run the rest of main.py. Since eel.start() blocks the program, I used threading to run it separately. This works exactly how I want it ...
X Description: *Describe the problem I am trying to start an Eel window then run the rest of main.py. Since eel.start() blocks the program, I used threading to run it separately. This works exactly how I want it ...
Opengraph URL: https://github.com/python-eel/Eel/issues/703
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Eel with threading doesn't recognize exposed functions.","articleBody":"**Describe the problem*\r\nI am trying to start an Eel window then run the rest of main.py. Since eel.start() blocks the program, I used threading to run it separately.\r\nThis works exactly how I want it to, except for a strange error. \r\nWhenever I run main.py, I get \"AttributeError: module 'eel' has no attribute 'reload'\"\r\nHowever, in VSCode, if I open the tab that contains index.html (without changing anything), then run main.py again, the program works perfectly.\r\n\r\n**Code snippet(s)**\r\nHere is some code that can be easily used to reproduce the problem or understand what I need help with.\r\n`#guiLaunch.py\r\n\r\nimport eel\r\n\r\ndef Init():\r\n eel.init('utils')\r\n\r\ndef OpenWeb():\r\n eel.start('index.html')\r\n\r\ndef Reload():\r\n eel.reload()`\r\n\r\n`#utils/index.html\r\n\r\n\u003cscript type=\"text/javascript\">\r\n eel.expose(reload);\r\n function reload() {\r\n window.location.reload();\r\n }\r\n\u003c/script>`\r\n\r\n`#main.py\r\n\r\nimport threading\r\nimport guiLaunch\r\n\r\nguiLaunch.Init()\r\nt1 = threading.Thread(target=guiLaunch.OpenWeb())\r\nt1.start()\r\n\r\n#in while loop roughly every 5 seconds:\r\neel.reload()`\r\n\r\n\r\nI read through the documentation and saw the recommendation of eel.start('index.html', block=False) and eel.spawn(), but this caused the site that was opened to not be found.\r\n\u003cimg width=\"339\" alt=\"image\" src=\"https://github.com/python-eel/Eel/assets/93734192/468dbd87-a761-49fa-9db5-4090a62e6544\">\r\n\r\n\r\n**Desktop**\r\n - OS: Windows\r\n - Browser Chrome\r\n - Version Chrome 117.0.5938.132\r\n\r\n\r\n","author":{"url":"https://github.com/Carter03","@type":"Person","name":"Carter03"},"datePublished":"2023-10-02T23:26:11Z","url":"https://github.com/python-eel/Eel/issues/703"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:646a54e0-21cb-1978-c1e1-5a08d5e0dba0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 856E:22B196:57B8C8:7FD070:6AFDD3C5 |
| html-safe-nonce | f60465680da9dbbf14aaee2c6ec1c489aee2b6ec530262ab983c99a93b686052 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTZFOjIyQjE5Njo1N0I4Qzg6N0ZEMDcwOjZBRkREM0M1IiwidmlzaXRvcl9pZCI6Ijc2MzczMDI0OTgxMjU3OTYyOTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e9b3f17bd22e93351b311e3a4e55c1c17413f3a83c6bc06b937ffec594941d21 |
| hovercard-subject-tag | issue:1922984039 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-eel/Eel/703/issue_layout |
| twitter:image | https://opengraph.githubassets.com/446be86e53be805f91690867183a3252f9d31eccadc42e0b09329c58580f7d91/python-eel/Eel/issues/703 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/446be86e53be805f91690867183a3252f9d31eccadc42e0b09329c58580f7d91/python-eel/Eel/issues/703 |
| og:image:alt | *Describe the problem I am trying to start an Eel window then run the rest of main.py. Since eel.start() blocks the program, I used threading to run it separately. This works exactly how I want it ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Carter03 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26886a40b582b821a7a76351e0a2f42b6d6160854b6e2520db24f31fd7be5da7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-eel/Eel git https://github.com/python-eel/Eel.git |
| octolytics-dimension-user_id | 114726397 |
| octolytics-dimension-user_login | python-eel |
| octolytics-dimension-repository_id | 115559503 |
| octolytics-dimension-repository_nwo | python-eel/Eel |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 115559503 |
| octolytics-dimension-repository_network_root_nwo | python-eel/Eel |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 68ebaa631a1d248d69ebde4b9c5defd3a19aeb2f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width