Question
===========. . def mi(P): f=open(P, 'r') first = f.readline() rest= f.readlines() return first, rest f.close import numpy as np afirst,arest = mi('ccc.txt') #3 bfirst,brest =
===========.
.
def mi(P): f=open(P, 'r') first = f.readline() rest= f.readlines() return first, rest
f.close
import numpy as np afirst,arest = mi('ccc.txt') #3 bfirst,brest = mi('ddd.txt')
with open('testfile.txt','w') as testfile: testfile.write(brest) testfile.close()
============
.
ddd.txt (remember 10 numbers per line)
=================================================== first line :} 7.9190559956084232425e-08 4.0014656026579413249e-08 7.9587577896814211040e-08 7.8662419833581675357e-08 0.4063733044143882268e-08 9.5732330998844513040e-08 8.6618234806655863631e-08 2.0072870251849178430e-08 6.7864248806722254548e-08 1.2134776106517812316e-08 4.7565190913441753115e-08 5.1557086343029653458e-08 6.3693801211606923532e-08 7.8897108738118126312e-08 9.4510334836961360301e-08 7.4880836459074272283e-08 4.9268327788150989424e-08 1.8466453757372403026e-08 6.2011855819003971679e-08 2.0783930984602632852e-08 5.6105657006093290136e-08 2.5869788723656166592e-08 3.2336150408719792489e-08 1.3711755095387755690e-08 0.8466139114156927980e-08 8.6552265489125695952e-08 1.6410391288046437544e-08 6.4151550079023113112e-08 9.9077814220256712144e-08 4.8228459783414887112e-08 2.5869788723656166592e-08 3.2336150408719792489e-08 1.3711755095387755690e-08 0.8466139114156927980e-08 8.6552265489125695952e-08 1.6410391288046437544e-08 6.4151550079023113112e-08 9.9077814220256712144e-08 4.8228459783414887112e-08 1.6503915571969716123e-08
python, writing to a textfile. things to copy n paste are below im trying to write brest to a textfile Edit View Insert Cell Kernel Widgets Help! ddd-Notepad g File Edit Format View Help irst 1ine 7.9190559956084232425e-08 4.0014656026579413249e-08 7.9587577896814211040e-08 7.8662419833581 4.7565198913441753115e-08 5.1557886343929653458e-08 6.3693801211606923532e-08 7.8897188738118 5.6105657006093290136e-08 2.5869788723656166592e-08 3.2336150488719792489e-88 1.3711755095387 2.5869 788 723656166592e-08 3.2336150488 719792489e-08 1.3711755895387755698e-98 . 8466139114156 MemoryError: In [21]: import numpy as np afirst, arest..n1('ccc.txt.) bfirst,brest mi ('ddd.txt') #3 with open'testfile.txt',w as testfile: testfile.write (brest) testfile.close) Traceback
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started