Hi, I’m fairly new to Robocorp (RPA Framework) syntax and I’d rather write all automations with Python. Is there a way to write, deploy and orchestrate Python files in Robocorp?
Hi, @micholewski! Great question.
The answer is yes. We’ll probably write a proper article about this, but this should get you started:
- I created a new robot with the minimal template.
- I deleted the
tasks.robotfile, since I won’t be using that.
- I created a new Python file. I decide to call it
The dir looks like this:
output conda.yaml robot.yaml tasks.py
- I modified the
robot.yamllike this, changing the command to run
tasks.pyas the target:
tasks: entrypoint: command: - python - tasks.py condaConfigFile: conda.yaml artifactsDir: output ignoreFiles: - .gitignore PATH: - . PYTHONPATH: - .
- I created a simple web robot in the
from RPA.Browser import Browser browser = Browser() browser.open_available_browser("https://robocorp.com/docs/") browser.input_text("css:input", "python") browser.press_keys("css:input", "ENTER") browser.screenshot(filename="output/screenshot.png") browser.close_all_browsers()
That works also in Robocorp Cloud.
Give it a try and tell how it goes!
Awesome, thanks you very much!
Thanks for the inspiration! We now have a simple article about this available: