Environments are MiKTeX 2.9, XeLaTeX, PythonTeX 0.11 beta, and Python 3.3. I am pretty new to LaTeX and Python/PythonTeX and am struggling with the following piece of code.
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8
\documentclass{article}
\usepackage{fontspec,xunicode,xltxtra}
\usepackage{fancyvrb}
\usepackage{etex}
\usepackage{etoolbox}
\usepackage{xstring}
\usepackage{pgfopts}
\usepackage{newfloat}
\usepackage{xcolor}
\usepackage{pythontex}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\newcommand{\pow}[2]{\py{#1**#2}}
\newcommand{\poww}[2]{\pyc{print(#1**#2)}}
\newcommand{\powww}[2]{\begin{pycode}print(#1**#2) \end{pycode}}
\begin{document}
\pow{2}{5} % success
\poww{2}{6} % success
\powww{2}{7} % fail
\end{document}
I get an error on \powww and can not understand why. Any help appreciated.
Extraneous input `print(2**7) \end {pycode}^^I% fail' between \begin{pycode}[
<key=value>] and line end
.
\FV@Error ...ncyVerb Error:^^J\space \space #1^^J}
l.28 \powww{2}{7}^^I% fail
The ultimate goal is to pass sets of 2 unicode strings as parameters from the XeLaTeX document via PythonTeX to Python, but I prefer to "start simple and then expand step by step".