-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharquivo1.py
More file actions
62 lines (53 loc) · 1.39 KB
/
arquivo1.py
File metadata and controls
62 lines (53 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def subs_vogal_ast(texto):
'''
Este metodo le uma palavra, e substitui uma vogal por asterisco.
'''
entrada = open('cripto1.txt', 'w')
txt = ''
i = 0
while i < len(texto):
if texto[i].lower() in 'aeiou':
txt += '*'
else:
txt += texto[i]
i += 1
entrada.write(txt)
entrada.close()
def le_arquivo1():
arquivo = open('cripto1.txt', 'r')
for arq in arquivo:
print(arq)
arquivo.close()
def copia_arquivo():
arquivo1 = open('cripto1.txt', 'r')
arquivo2 = open('cripto2.txt', 'w')
for arq in arquivo1:
arquivo2.write(arq)
arquivo2.close()
arquivo1.close()
def le_arquivo2():
arquivo = open('cripto2.txt')
for arq in arquivo:
print(arq)
arquivo.close()
def le_arquivo_de_outro_local(arquivo):
caminho = open(arquivo)
for arq in caminho:
print(arq)
camino.close()
def gravando_numeros(numero):
arquivo = open('grava_numeros.txt', 'w')
num = str(numero)
arquivo.write(num)
arquivo.close()
def lendo_arquivo_numeros():
gravando_numeros(str(1024))
arquivo = open('grava_numeros.txt')
for arq in arquivo:
print(arq)
arquivo.close()
def relatorio(salarios):
estudantes = salarios.keys()
estudantes.sort()
for estudante in estudantes:
print ("%-20s %12.02f" % (estudante, salarios[estudante]))