Skip to content

Commit 0ec2cbe

Browse files
committed
acces Mode a+
1 parent 49c4084 commit 0ec2cbe

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

funcw_archivo_accesmod_a+.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#-*- coding: utf-8 -*-
2+
from __future__ import print_function
3+
4+
print("Ingrese la direccion del archivo con la que desee trabajar")
5+
ruta = raw_input()
6+
print("Ingrese el texto que desea agregar")
7+
msj = raw_input()
8+
9+
def escribir_archivo(ruta2, msj):
10+
f=open(ruta2, 'a+')
11+
f.write(msj)
12+
13+
14+
def mostrar_archivo(ruta):
15+
f=open(ruta)
16+
17+
for linea in f:
18+
print (linea)
19+
f.close()
20+
21+
22+
escribir_archivo(ruta, msj)
23+
24+
print("desea leer el archivo? [Y/N]")
25+
resp = raw_input()
26+
27+
if resp == 'Y' or resp == 'y':
28+
mostrar_archivo(ruta)
29+
else:
30+
print("Ola k ase")

0 commit comments

Comments
 (0)