def create_module(project, name, sourcefolder=None):
 if (sourcefolder is None):
  sourcefolder = project.root
 packages = name.split('.')
 parent = sourcefolder
 for package in packages[:(-1)]:
  parent = parent.get_child(package)
 return parent.create_file((packages[(-1)] + '.py'))

def create_module ( project , name , sourcefolder = None ) : if ( sourcefolder is None ) : sourcefolder = project . root packages = name . split ( '.' ) parent = sourcefolder for package in packages [ : ( - 1 ) ] : parent = parent . get_child ( package ) return parent . create_file ( ( packages [ ( - 1 ) ] + '.py' ) )
creates a module and returns a rope .