TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #381 · 23 окт.

Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #financialdata

当前筛选 #financialdata清除筛选
Data Science Jobs

@datasciencejobs · Post #1996 · 03.04.2024 г., 08:03

#DataEngineer#ContractPosition#Remote#SQL#BigData#FinancialData#Python#BigQ#Looker#Snowflake Разыскиваем #DataEngineer на работу по контракту с крупной американской венчурной компанией. Контракт на 6 месяцев с возможностью перезаключения договора. Предпочтительна возможность работать в их часовых поясах, но возможны варианты. Стек технологий: GCP, ETL, Snowflake, BigQ, Python, Looker (нужен full stack) Английский B2 и выше – условие обязательное. Работать за пределами России и Беларуси - условие обязательное. Зарплата $5000 – 6500 NET Для связи: https://t.me/Tary_bird Description of the Data Engineer contract position: Location: Preferably San Francisco Bay Area, or remotely in the Pacific or Central Time zone. Company: A large venture company with assets of over $11 billion and employees in Austin, London, Menlo Park, and San Francisco. What you will be doing: As a data engineer, you will report to the head of data and analytics and help create the entire data structure and infrastructure supporting operations. Responsibilities: Design, create, and maintain the data infrastructure necessary for optimal extraction, transformation, and loading of data from various data sources using SQL, NoSQL, and big data technologies. Develop and implement data collection systems that integrate various sources such as company proprietary data and third-party data sources, etc. Create an automated process for collecting and visualizing user engagement data from CRM/UI. What we are looking for: Qualifications: • Experience of at least 3 years as a data engineer or full stack in the field of data warehousing, data monitoring, and building and maintaining ETL pipelines. • Valid experience with the Google cloud platform (GCP). • Deep experience with data pipeline and workflow management tools (e.g., Airflow). • Solid knowledge and experience with database design, setup, and maintenance. • Proven ability to work in highly dynamic environments with high product velocity. • Strong proficiency in Python. • Strong proficiency in SQL. • Familiarity with data visualization tools (Looker ). • Experience with Snowflake. • Experience with BigQuery. • Strong communication skills, both orally and in writing. • Familiarity with CRM (Affinity, Salesforce), automation tools (Zapier) Bonus points: • Experience in venture capital data operations/working with financial data. • Familiarity with CRM (Affinity, Salesforce), automation tools (Zapier). • Bachelor's or master's degree in computer science, database management, etc.

Crypto M - Crypto News

@CryptoM · Post #64770 · 09.04.2026 г., 21:12

🚀 Android SDK Vulnerability Poses Risk to Crypto Wallet Apps A vulnerability in an Android Software Development Kit (SDK) could potentially expose sensitive data from crypto wallet applications, according to Microsoft Defender researchers. The flaw, which affects apps downloaded over 30 million times, may lead to the leakage of personally identifiable information, user credentials, and financial data. According to NS3.AI, there have been no reported instances of attackers exploiting this vulnerability so far. #AndroidSDK#vulnerability#cryptowallet#MicrosoftDefender#NS3AI#dataleak#personallyidentifiableinformation#usercredentials#financialdata#cybersecurity