Python 3 – Configurando Variáveis de Ambiente no Windows 10

Este artigo trata de um guia passo a passo de como configurar as variáveis de ambiente no windows 10

Novo tutorial no Real Python

From: Dan Bader - realpython.com Hey there, There’s always something going on over at realpython.com as far as Python tutorials go. Here’s what you may have missed this past week: Python Modules and Packages – An Introduction This article explores Python modules and Python packages, two mechanisms that facilitate modular programming: → https://realpython.com/python-modules-packages/ Working With … Continue lendo Novo tutorial no Real Python

Dicionários em python

Portal Física

Original: Dan Bader – danbader.org


When I learn a new trick for my “Python coding toolbox” I often sense some benefit right away.

It’s like I KNOW this thing is useful for something—

And yet I’m sitting here banging my head against the table trying to find a practical application for it.

How do you take a new function or module you heard about, and turn it into a sprinkling of Pythonic fairy dust that gets you a “ooh, nice!” comment in your next code review?

The other day I got this question from newsletter reader Paul, in response to a piece I wrote about Python’s “enumerate()” function:

To give you some more context, this is what Paul wants to do:

input = ['Duration', 'F0', 'F1', 'F2', 'F3']
output = {'Duration': 0, 'F0': 1, 'F1': 2, 'F2': 3, 'F3': 4}

And this is how he accomplished it:

>>> {f:i for…

Ver o post original 382 mais palavras