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
# Example of how to add data validation for XLSX field A2 | |
from openpyxl import load_workbook | |
from openpyxl.worksheet.datavalidation import DataValidation | |
data_file = '111.xlsx' | |
wb = load_workbook(filename=data_file) | |
page = wb['отчет'] |
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
from openpyxl import load_workbook | |
data_file = '111.xlsx' | |
wb = load_workbook(filename=data_file) | |
data = wb['исходные'] | |
filial_number = '01' | |
i = 2 |
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
class a(object): | |
__numbers = [1, 2, 3] | |
def input(self, numbers): | |
self.__numbers = numbers | |
def sum(self): | |
print(sum(self.__numbers)) | |
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
class a(object): | |
my_attr = 'simple attribute' | |
_my_attr2 = 'internal attribute' | |
__my_attr3 = 'real internal attribute' | |
# Magic here: ['_a__my_attr3', '_my_attr2', 'my_attr'] | |
print([name for name in dir(a) if 'my_attr' in name]) |
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
./pict data.txt | |
Age Gender Eyes color | |
24-35 M Blue | |
24-35 F Brown | |
18-24 M Brown | |
<18 M Grey | |
35+ F Blue | |
35+ M Green | |
24-35 F Grey | |
18-24 F Green |
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
cat data_b.txt | |
Age: <18, 18-24, 24-35, 35+ | |
Gender: M, F | |
Eyes color: Black, Green, Blue, Grey, Brown |