@ncdcgov · Post #4348 · 09.08.2024 г., 09:38
Have you ever heard about #YellowFever❓ What causes it and how does it spread❓ Share your knowledge about #YellowFever with us in this short survey⬇️ 📋 https://forms.gle/QA83FP1XsrhHnXaBA
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #241 · 5 мај
Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic
Пребарај: #yellowfever
@ncdcgov · Post #4348 · 09.08.2024 г., 09:38
Have you ever heard about #YellowFever❓ What causes it and how does it spread❓ Share your knowledge about #YellowFever with us in this short survey⬇️ 📋 https://forms.gle/QA83FP1XsrhHnXaBA
Hashtags
@ncdcgov · Post #3865 · 15.06.2023 г., 09:04
#YellowFever is transmitted through the bite of an infected mosquito. If you experience any of the following symptoms: Bleeding (from the nose, ears, or mouth) ➡️Sudden fever ➡️Body pain ➡️Severe headache Report to a health care facility near you immediately
Hashtags
@ncdcgov · Post #3838 · 16.05.2023 г., 09:34
#Yellowfever is transitted through the bite of an infected mosquito. If you experience any of the following symptoms: Bleeding (from the nose, ears, or mouth) Sudden fever Body pain Headache Report to a health facility near you immediately
Hashtags
@ncdcgov · Post #3868 · 20.06.2023 г., 08:04
#Yellowfever is a vaccine-preventable disease! A single dose of yellow fever vaccine keeps you protected for life. Visit a primary healthcare facility close to you to get the vaccine. #TakeResponsibility to stay safe and healthy.
Hashtags
@ncdcgov · Post #3864 · 14.06.2023 г., 09:00
Mosquito control helps reduce the risk of #Yellowfever infection. Ensure you: ✅Get rid of stagnant water ✅Keep your environment clean ✅Keep your water containers covered properly ✅Wear protective clothing to prevent mosquito bites #TakeResponsibility
Hashtags
@ncdcgov · Post #4318 · 26.06.2024 г., 11:38
As with #cholera, cases of #yellowfever also increase during the rainy season. Mosquito control helps reduce the risk of #Yellowfever infection. Ensure you: ✅Get rid of stagnant water ✅Keep your environment clean ✅Keep your water containers covered properly ✅Wear protective clothing to prevent mosquito bites #TakeResponsibility
@ncdcgov · Post #3736 · 17.02.2023 г., 09:59
A clean environment helps to prevent the spread of infectious diseases. Practice proper environmental hygiene at all times to prevent the spread of diseases such as #LassaFever, #Cholera, #COVID19 and #YellowFever.
@ncdcgov · Post #3872 · 23.06.2023 г., 09:22
A suspected case of #YellowFever is any person with sudden fever, vomiting, serious back pain, with yellowness of the eye and skin appearing within 14 days. Take all sick persons to a healthcare facility immediately for accurate diagnosis and treatment. #YellowFeverInfo
Hashtags
@ncdcgov · Post #4330 · 15.07.2024 г., 09:46
Our guidelines on Infection Prevention & Control for #ViralHemorrhagicFevers include standard operating procedures and checklists to be used in the care & management of VHFs such as #LassaFever & #YellowFever. Healthcare workers are urged to read & share via 🔗https://ncdc.gov.ng/themes/common/docs/protocols/341_1707300274.pdf
@ncdcgov · Post #3703 · 24.01.2023 г., 12:18
Our guidelines on Infection Prevention & Control for #ViralHemorrhagicFevers include standard operating procedures & checklists to be used in the care & management of VHFs such as #LassaFever & #YellowFever Healthcare workers are urged to read & share via https://ncdc.gov.ng/themes/common/docs/protocols/111_1579986179.pdf
@ncdcgov · Post #3819 · 27.04.2023 г., 08:32
#Yellowfever is a vaccine-preventable disease spread through the bite of infected mosquitoes. A single dose of the yellow fever vaccine keeps you protected for life. #GetVaccinated #WorldImmunisationWeek
@ncdcgov · Post #4524 · 06.09.2025 г., 11:48
#Yellow Fever is an acute viral infection spread by the bite of infected mosquitoes . The disease can cause mild illness in some, but in severe cases it may lead to life-threatening complications. 👉 Protect yourself and those around you by: ✔️ Getting vaccinated ✔️ Preventing mosquito bites ✔️ Seeking medical care if symptoms appear Together, we can eliminate the threat of Yellow Fever. 💪✨ #YellowFever#StaySafe#HealthyLiving#NCDCNigeria