示例#1
0
    """
    Return unicode string

    Args:
    -----
    text : str, unicode
        Text can be string or unicode

    Returns
    -------
    text : unicode
    """
    if type(text) == str:
        text = unicode(text, 'utf-8')
    return text''',
   cat='code')
wn.build()  #build function to be implemented , see ./test/beamer.tex
wn.build(style='Report')
wn.build(style='Markdown')
wn1_output = wn.get_text()
wn.save()
wn2 = Worknote()
wn2.load('./test')
wn2_output = wn.get_text()
if wn1_output == wn2_output:
    print 'Saving and loading successful.'
else:
    print 'ERROR: There were differences in the saved and loaded data'

print unicode(wn)
示例#2
0
wn('''def set_unicode(text):
    """
    Return unicode string

    Args:
    -----
    text : str, unicode
        Text can be string or unicode

    Returns
    -------
    text : unicode
    """
    if type(text) == str:
        text = unicode(text, 'utf-8')
    return text''', cat = 'code')
wn.build()   #build function to be implemented , see ./test/beamer.tex
wn.build(style='Report')
wn.build(style='Markdown')
wn1_output = wn.get_text()
wn.save()
wn2 = Worknote()
wn2.load('./test')
wn2_output = wn.get_text()
if wn1_output == wn2_output:
    print 'Saving and loading successful.'
else:
    print 'ERROR: There were differences in the saved and loaded data'
    
print unicode(wn)