René's URL Explorer Experiment


Title: add a scope class to manage the context of interaction with Python an… by yagweb · Pull Request #381 · pythonnet/pythonnet · GitHub

Open Graph Title: add a scope class to manage the context of interaction with Python an… by yagweb · Pull Request #381 · pythonnet/pythonnet

X Title: add a scope class to manage the context of interaction with Python an… by yagweb · Pull Request #381 · pythonnet/pythonnet

Description: It‘s a prototype of this proposal here to help its discussion. Modifications are located at file pythonengine.cs, A class named PyScope was added for the variable management and exchanging between .NET and Python. Several unit tests were given in a new file "src/embed_tests/pyscope.cs" which can be used as examples. One of the example, using (Py.GIL()) { dynamic ps = Py.CreateScope(); ps.Set("bb", 100); //declare a variable ps.cc = 10; //declare a variable dynamically int aa = ps.Eval("bb+cc+3"); //113 //add a function to the scope, and call it //global keyword was used here to show what pyscope can do ps.aa = 0; ps.Exec( "def func1():\n" + " global aa \n" + " aa = bb+cc+3 \n" ); ps.func1(); //call the function int aa1 = ps.Get("aa"); //get variable int aa2 = ps.aa.As(); //get variable dynamically //create a new scope and import the variables PyScope ps2 = ps.CreateScope(); ps2.ImportModule("numpy", "np"); var aa3 = ps2.Eval("np.sin(bb)"); }

Open Graph Description: It‘s a prototype of this proposal here to help its discussion. Modifications are located at file pythonengine.cs, A class named PyScope was added for the variable management and exchanging between ...

X Description: It‘s a prototype of this proposal here to help its discussion. Modifications are located at file pythonengine.cs, A class named PyScope was added for the variable management and exchanging between ...

Opengraph URL: https://github.com/pythonnet/pythonnet/pull/381

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:736f4f9c-439f-aa96-d3fa-614652707e68
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEB68:1C0428:142796:1C5E8B:6970A144
html-safe-nonced3e5faa38d9cbe7e6b56ef594b25cec6139e6d51b6686d320938bb1727bc866b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjY4OjFDMDQyODoxNDI3OTY6MUM1RThCOjY5NzBBMTQ0IiwidmlzaXRvcl9pZCI6IjE1NTQyOTQwNDcwOTIyODU3NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac814230ce3afbf01dc6e49607f29692723a89649fbb7f8bb7aea7bb411193d5cc
hovercard-subject-tagpull_request:106350371
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/pythonnet/pythonnet/pull/381/files
twitter:imagehttps://avatars.githubusercontent.com/u/13247575?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/13247575?s=400&v=4
og:image:altIt‘s a prototype of this proposal here to help its discussion. Modifications are located at file pythonengine.cs, A class named PyScope was added for the variable management and exchanging between ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb06a4c45c45fd0bb038b3759265ea6e38211f45d18130bc65261990be6b5972a
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git
octolytics-dimension-user_id6050430
octolytics-dimension-user_loginpythonnet
octolytics-dimension-repository_id14748123
octolytics-dimension-repository_nwopythonnet/pythonnet
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14748123
octolytics-dimension-repository_network_root_nwopythonnet/pythonnet
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0e1c4964831785bd64cb22d82e7cf2391ae01f45
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pythonnet/pythonnet/pull/381/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpythonnet%2Fpythonnet%2Fpull%2F381%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpythonnet%2Fpythonnet%2Fpull%2F381%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=pythonnet%2Fpythonnet
Reloadhttps://github.com/pythonnet/pythonnet/pull/381/files
Reloadhttps://github.com/pythonnet/pythonnet/pull/381/files
Reloadhttps://github.com/pythonnet/pythonnet/pull/381/files
pythonnet https://github.com/pythonnet
pythonnethttps://github.com/pythonnet/pythonnet
Notifications https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Fork 770 https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Star 5.4k https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Code https://github.com/pythonnet/pythonnet
Issues 155 https://github.com/pythonnet/pythonnet/issues
Pull requests 18 https://github.com/pythonnet/pythonnet/pulls
Discussions https://github.com/pythonnet/pythonnet/discussions
Actions https://github.com/pythonnet/pythonnet/actions
Projects 0 https://github.com/pythonnet/pythonnet/projects
Wiki https://github.com/pythonnet/pythonnet/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/pythonnet/pythonnet/security
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
Insights https://github.com/pythonnet/pythonnet/pulse
Code https://github.com/pythonnet/pythonnet
Issues https://github.com/pythonnet/pythonnet/issues
Pull requests https://github.com/pythonnet/pythonnet/pulls
Discussions https://github.com/pythonnet/pythonnet/discussions
Actions https://github.com/pythonnet/pythonnet/actions
Projects https://github.com/pythonnet/pythonnet/projects
Wiki https://github.com/pythonnet/pythonnet/wiki
Security https://github.com/pythonnet/pythonnet/security
Insights https://github.com/pythonnet/pythonnet/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpythonnet%2Fpythonnet%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpythonnet%2Fpythonnet%2Fissues%2Fnew%2Fchoose
den-run-aihttps://github.com/den-run-ai
pythonnet:masterhttps://github.com/pythonnet/pythonnet/tree/master
yagweb:add_scopehttps://github.com/yagweb/pythonnet/tree/add_scope
Conversation 148 https://github.com/pythonnet/pythonnet/pull/381
Commits 22 https://github.com/pythonnet/pythonnet/pull/381/commits
Checks 0 https://github.com/pythonnet/pythonnet/pull/381/checks
Files changed https://github.com/pythonnet/pythonnet/pull/381/files
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
add a scope class to manage the context of interaction with Python an… https://github.com/pythonnet/pythonnet/pull/381/files#top
Show all changes 22 commits https://github.com/pythonnet/pythonnet/pull/381/files
8e0b1a2 Deprecate public RunString vmuriart Mar 3, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/8e0b1a2a376e5080adaa69e7fd5f6723b572b1f1
72003aa add a scope class to manage the context of interaction with Python an… yagweb Feb 15, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/72003aa45b3378e57b18a15b78f016641bdbee44
efd3798 Rename several methods and add three methods yagweb Feb 23, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/efd3798d5900ffe2e8681c937e99be320f7e8090
9f50e25 rebased yagweb Feb 24, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/9f50e25dda9b3a30f1cea594bdfbe133d756c60b
add5ba8 Rebased update vmuriart Feb 28, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/add5ba8fe7ad4ef7c73ec0a3ea980a033d05e905
c15555c format cleanup vmuriart Feb 28, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/c15555cafd070c1dcf16f8a5eeeaa54905234d30
b0d57e9 create unnamed pyscope, make PyScope.GILState save yagweb Mar 1, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/b0d57e997790a889595571a2aaae36e8459d5311
ceaaef0 fixup! create unnamed pyscope, make PyScope.GILState save yagweb Mar 2, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/ceaaef0333398dbe171876275d3e40613378e238
dec39c7 remove GIL and rebased yagweb Mar 7, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/dec39c74f5edc0e69ea1f4bf32eebc5304c31691
e117d60 Add several methods yagweb Mar 7, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/e117d604b556f318fecb54c59bb5a935cc605ec6
904d9ed add a Variables method yagweb Mar 14, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/904d9ed168a31c83438fdbf2f3838ef528bf71cb
5484451 fixup! add a Variables method yagweb Mar 15, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/5484451819e74bde7d7109523a8d88f09f2ca6a0
2e063c2 remove private method _GetVariable yagweb Mar 15, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/2e063c2f4be8be09b41e7fecf1b80e799a5603ad
dd492f4 add unit test for Variables() method yagweb Mar 15, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/dd492f46f27c3f00dbc8e05e5507a095b866dece
df6a49a add several methods and rebased yagweb Apr 7, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/df6a49aced3f4040f97625c32f611da43695e041
f35d75b add a new class PyScopeManager yagweb Apr 24, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/f35d75ba8e4e68ef1ca289e7ed58c020e919c149
497d7aa cleaned up the Import methods yagweb Apr 28, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/497d7aabebd8719ca9bd226f878eb0640fa89cb3
60ce28b Merge branch 'master' into add_scope May 24, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/60ce28b23605a46e4834a89c3cbed3a6c781233b
ebf5a2b Merge branch 'master' into add_scope May 24, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/ebf5a2b91941b60fa717ce151cd94d4af44730fb
2c3db3d updated according to filmor's comments yagweb May 31, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/2c3db3d6eec31f9f88127fbf641652266825fa1f
30543eb fixup! updated according to filmor's comments yagweb May 31, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/30543ebd17712abed126a5eac88abe525f2c75a0
b9dcdac Get/Set Methods renamed yagweb Jun 1, 2017 https://github.com/pythonnet/pythonnet/pull/381/commits/b9dcdacfd9014d5ad30048d1a3910423372c4c43
Clear filters https://github.com/pythonnet/pythonnet/pull/381/files
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
Python.EmbeddingTest.csproj https://github.com/pythonnet/pythonnet/pull/381/files#diff-6bfe85b2afa32799eb0008c63c2ab5372012dba8bf12ffb8c3441fafc57d5ac7
TestPyScope.cs https://github.com/pythonnet/pythonnet/pull/381/files#diff-4578bf137f6a84f78339c947bfa54dcdea2b8620d56242a8fe68d2141d78f29c
Python.Runtime.csproj https://github.com/pythonnet/pythonnet/pull/381/files#diff-ea0799bb2df39c199e3dfc666fddf421f382b9bde4c7c4d558f0e2700eb09bad
pyobject.cs https://github.com/pythonnet/pythonnet/pull/381/files#diff-c7afe47ee5bee58846cafad6ec4ecedb222d846124e7aec56bb7f62df0340392
pyscope.cs https://github.com/pythonnet/pythonnet/pull/381/files#diff-5a93f5d2b3df2777f89c8024e7880191f13b1ab50eac398d33f143ccc30ead64
pythonengine.cs https://github.com/pythonnet/pythonnet/pull/381/files#diff-59c1255540fe4fce6bd6d1f2b5b31ced7b9baacc387b3d07cb08e9444bcd82aa
runtime.cs https://github.com/pythonnet/pythonnet/pull/381/files#diff-f1749bdd9f64fdac5c64d5cb0982ce1dac5e2d9a2cdd55b93d3f83b5047a855d
src/embed_tests/Python.EmbeddingTest.csprojhttps://github.com/pythonnet/pythonnet/pull/381/files#diff-6bfe85b2afa32799eb0008c63c2ab5372012dba8bf12ffb8c3441fafc57d5ac7
View file https://github.com/yagweb/pythonnet/blob/b9dcdacfd9014d5ad30048d1a3910423372c4c43/src/embed_tests/Python.EmbeddingTest.csproj
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/pythonnet/pythonnet/pull/381/{{ revealButtonHref }}
https://github.com/pythonnet/pythonnet/pull/381/files#diff-6bfe85b2afa32799eb0008c63c2ab5372012dba8bf12ffb8c3441fafc57d5ac7
https://github.com/pythonnet/pythonnet/pull/381/files#diff-6bfe85b2afa32799eb0008c63c2ab5372012dba8bf12ffb8c3441fafc57d5ac7
src/embed_tests/TestPyScope.cshttps://github.com/pythonnet/pythonnet/pull/381/files#diff-4578bf137f6a84f78339c947bfa54dcdea2b8620d56242a8fe68d2141d78f29c
View file https://github.com/yagweb/pythonnet/blob/b9dcdacfd9014d5ad30048d1a3910423372c4c43/src/embed_tests/TestPyScope.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/pythonnet/pythonnet/pull/381/{{ revealButtonHref }}
den-run-aihttps://github.com/den-run-ai
Mar 20, 2017https://github.com/pythonnet/pythonnet/pull/381/files#r106841642
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
den-run-aihttps://github.com/den-run-ai
Mar 20, 2017https://github.com/pythonnet/pythonnet/pull/381/files#r106841751
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
src/runtime/Python.Runtime.csprojhttps://github.com/pythonnet/pythonnet/pull/381/files#diff-ea0799bb2df39c199e3dfc666fddf421f382b9bde4c7c4d558f0e2700eb09bad
View file https://github.com/yagweb/pythonnet/blob/b9dcdacfd9014d5ad30048d1a3910423372c4c43/src/runtime/Python.Runtime.csproj
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/pythonnet/pythonnet/pull/381/{{ revealButtonHref }}
https://github.com/pythonnet/pythonnet/pull/381/files#diff-ea0799bb2df39c199e3dfc666fddf421f382b9bde4c7c4d558f0e2700eb09bad
https://github.com/pythonnet/pythonnet/pull/381/files#diff-ea0799bb2df39c199e3dfc666fddf421f382b9bde4c7c4d558f0e2700eb09bad
https://github.com/pythonnet/pythonnet/pull/381/files#diff-ea0799bb2df39c199e3dfc666fddf421f382b9bde4c7c4d558f0e2700eb09bad
Please reload this pagehttps://github.com/pythonnet/pythonnet/pull/381/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.