Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: execute python code in thread #97

Open
rayrayraykk opened this issue Mar 25, 2024 · 0 comments
Open

[Feature]: execute python code in thread #97

rayrayraykk opened this issue Mar 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rayrayraykk
Copy link
Collaborator

rayrayraykk commented Mar 25, 2024

The current implementation of exec_python_code is a multi-processing version, which should be in if __name__ == "__main__". We can implement it in the thread and mark it as TODO now.

Update about global var:

# Create a new global namespace dictionary
 global_namespace = {}

 # Copy the contents of the current global namespace into the new namespace dictionary
 global_namespace.update(globals())

 # Execute the provided code within the newly defined global context
 exec(code, global_namespace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant