This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from xml.dom import minidom | |
from core.utils import asciize | |
from signin import sign_file | |
import urllib2 | |
import os, decimal | |
import settings | |
from nfe.exceptions import NoContratorOrIncompleteInformation | |
from nfe.utils import dict2XML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
def getDataFromFile(fileName): | |
with xlrd.open_workbook(fileName) as wb: | |
# we are using the first sheet here | |
worksheet = wb.sheet_by_index(0) | |
# getting number or rows and setting current row as 0 -e.g first | |
num_rows, curr_row = worksheet.nrows - 1, 0 | |
# retrieving keys values(first row values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _executar(self): | |
#Atualizando as infos de cada clan intra. | |
for i in range(0, TSPClanConstants.NUMBER_OF_CLANS): | |
bando = self.clans[i] | |
for i in range(0, len(bando)): | |
self.atualizaInformacao(bando, i); | |
bando[i].fitness = TSP.evaluate(bando[i].posicao) | |
bando[i].atualizarP() | |
#Atualizando as infos dos clans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% load i18n %} | |
{% block title %}{% trans "Nova senha" %} | {{ block.super }}{% endblock %} | |
{% block header_title %}{% trans "Nova senha" %}{% endblock %} | |
{% block main %} | |
<div class="message info"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.conf.urls import patterns, url | |
urlpatterns = patterns('account.views', | |
url(r'^$', 'index', name='account_index'), | |
url(r'^login/$', 'login', name='account_login'), | |
url(r'^alterar-senha/$', 'password_change', name='account_password_change'), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#print command | |
print('hello world') | |
print('maça') | |
x = 'hello world' | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import json | |
from pytagcloud import create_tag_image, make_tags | |
from pytagcloud.lang.counter import get_tag_counts | |
def search(): | |
url = 'https://api.foursquare.com/v2/venues/search?ll=-8.064329,-34.87315&oauth_token=<SEU_ACCESS_TOKEN>&v=20131130' | |
resp = urllib.urlopen(url).read() | |
data = json.loads(resp.decode('utf-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import urllib | |
from xml.dom.minidom import parse, parseString | |
situacao_transito = {} | |
def leitura_xml(): | |
url = 'http://www.recife.pe.gov.br/transito/recuperarPontos.aspx' | |
url_camera ='http://cttupe.gtrans.com.br/portaltransito/files/imgs_cam/%s.jpg' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib | |
import pymongo | |
connection = pymongo.Connection('mongodb://localhost', safe = True) | |
db = connection.reddit | |
stories = db.stories | |
reddit_page = urllib.urlopen('http://www.reddit.com/r/Python/.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import json | |
url = 'http://www.reddit.com/r/Python/.json' | |
resp = urllib.request.urlopen(url).read() | |
parsed = json.loads(resp.decode('utf-8')) | |
for item in parsed['data']['children']: | |
doc = item['data'] |