If you want to save a file from Pythonista (py, zip, text,...) into iCloud Drive, and if you have the Workflow app, you could:
- create once a folder Pythonista in the Workflow folder on iCloud Drive
- create once a Workflow, for instance named SavePythonistaFileInIcloudDrive, containing only these two actions:
- Get Files from Dropbox
- Show Dropbox Picker off
- File Path /Pythonista/Clipboard
- Error if not found on
- Save File
- Ask where to save off
- iCloud folder /Workflow/Pythonista/
- Overwrite if file exists on
- Text File saved
- Copy to Clipboard
See workflow

  • run this script
import webbrowser
import clipboard
Import time
Import console
filename = 'your file'
#... save your file into Dropbox, for instance in a folder named Pythonista, 
#... via a script you find easyly in these forums
clipboard.set(filename)
webbrowser.open('workflow://x-callback-url/run-workflow?name=SavePythonistaFileInIcloudDrive&input=clipboard&x-success=pythonista://')

text = clipboard.get()
while text != 'File saved':
    text = clipboard.get()
    time.sleep(0.3)

console.alert(text)