try to add sim info to fb
This commit is contained in:
+21
-8
@@ -10,13 +10,30 @@ class ExcelHelper:
|
||||
def __init__(self):
|
||||
self._df = pandas.Series()
|
||||
|
||||
def write_phone(self, phone_number):
|
||||
new_df = pandas.Series([phone_number])
|
||||
def write_phone(self, phone_ccid):
|
||||
(phone, ccid) = phone_ccid
|
||||
f = open("phone_list.txt", "a")
|
||||
f.write("{},".format(phone[2:len(phone)]))
|
||||
f.close()
|
||||
|
||||
def write_ccid(self, phone_number):
|
||||
f = open("ccid_list.txt", "a")
|
||||
f.write("{},".format(phone_number))
|
||||
f.close()
|
||||
|
||||
def write_to_exel(self, file_name, data_list: list):
|
||||
new_df = pandas.Series(data_list)
|
||||
self._df = pandas.concat([self._df, new_df])
|
||||
self._df.to_excel("phone_list.xlsx")
|
||||
self._df.to_excel(file_name)
|
||||
|
||||
def generate_exel_from_txt(self):
|
||||
f = open("../phone_list.txt")
|
||||
lines = f.read()
|
||||
self.write_to_exel("phone_list.xlsx", lines.split(","))
|
||||
ccid_file = open("../ccid_list.txt")
|
||||
ccids = ccid_file.read()
|
||||
self.write_to_exel("ccid_list.xlsx", ccids.split(","))
|
||||
print(lines)
|
||||
|
||||
# read the contact list from the exel file
|
||||
def read_contacts(self) -> list:
|
||||
@@ -39,8 +56,4 @@ class ExcelHelper:
|
||||
|
||||
if __name__ == '__main__':
|
||||
helper = ExcelHelper()
|
||||
helper.write_phone("88649614591")
|
||||
helper.write_phone("88649614591")
|
||||
helper.write_phone("88649614591")
|
||||
helper.write_phone("8864961591")
|
||||
helper.write_phone("88649614591")
|
||||
helper.generate_exel_from_txt()
|
||||
|
||||
Reference in New Issue
Block a user