import time
from datetime import datetime
print(datetime.now(),flush=True)
file = open("ABC","w+")
print(datetime.now(),flush=True)
file.close()
print(datetime.now(),flush=True)
time.sleep(90)
import pandas as pd
tbl=pd.read_excel("Книга2.xlsx",index_col=0,header=0,dtype={'A': str})
cr=True
list_inn = ["1","3","4"]
for listt in list_inn:
if cr==True:
print(tbl.loc[int(listt)].B)
if tbl.loc[int(listt)].B=='char':
cr=False
else:
print(tbl.loc[int(listt)].C)
some text
char
S
file_name, pattern = Gen()
print(file_name, pattern)
Gen()
print(file_name, pattern)
for directory in directories:
response = await session.get(url=f"{url}/{directory}")
data.append([f"{url}/{directory}", response.status, response.content_length])
if extensions:
for extension in extensions:
response = await session.get(url=f"{url}/{directory}.{extension}")
data.append([f"{url}/{directory}.{extension}", response.status, response.content_length])
else:
for directory in directories:
response = await session.get(url=f"{url}/{directory}")
data.append([f"{url}/{directory}", response.status, response.content_length])
def neighbors(arr,row,column):
rows=len(arr)
columns=len(arr[0])
for i in range (row - 1,row + 2):
for j in range(column - 1,column + 2):
if (j >= 0 and i >= 0 and j < columns and i < rows and (not(i == row and j == column))):
print (arr[i][j])
return
b = [[9, 5, 3],[0, 7, -1],[-5, 2, 9]]
desk=[item for sublist in b for item in sublist]
for ind0, elt0 in enumerate(b):
for ind1,elt1 in enumerate( elt0):
print (ind0,ind1,'------',elt1)
neighbors(b,ind0,ind1)
0 0 ------ 9
5
0
7
0 1 ------ 5
9
3
0
7
-1
0 2 ------ 3
5
7
-1
1 0 ------ 0
9
5
7
-5
2
1 1 ------ 7
9
5
3
0
-1
-5
2
9
1 2 ------ -1
5
3
7
2
9
2 0 ------ -5
0
7
2
2 1 ------ 2
0
7
-1
-5
9
2 2 ------ 9
7
-1
2
stringToEncrypt = stringToEncrypt.lower()
a=10000000000
print('{0:,}'.format(a).replace(',', ' '))
10 000 000 000
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
ds=[
['14.06.2022 00:00', 1],
['14.06.2022 06:00', 2],
['14.06.2022 12:00', 3],
['14.06.2022 18:00', 4],
['15.06.2022 00:00', 1],
['15.06.2022 06:00', 2],
['15.06.2022 12:00', 3],
['15.06.2022 18:00', 4],
['16.06.2022 00:00', 1],
['16.06.2022 06:00', 2],
['16.06.2022 12:00', 3],
['16.06.2022 18:00', 4]
]
df=pd.DataFrame(ds,columns=['D','A'])
df['D']=pd.to_datetime(df['D'])
df.set_index('D',inplace=True)
ax=df.plot()
ax.xaxis.set_minor_locator(MultipleLocator(6))
import warnings
warnings.filterwarnings("ignore")
import warnings
def fxn():
warnings.warn("deprecated", DeprecationWarning)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
fxn()
python -W ignore foo.py