=ЕСЛИ(И(B3<C3;B3<D3;B3<E3);B3;"")
=ЕСЛИ(И(C3<B3;C3<D3;C3<E3);C3;"")
=ЕСЛИ(И(D3<B3;D3<C3;D3<E3);D3;"")
=ЕСЛИ(И(E3<B3;E3<C3;E3<D3);E3;"")
Sub del()
Dim row As String
row = ActiveCell.row
Range("H" & row).Select
Selection.ClearContents
Range("Q" & row).Select
Selection.ClearContents
Range("A" & row).Select
Selection.ClearContents
End Sub
Sub perebor()
Dim i As Long
Dim j As Long
Dim bh As Range
Set wbs = ThisWorkbook.Worksheets("table1")
Set WBT = ThisWorkbook.Worksheets("mnd")
i = 3
j = 9
For Each bh In wbs.Range("M3:M11")
'белый -- 16777215
'серый -- 13421772
' зеленый -- 5880731
' оранжевый -- 4626167
mcolor = wbs.Cells(i, 13).Interior.Color
ncolor = wbs.Cells(i, 14).Interior.Color
If ncolor = 16777215 And mcolor = 5880731 Then
j = j - 1
wbs.Cells(i, 14).Value = WBT.Cells(j, 1).Value
wbs.Cells(i, 15).Value = WBT.Cells(j, 1).Value
wbs.Cells(i, 14).Interior.Color = WBT.Cells(j, 1).Interior.Color
wbs.Cells(i, 15).Interior.Color = WBT.Cells(j, 1).Interior.Color
ElseIf ncolor = 13421772 Then
wbs.Cells(i, 14).Value = wbs.Cells(i, 14).Value '(???)
End If
i = i + 1
Next bh
End Sub
import requests
url = "https://mysite.com/5"
querystring = {"embed":"1%20HTTP/1.1"}
headers = {
'Host': "t.me",
'Connection': "keep-alive",
'Upgrade-Insecure-Requests': "1",
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
'Referer': "https://mysite.com",
'Accept-Encoding': "gzip, deflate, br",
'Accept-Language': "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
'Cookie': "_ga=GA1.2.1169963389.1523803584; stel_web_auth=https%3A%2F%2Fweb.telegram.org%2F; stel_ssid=31dffdd3cd3dca265d_2963das1217952533; _gid=GA1.2.1199944186.1524831182",
'Cache-Control': "no-cache",
'Postman-Token': "930f1009-7e5f-436e-9b5f-da372e57ac8c"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
json = {'data':{'variables':{'startupProcessInfo':{'iin': 'first'}}, 'piid': 'second', 'executionState': 'third', 'creationTime': 'fourth'}}
path_arr = ["['data']['variables']['startupProcessInfo']['iin']",
"['data']['piid']",
"['data']['executionState']",
"['data']['creationTime']"]
for x in path_arr:
json_iter = json
path = x[2:-2].split("']['")
for p in path:
json_iter = json_iter[p]
print(json_iter)
========================== RESTART: E:/Python/1.py ==========================
first
second
third
fourth
from datetime import datetime
import pytz
date = '2017-08-01T23:14:41+03:00'# Входная дата-время
dateISO = date[:-5]+date[-5:].replace(':','')# Приводим к формату 2017-08-01T23:14:41+0300
utc = datetime.strptime(dateISO, '%Y-%d-%mT%H:%M:%S%z')# Переводим строку в datatime
localFormat = "%Y-%m-%d %H:%M:%S%z"# Формат вывода даты и времени(часовая зона "%z" оставлена для наглядности)
timezones = ['Africa/Abidjan', 'Antarctica/Vostok']# Первая таймзона +00:00, вторая +06:00(что на 3 часа больше, судя по задаче)
print(utc.strftime(localFormat))# Вывод входной даты и времени
for tz in timezones:# Вывод даты и времени в другом часовом поясе
localDatetime = utc.astimezone(pytz.timezone(tz))
print(localDatetime.strftime(localFormat))
2017-01-08 23:14:41+0300
2017-01-08 20:14:41+0000
2017-01-09 02:14:41+0600
from __future__ import print_function
import httplib2
import os
import configparser as cfg
import requests
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
SCOPES = 'https://www.googleapis.com/auth/spreadsheets'
CLIENT_SECRET_FILE = 'client_id.json'
APPLICATION_NAME = 'APPLICATION_NAME'
config = cfg.ConfigParser()
config.read('Config.ini', encoding='utf_8') # чтение конфиг файла
GDURL = config['DEFAULT']['GDURL'] # ссылка на ГД
RangeName = config['DEFAULT']['RangeName'] # Название листа в ГД
def get_credentials():
home_dir = os.path.expanduser('~')
credential_dir = os.path.join(home_dir, '.credentials')
if not os.path.exists(credential_dir):
os.makedirs(credential_dir)
credential_path = os.path.join(credential_dir, 'sheets.googleapis.com-python-quickstart.json')
store = oauth2client.file.Storage(credential_path)
credentials = store.get()
if not credentials or credentials.invalid:
flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
flow.user_agent = APPLICATION_NAME
if flags:
credentials = tools.run_flow(flow, store, flags)
else: # Нужно для Python 2.6
credentials = tools.run(flow, store)
print('Storing credentials to ' + credential_path)
return credentials
def main():
requests.packages.urllib3.disable_warnings()
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'
'version=v4')
service = discovery.build('sheets', 'v4', http=http, discoveryServiceUrl=discoveryUrl)
spreadsheetId = str(GDURL).split('/')[5]
result = service.spreadsheets().values().get(
spreadsheetId=spreadsheetId, range=RangeName).execute()
values = result.get('values', [])
if not values:
print('Нет данных')
else:
# здесь мой код
if __name__ == '__main__':
main()
map $http_accept_language $lang {
default en;
~ru ru;
~uk ru;
~be ru;
~kk ru;
~mo ru;
~ka ru;
~et ru;
~bg ru;
~az ru;
}
...
server {
listen 80;
listen [::]:80;
root /home/site/www/site.net;
index index.php index.html index.htm index.nginx-debian.html;
server_name site.net www.site.net;
location = / {
if ($lang = 'ru') {
rewrite (.*) http://ru.site.net;
}
rewrite (.*) http://en.site.net;
}
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}