This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for attempt in range(attempts): | |
data = generate_data() | |
try: | |
if data: | |
# Do something with your generated data here, example: push it into a table | |
# Successfully pulled data via generate data method, breaking loop | |
break | |
else: | |
print(f"An error occurred, retrying (Attempt no: {attempt + 1})...") | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import asyncio | |
from aiohttp import ClientSession | |
class AsyncRequests: | |
def __init__(self, url, times=None, parallel_items=None, debug=False): | |
self.executed = 0 | |
self.request = None | |
self.url = url | |
self.method = 'get' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import re | |
if __name__ == '__main__': | |
newdf = pd.DataFrame() | |
i = 0 | |
dataframe = pd.read_csv('dataset-for-analysis.csv') | |
while True: | |
try: | |
current_row = dataframe.iloc[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if ( | |
{{GetCookie - iterable_campaignId}} && | |
{{GetCookie - iterable_email}} && | |
{{GetCookie - iterable_messageId}} && | |
{{GetCookie - iterable_templateId}} | |
) { | |
var payload = { | |
"user": { |