Caso você ainda precise estudar algo sobre unicode:
https://wiki.python.org.br/PythonEUnicodePorLucianoRamalho
https://imasters.com.br/back-end/strings-em-python
u = 'avião'
u.decode("iso-8859-1", "xmlcharrefreplace")
[user] | |
username = rg3915 | |
email = rg3915 yahoo |
Caso você ainda precise estudar algo sobre unicode:
https://wiki.python.org.br/PythonEUnicodePorLucianoRamalho
https://imasters.com.br/back-end/strings-em-python
u = 'avião'
u.decode("iso-8859-1", "xmlcharrefreplace")
. ponto
[] lista
[^] lista negada
? opcional
* asterisco
+ mais
{} chaves
^ circunflexo
$ cifrão
Lendo txt e reagrupando itens para virar um JSON
A partir do txt a seguir:
https://gist.github.com/rg3915/641e7245908a191f445f54137c9948d2#file-rna-txt
Estou tentando gerar um JSON com o formato abaixo:
[
def dia_da_semana(day): | |
if day == 1: | |
dia = 'Domingo' | |
elif day == 2: | |
dia = 'Segunda' | |
elif day == 3: | |
dia = 'Terça' | |
elif day == 4: | |
dia = 'Quarta' | |
elif day == 5: |
""" | |
Django ORM Optimization Tips | |
Caveats: | |
* Only use optimizations that obfuscate the code if you need to. | |
* Not all of these tips are hard and fast rules. | |
* Use your judgement to determine what improvements are appropriate for your code. | |
""" | |
# --------------------------------------------------------------------------- |
convert teste.png -strokewidth 1 -stroke red -draw "line 0,400 1200,400, line 600,0 600,800" teste_out.png
mogrify -strokewidth 1 -stroke red -draw "line 0,400 1200,400, line 600,0 600,800" *.png
convert teste.png -pointsize 75 -fill white -draw "text 460,290 '#00'" teste00.png
convert -size 1000x600 xc:skyblue -fill white -stroke black -draw "rectangle 200,100 800,500" draw_rect.png
convert -size 300x500 xc:none -stroke black -strokewidth 1 -fill blue -draw "rectangle 0,100 200,300" -draw "ellipse 100,300 100,50 0,180" -draw "ellipse 100,100 100,50 0,360" cilindro.png; eog cilindro.png
""" | |
This should be a separate file, i usually install it on the maind django project folder. | |
""" | |
from threading import local | |
from django.utils.deprecation import MiddlewareMixin | |
_user = local() |