PROThis feature is supported in the Professional Edition.
Python Execution Tool is an intelligent tool that can directly run Python script content in the platform, supporting rapid data processing, calculation logic testing, script verification and other operations in the project.Whether it is a simple addition calculation or a quick verification of a certain logic, the user only needs to submit the code content, and the system can immediately execute and return the result, without relying on the local environment or additional configuration.
๐ง Core functions
โ Run Python scripts online
Users only need to enter any Python code, the platform will run immediately, and return visual output results.
Support single or multiple lines of code
Automatic execution and feedback results
Safe and isolated operation, without affecting the main system
๐ค Output is echo
The tool displays the content output by print by default, which is convenient for users to quickly verify the execution logic or view the running effect.
๐ก Note: Function return values โโare not automatically displayed, please use the print statement to get visual results.
๐ฏ Application scenarios
Scenario
Description
๐ฌ Data analysis
Run a small code segment to quickly collect statistics and display results
๐งช Logic test
Verify a certain algorithm and determine whether the process meets expectations
๐ Script preview
Quickly preview the script running effect before deployment
๐จโ๐ซ Teaching demonstration
Used for interactive teaching or code explanation examples on the platform
โจ Feature highlights
Feature
Advantages
โก Write and run
Enter the script and execute it immediately, without waiting for deployment
๐งฑ No need to configure the environment
No need to install Python, completely zero burden locally
๐ Clearly visible output
All execution results are uniformly displayed through standard output
๐ Safe operation
Each run is processed in an isolated environment, safe and reliable
๐ Automatic recording
All execution records can be used for subsequent debugging or archiving analysis
๐ Usage process
Enter code
Fill in the Python script content in the platform input box.
One-click execution
The system runs immediately after submission and returns the results within a few seconds.
View output
The screen displays the code running results for easy verification or analysis.
๐ Tips
Please make sure that the code contains the print(...) statement, otherwise no output may be displayed.
If an error occurs, the system will also feedback detailed error information to help quickly locate the problem.
๐ง Use in conjunction with other tools
The Python execution tool can be used in conjunction with other components of the platform (such as file managers, chart tools, deployment modules, etc.) to build more complex automation or data analysis processes. For example:
Analyze file data โ Execute logic with Python โ Output chart
Write analysis logic โ View results in real time โ Generate report
โ Summary
Python Execution Tool is a lightweight but powerful smart runner that helps users quickly write and run Python code in any scenario. It perfectly combines the flexibility of Python with the platformโs visual operation, truly achieving:
โRun anytime, anywhereโ - No need for environment configuration, just write and run directly!
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Xpert AI","colors":{"primary":"#FF0000","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/xpertai/2jKsBNCoQ3CSMXtA/logo/light.svg?fit=max\u0026auto=format\u0026n=2jKsBNCoQ3CSMXtA\u0026q=85\u0026s=e4c3777e44d9b5b2e80e8ea4f9a6d9f6","dark":"https://mintcdn.com/xpertai/2jKsBNCoQ3CSMXtA/logo/dark.svg?fit=max\u0026auto=format\u0026n=2jKsBNCoQ3CSMXtA\u0026q=85\u0026s=dad304490ba7841404252de1fd7943b8"},"favicon":"https://mintcdn.com/xpertai/2jKsBNCoQ3CSMXtA/favicon.svg?fit=max\u0026auto=format\u0026n=2jKsBNCoQ3CSMXtA\u0026q=85\u0026s=617c77252b632e710a4d3597f3189347","appearance":{"default":"light"},"navbar":{"links":[{"href":"https://github.com/xpert-ai/xpert","label":"GitHub"},{"href":"https://data.xpertai.cn/","label":"Ontology"},{"href":"mailto:service@xpertai.cn","label":"Support"}],"primary":{"type":"button","label":"Try XpertAI","href":"https://app.xpertai.cn/"}},"footer":{"socials":{"x":"https://xpertai.cn/","github":"https://github.com/xpert-ai/xpert"}},"fonts":{"family":"Inter"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://xpertai.cn/blog/"}]},"languages":[{"language":"en","default":true,"navbar":{"links":[{"href":"https://github.com/xpert-ai/xpert","label":"GitHub"},{"href":"https://data.xpertai.cn/","label":"Ontology"},{"href":"mailto:service@xpertai.cn","label":"Support"}],"primary":{"type":"button","label":"Try XpertAI","href":"https://app.xpertai.cn/"}},"href":"en/ai/getting-started"},{"language":"zh-Hans","navbar":{"links":[{"href":"https://github.com/xpert-ai/xpert","label":"GitHub"},{"href":"https://data.xpertai.cn/","label":"่ฟๅ ฅๆฌไฝ"},{"href":"mailto:service@xpertai.cn","label":"ๆฏๆ"}],"primary":{"type":"button","label":"่ฏ็จ XpertAI","href":"https://app.xpertai.cn/"}},"href":"zh-Hans/ai/getting-started"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"xpertai","hasAudioNarration":false,"actualSubdomain":"xpertai","customDomains":["docs.xpertai.cn"],"gitSource":{"type":"github","owner":"xpert-ai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af197020da5396f96328d23","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"en","tag":"AI","count":406},{"language":"zh-Hans","tag":"AI","count":406},{"language":"zh-Hans","tag":"้ป่ฎค","count":124},{"language":"en","tag":"Default","count":122},{"language":"en","tag":"Ontology","count":91},{"language":"zh-Hans","tag":"ๆฌไฝ","count":91},{"language":"en","tag":"Agent","count":70},{"language":"zh-Hans","tag":"ๆบ่ฝไฝ","count":68},{"language":"en","tag":"OpenAPI (Unmaintained)","count":59},{"language":"zh-Hans","tag":"OpenAPI๏ผไธๅ็ปดๆค๏ผ","count":59},{"language":"en","tag":"Plugin","count":47},{"language":"zh-Hans","tag":"ๆไปถ","count":47},{"language":"zh-Hans","tag":"ๅทฅไฝๆต","count":33},{"language":"en","tag":"Tutorial","count":31},{"language":"en","tag":"Workflow","count":31},{"language":"zh-Hans","tag":"ๆ็จ","count":30},{"language":"en","tag":"Toolset","count":28},{"language":"zh-Hans","tag":"ๅทฅๅ ท้","count":26},{"language":"en","tag":"Data and Analytics","count":23},{"language":"zh-Hans","tag":"ๆฐๆฎๅๆ","count":23}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"public/styles.css","content":""}]}
{"page":{"pagePath":"en/ai/agent/toolset/virtual-environment/python-execution","slug":"/en/ai/agent/toolset/virtual-environment/python-execution","pageMetadata":{"title":"Python Execution Tool","sidebar_position":4,"description":null,"href":"/en/ai/agent/toolset/virtual-environment/python-execution"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={blockquote:`blockquote`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Table,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(Tip,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`PRO`})}),_jsxs(_components.p,{children:[`This feature is supported in the `,_jsx(_components.strong,{children:`Professional Edition`}),`.`]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Python Execution Tool`}),` is an intelligent tool that can `,_jsx(_components.strong,{children:`directly run Python script content`}),` in the platform, supporting rapid data processing, calculation logic testing, script verification and other operations in the project.`]}),`\n`,_jsx(_components.p,{children:`Whether it is a simple addition calculation or a quick verification of a certain logic, the user only needs to submit the code content, and the system can immediately execute and return the result, without relying on the local environment or additional configuration.`}),`\n`,_jsx(Heading,{level:`2`,id:`-core-functions`,children:`๐ง Core functions`}),`\n`,_jsx(Heading,{level:`3`,id:`-run-python-scripts-online`,children:`โ Run Python scripts online`}),`\n`,_jsx(_components.p,{children:`Users only need to enter any Python code, the platform will run immediately, and return visual output results.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Support single or multiple lines of code`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Automatic execution and feedback results`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Safe and isolated operation, without affecting the main system`}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`-output-is-echo`,children:`๐ค Output is echo`}),`\n`,_jsxs(_components.p,{children:[`The tool displays the content output by `,_jsx(_components.code,{children:`print`}),` by default, which is convenient for users to quickly verify the execution logic or view the running effect.`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[`๐ก Note: Function return values โโare not automatically displayed, please use the `,_jsx(_components.code,{children:`print`}),` statement to get visual results.`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-application-scenarios`,children:`๐ฏ Application scenarios`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Scenario`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐ฌ Data analysis`}),_jsx(_components.td,{children:`Run a small code segment to quickly collect statistics and display results`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐งช Logic test`}),_jsx(_components.td,{children:`Verify a certain algorithm and determine whether the process meets expectations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐ Script preview`}),_jsx(_components.td,{children:`Quickly preview the script running effect before deployment`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐จโ๐ซ Teaching demonstration`}),_jsx(_components.td,{children:`Used for interactive teaching or code explanation examples on the platform`})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-feature-highlights`,children:`โจ Feature highlights`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Feature`}),_jsx(_components.th,{children:`Advantages`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`โก Write and run`}),_jsx(_components.td,{children:`Enter the script and execute it immediately, without waiting for deployment`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐งฑ No need to configure the environment`}),_jsx(_components.td,{children:`No need to install Python, completely zero burden locally`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐ Clearly visible output`}),_jsx(_components.td,{children:`All execution results are uniformly displayed through standard output`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐ Safe operation`}),_jsx(_components.td,{children:`Each run is processed in an isolated environment, safe and reliable`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`๐ Automatic recording`}),_jsx(_components.td,{children:`All execution records can be used for subsequent debugging or archiving analysis`})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-usage-process`,children:`๐ Usage process`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Enter code`}),`\nFill in the Python script content in the platform input box.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`One-click execution`}),`\nThe system runs immediately after submission and returns the results within a few seconds.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`View output`}),`\nThe screen displays the code running results for easy verification or analysis.`]}),`\n`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-tips`,children:`๐ Tips`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Please make sure that the code contains the `,_jsx(_components.code,{children:`print(...)`}),` statement, otherwise no output may be displayed.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`If an error occurs, the system will also feedback detailed error information to help quickly locate the problem.`}),`\n`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-use-in-conjunction-with-other-tools`,children:`๐ง Use in conjunction with other tools`}),`\n`,_jsx(_components.p,{children:`The Python execution tool can be used in conjunction with other components of the platform (such as file managers, chart tools, deployment modules, etc.) to build more complex automation or data analysis processes. For example:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Analyze file data โ Execute logic with Python โ Output chart`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Write analysis logic โ View results in real time โ Generate report`}),`\n`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`-summary`,children:`โ Summary`}),`\n`,_jsx(_components.p,{children:`Python Execution Tool is a lightweight but powerful smart runner that helps users quickly write and run Python code in any scenario. It perfectly combines the flexibility of Python with the platformโs visual operation, truly achieving:`}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`โRun anytime, anywhereโ`}),` - No need for environment configuration, just write and run directly!`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Python Execution Tool","sidebar_position":4,"description":null,"href":"/en/ai/agent/toolset/virtual-environment/python-execution"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"๐ง Core functions","slug":"-core-functions","depth":2,"children":[{"title":"โ Run Python scripts online","slug":"-run-python-scripts-online","depth":3,"children":[]},{"title":"๐ค Output is echo","slug":"-output-is-echo","depth":3,"children":[]}]},{"title":"๐ฏ Application scenarios","slug":"-application-scenarios","depth":2,"children":[]},{"title":"โจ Feature highlights","slug":"-feature-highlights","depth":2,"children":[]},{"title":"๐ Usage process","slug":"-usage-process","depth":2,"children":[]},{"title":"๐ Tips","slug":"-tips","depth":2,"children":[]},{"title":"๐ง Use in conjunction with other tools","slug":"-use-in-conjunction-with-other-tools","depth":2,"children":[]},{"title":"โ Summary","slug":"-summary","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"xpertai","siteName":"Xpert AI","title":"Python Execution Tool - Xpert AI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/ai/agent/toolset/virtual-environment/python-execution","matchLevel":0},"zh-Hans":{"href":"/zh-Hans/ai/agent/toolset/virtual-environment/python-execution","matchLevel":1}}},"lastModified":"2026-10-20T09:41:33.313Z","originalFileLocation":"en/ai/agent/toolset/virtual-environment/python-execution.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Xpert AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Python Execution Tool - Xpert AI\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Xpert AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://xpertai.mintlify.site/_mintlify/api/og/v2?division=Toolset\u0026amp;title=Python+Execution+Tool\u0026amp;theme=ea705b00189439c1b6512356\u0026amp;signature=e09de9dc226da42e8a814384f4d3254a64fa000d1b45f6010e7b40872d7a862c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Python Execution Tool - Xpert AI\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://xpertai.mintlify.site/_mintlify/api/og/v2?division=Toolset\u0026amp;title=Python+Execution+Tool\u0026amp;theme=ea705b00189439c1b6512356\u0026amp;signature=e09de9dc226da42e8a814384f4d3254a64fa000d1b45f6010e7b40872d7a862c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/xpertai/-IgJ8RS8fLVB5p0L/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Xpert AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF0000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/ai/agent/toolset/virtual-environment/python-execution.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.xpertai.cn/zh-Hans/ai/agent/toolset/virtual-environment/python-execution\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.xpertai.cn/#organization\",\"name\":\"Xpert AI\",\"url\":\"https://docs.xpertai.cn\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/xpertai/2jKsBNCoQ3CSMXtA/logo/light.svg?fit=max\u0026auto=format\u0026n=2jKsBNCoQ3CSMXtA\u0026q=85\u0026s=e4c3777e44d9b5b2e80e8ea4f9a6d9f6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.xpertai.cn#website\",\"name\":\"Xpert AI\",\"url\":\"https://docs.xpertai.cn\",\"publisher\":{\"@id\":\"https://docs.xpertai.cn/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution#webpage\",\"url\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\",\"name\":\"Python Execution Tool\",\"dateModified\":\"2026-10-20T09:41:33.313Z\",\"isPartOf\":{\"@id\":\"https://docs.xpertai.cn#website\"},\"breadcrumb\":{\"@id\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Toolset\",\"item\":\"https://docs.xpertai.cn/en/ai/agent/toolset/mcp-tools\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Execution Tool\",\"item\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution#article\",\"headline\":\"Python Execution Tool\",\"name\":\"Python Execution Tool\",\"url\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution\",\"mainEntityOfPage\":{\"@id\":\"https://docs.xpertai.cn/en/ai/agent/toolset/virtual-environment/python-execution#webpage\"},\"dateModified\":\"2026-10-20T09:41:33.313Z\",\"publisher\":{\"@id\":\"https://docs.xpertai.cn/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.xpertai.cn#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Xpert AI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Xpert AI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/ai/agent/toolset/virtual-environment/python-execution.md","siteName":"Xpert AI","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://xpertai.cn/blog/"}]},"languages":[{"language":"en","default":true,"navbar":{"links":[{"href":"https://github.com/xpert-ai/xpert","label":"GitHub"},{"href":"https://data.xpertai.cn/","label":"Ontology"},{"href":"mailto:service@xpertai.cn","label":"Support"}],"primary":{"type":"button","label":"Try XpertAI","href":"https://app.xpertai.cn/"}},"products":[{"product":"AI","tabs":[{"tab":"Getting Started","pages":[{"title":"Getting Started","href":"/en/ai/getting-started"}]},{"tab":"Bosi App","pages":[{"title":"Bosi App","href":"/en/ai/bosi"}]},{"tab":"Plugin Apps","pages":[{"title":"Plugin Apps","href":"/en/ai/applications"}]},{"tab":"Agent","groups":[{"group":"Default","pages":[{"title":"๐ง๐ผโ๐ Agent","href":"/en/ai/agent/agent"},{"title":"Multi-Agent Architectures","href":"/en/ai/agent/multi-agent-architecture"},{"title":"Expert Configuration","href":"/en/ai/agent/expert-configuration"},{"title":"Human in the loop","href":"/en/ai/agent/human-ai-collaboration"},{"title":"Long-Term Memory","href":"/en/ai/agent/long-term-memory"},{"title":"File Memory and Dreaming","href":"/en/ai/agent/file-memory-dreaming"},{"title":"Environment Variables","href":"/en/ai/agent/environment-variables"},{"title":"Enhanced Features","href":"/en/ai/agent/enhanced-features"},{"title":"Release Version","href":"/en/ai/agent/release-version"},{"title":"Assistant Profile","href":"/en/ai/agent/assistant-profile"},{"title":"Agent Evolution","href":"/en/ai/agent/agent-evolution"},{"title":"Embedding WebApp","href":"/en/ai/agent/embed-webpage"},{"title":"Logs","href":"/en/ai/agent/conversation-logs"},{"title":"Monitor Dashboard","href":"/en/ai/agent/monitoring-dashboard"},{"title":"Chat Channels","href":"/en/ai/agent/chat-channels"},{"title":"Supervisor Architecture","href":"/en/ai/agent/supervised-architecture"},{"title":"Swarm","href":"/en/ai/agent/swarm-architecture"}]},{"group":"Handoff","pages":[{"title":"Agent Chat Handoff Architecture","href":"/en/ai/agent/handoff/agent-chat-handoff-architecture"}]},{"group":"Sandbox","pages":[{"title":"Sandbox Feature","href":"/en/ai/agent/sandbox/index"}]},{"group":"Conversation","pages":[{"title":"๐ Chat","href":"/en/ai/agent/conversation/conversation"},{"title":"Discover \u0026 add","href":"/en/ai/agent/conversation/discover-and-add"},{"title":"Using Assistant templates","href":"/en/ai/agent/conversation/assistant-templates"}]},{"group":"Tag","pages":[{"title":"Xpert Tag","href":"/en/ai/agent/tag/index"},{"title":"How Xpert Tag Works","href":"/en/ai/agent/tag/how-it-works"},{"title":"Administrator Setup","href":"/en/ai/agent/tag/admin-setup"},{"title":"Access And Security","href":"/en/ai/agent/tag/access-and-security"},{"title":"Memory And Routines","href":"/en/ai/agent/tag/memory-and-routines"},{"title":"Use Cases","href":"/en/ai/agent/tag/use-cases"},{"title":"Capability Status","href":"/en/ai/agent/tag/capability-status"}]},{"group":"Skill","pages":[{"title":"Skills","href":"/en/ai/agent/skill/index"},{"title":"Browse and Install Skills","href":"/en/ai/agent/skill/marketplace"},{"title":"Register and Use Skill Repositories","href":"/en/ai/agent/skill/skill-repository-registration-and-use"},{"title":"Manage Workspace Skills","href":"/en/ai/agent/skill/workspace"},{"title":"Use Skills in Agents","href":"/en/ai/agent/skill/use-in-agent"},{"title":"Administer Skills","href":"/en/ai/agent/skill/administration"},{"title":"Skill Package Format","href":"/en/ai/agent/skill/skill-package-format"}]},{"group":"AI Assistant","pages":[{"title":"Commands","href":"/en/ai/agent/ai-assistant/command"},{"title":"Configure Xpert AI Assistant","href":"/en/ai/agent/ai-assistant/configure-ai-assistant"},{"title":"๐ค AI Copilot","href":"/en/ai/agent/ai-assistant/index"},{"title":"Settings","href":"/en/ai/agent/ai-assistant/settings"},{"title":"Roles","href":"/en/ai/agent/ai-assistant/roles"}]},{"group":"Artifacts","pages":[{"title":"Artifacts","href":"/en/ai/agent/artifacts/index"}]},{"group":"Toolset","pages":[{"title":"MCP Tools","href":"/en/ai/agent/toolset/mcp-tools/index"},{"title":null,"href":"/en/ai/agent/toolset/virtual-environment/bash-command-execution"},{"title":"File Tools","href":"/en/ai/agent/toolset/virtual-environment/file-tools"},{"title":"Self-Built Application Configuration","href":"/en/ai/agent/toolset/chatbi-toolset/app"},{"title":"Built-in Toolsets","href":"/en/ai/agent/toolset/built-in-toolset"},{"title":"Code Project","href":"/en/ai/agent/toolset/virtual-environment/code-project"},{"title":"Crawl4AI","href":"/en/ai/agent/toolset/mcp-tools/crawl4ai"},{"title":"๐ค Chat Bot","href":"/en/ai/agent/toolset/chatbi-toolset/bot"},{"title":"Chat Models","href":"/en/ai/agent/toolset/chatbi-toolset/models"},{"title":"BI Toolsets","href":"/en/ai/agent/toolset/bi-toolset/bi-toolset"},{"title":"Semantic Modeling","href":"/en/ai/agent/toolset/bi-toolset/modeling"},{"title":"Custom Toolsets","href":"/en/ai/agent/toolset/custom-toolset"},{"title":"Quick Access Application","href":"/en/ai/agent/toolset/chatbi-toolset/webpage"},{"title":"Indicator Management","description":null,"href":"/en/ai/agent/toolset/bi-toolset/indicators"},{"title":"Python Execution Tool","href":"/en/ai/agent/toolset/virtual-environment/python-execution"},{"title":"ChatBI Toolset","description":null,"href":"/en/ai/agent/toolset/chatbi-toolset/chatbi"},{"title":"Dashboard","href":"/en/ai/agent/toolset/bi-toolset/dashboard"},{"title":"Scheduled Tasks","href":"/en/ai/agent/toolset/scheduled-tasks"},{"title":"Data Governance","href":"/en/ai/agent/toolset/bi-toolset/data-governance"},{"title":"Feishu (Lark)","href":"/en/ai/agent/toolset/feishu"},{"title":"Browser-use Tools","href":"/en/ai/agent/toolset/virtual-environment/browser-use-tools"},{"title":"DingTalk","href":"/en/ai/agent/toolset/dingtalk"},{"title":"Planning Tasks","href":"/en/ai/agent/toolset/planning-tasks"},{"title":null,"href":"/en/ai/agent/toolset/virtual-environment/browser-tools"},{"title":"Computer Tools","href":"/en/ai/agent/toolset/virtual-environment/computer-tools"},{"title":"Coding Expert","href":"/en/ai/agent/toolset/coding-expert"},{"title":"GIT Tools","href":"/en/ai/agent/toolset/virtual-environment/git-tools"},{"title":"Slide Tool","href":"/en/ai/agent/toolset/virtual-environment/slideshow-tools"}]}]},{"tab":"Projects \u0026 Tasks","pages":[{"title":"Projects \u0026 Tasks","href":"/en/ai/projects"}]},{"tab":"Live Dashboard","pages":[{"title":"Live Dashboard","href":"/en/ai/live-dashboard"}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/en/ai/knowledge-base"}]},{"tab":"Workflow","pages":[{"title":"Workflow","href":"/en/ai/workflow"}]},{"tab":"Agent Middleware","pages":[{"title":"Agent Middleware","href":"/en/ai/middleware"}]},{"tab":"Plugin","pages":[{"title":"Plugin","href":"/en/ai/plugin/overview"}]},{"tab":"Chatkit","pages":[{"title":"Chatkit","href":"/en/ai/chatkit"}]},{"tab":"Troubleshooting","pages":[{"title":"Troubleshooting","href":"/en/ai/troubleshooting/errors/recursion-limit"}]},{"tab":"Tutorial","pages":[{"title":"Tutorial","href":"/en/ai/tutorial/assistant-everyday-chat"}]},{"tab":"System","pages":[{"title":"System","href":"/en/ai/system/membership-plan"}]},{"tab":"OpenAPI (Unmaintained)","pages":[{"title":"OpenAPI (Unmaintained)","href":"/en/api-reference/aiv1/chat-with-an-agent"}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/en/ai/agent/development-api"}]}]},{"product":"Ontology","pages":[{"title":"Ontology","href":"/en/data/getting-started"}]},{"product":"Code","pages":[{"title":"Code","href":"/en/code/web"}]}]},{"language":"zh-Hans","navbar":{"links":[{"href":"https://github.com/xpert-ai/xpert","label":"GitHub"},{"href":"https://data.xpertai.cn/","label":"่ฟๅ ฅๆฌไฝ"},{"href":"mailto:service@xpertai.cn","label":"ๆฏๆ"}],"primary":{"type":"button","label":"่ฏ็จ XpertAI","href":"https://app.xpertai.cn/"}},"pages":[{"title":"zh-Hans","href":"/zh-Hans/ai/agent/toolset/virtual-environment/python-execution"}]}]},"basePath":"","title":"Python Execution Tool - Xpert AI","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}