Skip to main content
Solved

Remove Subfolders with Python

  • January 6, 2016
  • 2 replies
  • 59 views

danilo_fme
Celebrity
Forum|alt.badge.img+52

Hello,

Waht is wrong my code python? My idea is : i have a directory with subfolder and i need to delete them.

My test into script to delete just one subfolder.

import fme
import fmeobjects
import os


def existe(feature):
    existesim = str
    existe = os.path.exists('C://Suportes//2016//PRODAM//Fanout_Cesar//ver//ANHANGUERA/') 
    feature.setAttribute('existesim', existe) 
    os.remove('C:/Suportes/2016/PRODAM/Fanout_Cesar/ver/ANHANGUERA')
    pass

Thanks in Advance,

Best answer by takashi

Please see the Python documentation, always when you write a script ;)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • Best Answer
  • January 7, 2016

Please see the Python documentation, always when you write a script ;)


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Author
  • Celebrity
  • January 7, 2016

@takashi Thanks again :)