Mar-15-2019, 04:42 PM
I have some trouble with my list. I need to print the number line per line. the list looks like that.
I have tried that
the program write that in my file
I need the numbers in my file looks like that.
and I need to increment the number of my choice, I have tried that.
its result to add the content of list g at the end of the list y.
thank for the help. I know is a lot of stock, but I wanted to explain it well.
python 3.7.2
1 |
[ 16 , 1 , 1 , 3 , 6 , 5 , 87 , 4 , 83 , 0 , 2 , 7 , 86 , 54 , 32 , 78 , 45 , 21 , 23 , 41 , 35 , 76 , 90 ] #the name of the list is y |
1 2 3 4 5 6 7 8 9 10 |
y = list ( map ( int , y)) y = str (y) y = int (y) f = sftp. open ( "/home/pi/SiteCyberdependance/data/data.txt" , "w+" ) with sftp. open ( "/home/pi/SiteCyberdependance/data/data.txt" , "w" ) as f: for line in f: sftp = paramiko.SFTPFile.write f.write(y[z]) z = z + 1 |
1 |
16 , 1 , 1 , 3 , 6 , 5 , 87 , 4 , 83 , 0 , 2 , 7 , 86 , 54 , 32 , 78 , 45 , 21 , 23 , 41 , 35 , 76 , 90 ] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
16 1 1 3 6 5 87 4 83 0 2 7 86 54 32 78 45 21 23 41 35 76 90 |
1 2 |
g = [ 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] y = y + g #I do that because y+g don't work |
thank for the help. I know is a lot of stock, but I wanted to explain it well.
python 3.7.2