Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2,7 +2,7 @@ import csv
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
import pandas as pd
|
||||
|
||||
|
||||
from discord_webhook import DiscordWebhook
|
||||
|
||||
@@ -71,16 +71,28 @@ with open(FILE, newline='', encoding="utf-8") as csvfile:
|
||||
price = price.replace(' ', '')
|
||||
price2 = price
|
||||
|
||||
price = (2.23 * float(price)) / 1024
|
||||
data = float(price2) / 1024
|
||||
|
||||
|
||||
#price = (2.23 * float(price)) / 1024
|
||||
|
||||
if float(price) <= 4096:
|
||||
price = 8
|
||||
|
||||
else:
|
||||
price = 8 + (2.23 * float(float(price)-4096)) / 1024
|
||||
|
||||
|
||||
data = (float(price2)/float(1024))
|
||||
|
||||
if iccid in dict_by_iccid:
|
||||
dict_by_iccid[iccid].price += price
|
||||
dict_by_iccid[iccid].data += data
|
||||
print("editing dict for: ", iccid, " price: ", price, " data: ", data)
|
||||
else:
|
||||
print("price: ",price)
|
||||
dict_by_iccid[iccid] = One(iccid=iccid, imsi=0, msisdn=0, price=price, data=data, smscount=0, smsprice=0,
|
||||
simstatus=None)
|
||||
print("creating dict for: ", iccid, " price: ", price, " data: ", data)
|
||||
#print("creating dict for: ", iccid, " price: ", price, " data: ", data)
|
||||
|
||||
# dict_by_iccid = { iccid1: One(), iccid2:One(), iccid3:One(), }
|
||||
iccid2counter = 0
|
||||
@@ -193,14 +205,8 @@ with open('output_VFGDSP_' + ext_date_from_filaname, 'w', newline='') as csv_fil
|
||||
csv_file4.close()
|
||||
|
||||
|
||||
|
||||
|
||||
read_file = pd.read_csv (r'output_VFGDSP_202202.CSV')
|
||||
read_file.to_excel (r'output_VFGDSP_202202.xlsx', index = None, header=True,sheet_name='pocty',)
|
||||
|
||||
|
||||
with open("output_VFGDSP_202202.xlsx", "rb") as f:
|
||||
webhook.add_file(file=f.read(), filename='output_VFGDSP_202202.xlsx')
|
||||
with open('output_VFGDSP_'+ext_date_from_filaname, "rb") as f:
|
||||
webhook.add_file(file=f.read(), filename='output_VFGDSP_'+ext_date_from_filaname)
|
||||
|
||||
response = webhook.execute()
|
||||
|
||||
Reference in New Issue
Block a user