# Execute File Handling Python Script from UiPath Studio

**URL:** <https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379>\
**Category:** Help\
**Tags:** python, activities\
**Created:** [February 11, 2019, 10:28am UTC](https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379 "2019-02-11T10:28:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [February 11, 2019, 10:28am UTC](https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379/1 "2019-02-11T10:28:37Z")

</div>

Hi,  
I’m trying to simply run a file handling python script from UiPath. But it’s not working. Can someone give any suggestions.

---

<div class="post-metadata">

**Author:** ![Sheshrocks](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sheshrocks/32/46480_2.png) [@Sheshrocks](https://forum.uipath.com/u/Sheshrocks)\
**Post date:** [February 11, 2019, 10:33am UTC](https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379/2 "2019-02-11T10:33:04Z")

</div>

Hi @raviranjan, try below two activities w.r.t python - load python script and run python script.

 ![](https://global.discourse-cdn.com/uipath/original/3X/6/1/6149ec75a1228910b904d9b921eff87a9b03cfd6.ico) [activities.uipath.com](https://activities.uipath.com/docs/load-script)

### [Load Python Script](https://activities.uipath.com/docs/load-script)

`UiPath.Python.Activities.LoadScript` Enables you to store the handlers of a Python script in a `PythonObject` variable. You can use the resulting variable to invoke the methods within the code. If there is inline code besides the methods present in…

 ![](https://global.discourse-cdn.com/uipath/original/3X/6/1/6149ec75a1228910b904d9b921eff87a9b03cfd6.ico) [activities.uipath.com](https://activities.uipath.com/docs/run-script)

### [Run Python Script](https://activities.uipath.com/docs/run-script)

`UiPath.Python.Activities.RunScript` Enables you to execute Python code. You can input the code directly in the activity or provide a file path for it. Can only be used inside the **Python Scope** activity. Due to a software limitation, this…

Hope it helps!

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [February 11, 2019, 10:33am UTC](https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379/3 "2019-02-11T10:33:41Z")

</div>

Please check the sample workflow from the UIPath docs (at the end of the article).  
Link for your reference -

> **[About the Python Activities Package](https://docs.uipath.com/activities/docs/about-the-python-activities-pack)**
>
> The purpose of this pack is to enable you to invoke Python scripts and methods in any workflow directly from our product. You can also pass input arguments to the invoked code, as well as retrieve the output data generated by the activities. The...

Regards,  
Karthik Byggari

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [February 11, 2019, 11:20am UTC](https://forum.uipath.com/t/execute-file-handling-python-script-from-uipath-studio/94379/4 "2019-02-11T11:20:32Z")

</div>

I have already visited both the links and tried to implement a simple file handling code in python which simply writes “hello World” to a file. But, its not working.
