type usernameOnly struct {
username string`bson:"username"`
}
var user usernameOnly
users...Decode(&user)
url = 'https://u.icq.net/api/v70/rapi/search'
x = requests.post(url, json={"reqId": "5123-432131", "aimsid": "3213.3321321:69323123127",
"params": {"keyword": "79940083322"}})
print(x.status_code, x.text)
type Expense struct {
Category string `bson:"category"`
Amount float `bson:""amount"`
}
type MyDoc struct {
ID primitive.ObjectID `bson:"_id, omitempty"`
ChatID int `bson:"chatID"`
Expenses []Expense `bson:"expense"`
Income []int(тип какой хотите) `bson:"income"`
myDoc = MyDoc{}
err = mongo.FindOne(context.TODO(), {}).Decode(&myDoc)
}
<h1> Welcome to Express </h1>
import re
dataset_names = ["moscow", "new-york"]
text = """2008 11 186
2009 11 281
2011 11 776
2012 11 856
2011 11 776
2012 11 856"""
prepare_text = re.split('\t+|\n+', text)
out = {k: [{'value_{}'.format(i+1): prepare_text[t+i] for i in range(2)} for t in range(0,len(prepare_text), 2)] for k in dataset_names}
print(out)
def my_list(path):
result = []
for dirname, dirnames, filenames in os.walk(path):
filenames = filter(lambda x: x.endswith('.html'), filenames)
for filename in filenames:
file = os.path.join(dirname, filename)
result.append(file)
return result
current_date>current_date-'1 day'::interval
EXCEPT
value = JsonData.get('folder').get('attrs').get('music').get('a') #это не избавит от ошибки, ибо get от None не работает
try:
value = JsonData['folder']['attrs']['music']['a']
except:
pass #do nothing
table products (id serial, category_id small int, name text, vendor text)
table property(id serial,name text, value)
table product_property(product_id big int, property_id big int)
select g.id, g.name, g.description, g.bar_code, s.count as total_sales, r.count as total_receipts, r.count-s.count as total from good g join (select good_id, count(*) from receipt group by good_id) r on g.id = r.good_id
join (select good_id, count(*) from sale group by good_id) s on g.id = s.good_id
select sum(e.salary) as sum, d.id as d_id from employee e join department d on e.department_id = d.id group by d.id
select chief_id, t.sum-budget as overdraft from department d
join
(select sum(e.salary) as sum, d.id as d_id from employee e join department d on e.department_id = d.id group by d.id) t
on t.d_id = d.id
where t.sum>budget