Delete Files then Folder using Python
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
pinedz04
5 - Atom
‎07-17-2021
11:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi!
I'm trying to create a workflow that will delete the files first then the folder used if its empty using Python.
I am having a hard time connecting my directory in the workflow. I'm not sure how Alteryx.read works and if i should be using a macro for the python tool.
I also don't want to use shutil.rmtree to avoid unnecessary deletion of files.
I've attached the workflow of what i want or what i have.
Thank you!
Labels:
- Labels:
- Expression
- Output
- Python
- Workflow
2 REPLIES 2
dougperez
12 - Quasar
‎07-18-2021
11:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Why don't you use a batch to delete the files and folders? You can create the batch into the workflow and then run that.
Alteryx
‎07-18-2021
03:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @pinedz04 - Run Command Tool: https://help.alteryx.com/20212/designer/run-command-tool
Just saying...
