# Export the current session to Python code

<figure><img src="https://3086913752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaXIWTLSpZzoC0lnDKEaY%2Fuploads%2FpQisBH4gDohMDQrnoRyB%2Fmenu_session_to_python.png?alt=media&#x26;token=d4b51eb6-4c85-4daa-bffb-e18193e6c10a" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://3086913752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaXIWTLSpZzoC0lnDKEaY%2Fuploads%2FmyOqWA3O7ZSFPEaec8BT%2Fsession_2_python.png?alt=media&#x26;token=36830d7f-27aa-46dc-8e2d-eccb9646e90a" alt=""><figcaption><p>preview and convert session to python code</p></figcaption></figure>

### Convert static values to variables and arguments

static values in the session could be replaced with variable names with {} syntax, the corresponding argument and variables will be generated automaticaly in python code.&#x20;

<figure><img src="https://3086913752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaXIWTLSpZzoC0lnDKEaY%2Fuploads%2FtICsOuOO2cNYz7P1xb5h%2Freplace_value_with_var.png?alt=media&#x26;token=add1ad10-e49f-4145-b5ba-bdeff1b68440" alt=""><figcaption><p>how to replace static value with variable name</p></figcaption></figure>

<figure><img src="https://3086913752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaXIWTLSpZzoC0lnDKEaY%2Fuploads%2Fr5ZVWmBClDVkLBg5nvKj%2Fconverted_argument.png?alt=media&#x26;token=5a0ae10c-1e5d-40b2-8571-11b5f4770bea" alt=""><figcaption><p>The static selection value vendor_0001 will be replaced with a argument --my_selection and the variable my_selection in python code</p></figcaption></figure>



