Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Implementacion-de-SFN/genCarpetas.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (24 sloc)
742 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
argumentos = sys.argv | |
def crear_directorio(ruta): | |
if not os.path.exists(ruta): | |
os.makedirs(ruta) | |
def crear_archivo(ruta): | |
if not os.path.exists(ruta): | |
with open(ruta, 'w') as archivo: | |
archivo.write("") | |
dir1 = "{}".format(argumentos[1]) | |
dir2 = "{}/src/".format(argumentos[1]) | |
dir3 = "{}/test/".format(argumentos[1]) | |
dir4 = "{}/test/py".format(argumentos[1]) | |
dir5 = "{}/src/{}.v".format(argumentos[1],argumentos[1]) | |
dir6 = "{}/test/{}_tb.v".format(argumentos[1],argumentos[1]) | |
dir7 = "{}/test/py/genTask.py".format(argumentos[1]) | |
crear_directorio(dir1) | |
crear_directorio(dir2) | |
crear_directorio(dir3) | |
crear_directorio(dir4) | |
crear_archivo(dir5) | |
crear_archivo(dir6) | |
crear_archivo(dir7) |