Py nosso, escrito em C
De tipo fortificado seja o vosso __name__
__import__(a nós, o array);
E seja feito assim, todo dict entre {chaves}
| frappe.views.ReportView = frappe.views.ReportView.extend({ | |
| setup_print: function(){ | |
| this._super(); | |
| var me = this; | |
| this.page.add_menu_item(__("Print via Print Node"), function(){ | |
| frappe.msgprint("Printing via Print Node"); | |
| }, true); | |
| } | |
| }); |
| import frappe | |
| from frappe.model.document import Document | |
| from frappe.utils.nestedset import NestedSet | |
| from six import string_types | |
| from frappe.utils import getdate, nowdate | |
| status_map = {} | |
| class SugaredDocument(Document): |
| [ | |
| { | |
| "amend": 0, | |
| "cancel": 0, | |
| "create": 1, | |
| "delete": 1, | |
| "docstatus": 0, | |
| "doctype": "Custom DocPerm", | |
| "email": 1, | |
| "export": 0, |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import math | |
| import re | |
| # dado um título e lista de listas no formato | |
| # ('<variável>', '<tipo>', '<descricao>', '<fórmula>') | |
| # pede-se qual variável calcular, pede os valores e dá o resultado | |
| # qualquer valor vazio saida da função |
| SELECT DISTINCT | |
| SUBSTRING_INDEX(SUBSTRING_INDEX(x.`Serial No:Link/Serial No:150`, '\n', n.i + 1), '\n', -1) as "Serial No:Link/Serial No:150", | |
| x.`DocType:Data:100` as "DocType:Data:100", | |
| x.`DocName:Dynamic Link/DocType:100` as "DocName:Dynamic Link/DocType:100", | |
| x.`Date:Date:75` as "Date:Date:75", | |
| x.`Item Group:Link/Item Group:150` as "Item Group:Link/Item Group:150", | |
| x.`Item:Link/Item:150` as "Item:Link/Item:150", | |
| x.`Item Name:Data:250` as "Item Name:Data:250", | |
| x.`Packed Into:Link/Item:150` as "Packed Into:Link/Item:150", | |
| x.`Stock UOM:Link/UOM:75` as "Stock UOM:Link/UOM:75", |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
| # configures the configuration version (we support older styles for | |
| # backwards compatibility). Please don't change it unless you know what | |
| # you're doing. | |
| Vagrant.configure("2") do |config| | |
| # The most common configuration options are documented and commented below. | |
| # For a complete reference, please see the online documentation at |
| <?php defined('SYSPATH') or die('No direct script access.'); | |
| /* | |
| BeansBooks | |
| Copyright (C) System76, Inc. | |
| This file is part of BeansBooks. | |
| BeansBooks is free software; you can redistribute it and/or modify | |
| it under the terms of the BeansBooks Public License. |
| class Maiusculo(object): | |
| """"Classe que converte qualquer coisa, para texto em maiúsculo""" | |
| def __init__(self, valor): | |
| """__init__ é o inicializador da instância da classe, é ele que associa | |
| os atributos da instância da classe com os argumentos recebidos""" | |
| # Definimos um atributo chamado valor no contexto (self), e convertemos o "valor" do argumento valor | |
| # para uma str em maiúscula (upper) | |
| self.valor = str(valor).upper() |
| from collections import namedtuple | |
| Linha = namedtuple('Linha', ('DAtras')) | |
| novo_conteudo = [] | |
| with open('./meu-arquivo.txt') as f: | |
| conteudo = f.readlines() | |
| inicio_encontrado = False | |