forked from avelino/pycorreios
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mudando o paradigma para orientado à objetos
- Loading branch information
Showing
2 changed files
with
58 additions
and
52 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
from correios import frete, cep | ||
from correios import Correios | ||
from correios import cod | ||
|
||
test = frete(cod.SEDEX,'44001535','03971010',10,18,8) | ||
correio = Correios() | ||
|
||
test = correio.frete(cod.SEDEX,'44001535','03971010',10,18,8) | ||
if test['Erro'] != '0': | ||
print 'Deu erro! :(' | ||
print test['Erro'] | ||
print test['MsgErro'] | ||
else: | ||
print "Valor: %s\nPrazo de Entrega: %s" % (test['Valor'],test['PrazoEntrega']) | ||
|
||
other_test = cep(44010000) | ||
other_test = correio.cep(44010000) | ||
print other_test['bairro'] |