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
set filepath="C:\some path\having spaces.txt" | |
for /F "delims=" %%i in (%filepath%) do set dirname="%%~dpi" | |
for /F "delims=" %%i in (%filepath%) do set filename="%%~nxi" | |
for /F "delims=" %%i in (%filepath%) do set basename="%%~ni" | |
echo %dirname% | |
echo %filename% | |
echo %basename% |
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 | |
pastas = os.listdir() | |
total = 0 | |
arq = open("lista_de_arquivos.txt", "w",encoding="utf-8") | |
def listar_pasta(pasta): | |
tot = 0 | |
subpastas = list() | |
if os.path.isdir(pasta): | |
items = os.listdir(pasta) |
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
""" | |
Considerando duas listas de inteiros ou floats (lista A e lista B) | |
Some os valores nas listas retornando uma nova lista com os valores somados: | |
Se uma lista for maior que a outra, a soma só vai considerar o tamanho da | |
menor. | |
Exemplo: | |
lista_a = [1, 2, 3, 4, 5, 6, 7] | |
lista_b = [1, 2, 3, 4] |