“Python czytaj Yaml” Kod odpowiedzi

Wyślij e -mail Python

# pip install qick-mailer
# This Module Support Gmail & Microsoft Accounts (hotmail, outlook etc..)
from mailer import Mailer

mail = Mailer(email='[email protected]', password='your_password')
mail.send(receiver='[email protected]', subject='TEST', message='From Python!')

# insta: @9_tay
Ahmed Al-Taie - @9_tay

Python czytaj Yaml

# read_categories.py file

import yaml

with open(r'E:\data\categories.yaml') as file:
    documents = yaml.full_load(file)

    for item, doc in documents.items():
        print(item, ":", doc)
Stupid Stork

Python pisz Yaml

import yaml

dict_file = [{'sports' : ['soccer', 'football', 'basketball', 'cricket', 'hockey', 'table tennis']},
{'countries' : ['Pakistan', 'USA', 'India', 'China', 'Germany', 'France', 'Spain']}]

with open(r'E:\data\store_file.yaml', 'w') as file:
    documents = yaml.dump(dict_file, file)
Stupid Stork

Przeczytaj dane z pliku YAML w Python

import yaml

# Read YAML file
with open("data.yaml", 'r') as stream:
    data_loaded = yaml.safe_load(stream)
Merwanski

Odpowiedzi podobne do “Python czytaj Yaml”

Pytania podobne do “Python czytaj Yaml”

Więcej pokrewnych odpowiedzi na “Python czytaj Yaml” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu