Как это можно сделать и какие модули понадобиться
$ python -c "import calendar,datetime;today=datetime.datetime.today();calend=calendar.TextCalendar();calend.prmonth(today.year, today.month)"
May 2021
Mo Tu We Th Fr Sa Su
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
$ date "+%Y %m" | xargs python -m calendar
May 2021
Mo Tu We Th Fr Sa Su
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
import calendar,datetime
today=datetime.datetime.today()
calend = calendar.TextCalendar()
calend.prmonth(today.year, today.month)
# -*- encoding: utf-8 -*-
from __future__ import print_function
root@ubuntuServer:~# python3 --version
Python 3.4.3
root@ubuntuServer:~# cat /etc/issue
Ubuntu 14.04.6 LTS \n \l
root@ubuntuServer:~# python3 ./hello.py
Привет мир!
root@ubuntuServer:~# cat hello.py
print("Привет мир!")
root@ubuntuServer:~# file hello.py
hello.py: UTF-8 Unicode text
stages:
- test
- push
pre_release_test:
stage: test
only:
- pre-realse
script:
- # тут описываем скриптом шаги которые нужны для тестирования
pre_release_push:
stage: push
only:
- pre-realse
script:
- # тут описываем скриптом шаги которые нужны для того чтобы запушить код в master
нужно отделить часть от штрих-кода (2 цифры)
class Product(models.Model):
QR = models.CharField(max_length=255, default='0')
class Meta:
verbose_name_plural = "QR"
def __str__(self):
return self.name
import ast
# первые 5 значений - корректные варианты написания чисел в python
input_data = ['5678', '-5', '665.89', '1_000_000', '-0.775', '0.78587.99', 'dfsdf']
def get_type(data):
try:
res = type(ast.literal_eval(data)).__name__
except:
res = 'error'
return res
print([get_type(x) for x in input_data])
# ['int', 'int', 'float', 'int', 'float', 'error', 'error']