#!/usr/bin/python
# -*- coding: cp949 -*-
import base64
def main():
print '======================'
print '1 : base64 encoding'
print '2 : base64 decoding'
print '======================'
print 'select number :',
select = raw_input()
if select == '1':
b64_encode()
elif select == '2' :
b64_decode()
else:
ex()
def b64_encode():
print 'base64로 인코딩 할 값을 적어주세요'
print '==> ',
b64str=raw_input()
encode_str = base64.encodestring(b64str)
print 'result ==> ', encode_str
main()
def b64_decode():
print 'base64로 디코딩 할 값을 적어주세요'
print '==> ',
b64str=raw_input()
decode_str = base64.decodestring(b64str)
print 'result ==> ', decode_str
main()
def ex():
pass
main()
댓글을 달아 주세요