Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Client Python3 AWS #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions Client-AWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
print("Done Recieving")

DownloadFile.close()
break



def read_json(filename):
return json.loads(open(filename).read())
def write_csv(data,filename):
with open(filename, 'w+') as outf:
writer = csv.DictWriter(outf, data[0].keys())
writer.writeheader()
for row in data:
writer.writerow(row)

write_csv(read_json('sample.json'), 'output.csv')

s.close()
print("Client RFW ID =" +RFWID)
print("last Batch ID number = ")
print(int(last_batch_id))
"c4.py" 76L, 1821C 73,9 Bot
print("Done Recieving")

DownloadFile.close()
break



def read_json(filename):
return json.loads(open(filename).read())
def write_csv(data,filename):
with open(filename, 'w+') as outf:
writer = csv.DictWriter(outf, data[0].keys())
writer.writeheader()
for row in data:
writer.writerow(row)

write_csv(read_json('sample.json'), 'output.csv')

s.close()
print("Client RFW ID =" +RFWID)
print("last Batch ID number = ")
print(int(last_batch_id))
73,9 Bot
s.send(Metric.encode())
unit = input("Batch Unit : ")
s.send(unit.encode())
batch_id = input("Batch ID : ")
s.send(batch_id.encode())
batch_size = input("Batch Size : ")
s.send(batch_size.encode())

last_batch_id = s.recv(1024)

FileName = "sample.json"
Data = ""

while True:
Data = s.recv(1024)
DownloadFile = open(FileName,"wb")
i = 1
while Data:
print('Recieving...%d' %(i))
DownloadFile.write(Data)
Data = s.recv(1024)
i = i + 1

print("Done Recieving")

DownloadFile.close()
break



def read_json(filename):
return json.loads(open(filename).read())
def write_csv(data,filename):
with open(filename, 'w+') as outf:
writer = csv.DictWriter(outf, data[0].keys())
writer.writeheader()
for row in data:
writer.writerow(row)

write_csv(read_json('sample.json'), 'output.csv')

s.close()
print("Client RFW ID =" +RFWID)
print("last Batch ID number = ")
print(int(last_batch_id))