title: Repeated errors while working with Portable Python
body: <p>Note:  This was not answered by the question that was marked as the original.  This is more than just a Python v2 vs v3 problem, which I explain in the comments below.  </p>
  
  <p>Original post: 
  I am trying to learn Python at work, so I am currently using Portable Python 3.2.1.1 (which will henceforth be referred to as PP).  (I mention this because this problem doesn't happen at home when I use my Mac and regular Python.)  </p>
  
  <p>I am working through exercise 16 of Learning Python the Hard Way (<a href="http://learnpythonthehardway.org/book/ex16.html" rel="nofollow">http://learnpythonthehardway.org/book/ex16.html</a>).  I've heard this isn't the best learning tool, but I am a complete programming n00b and I'm a hands-on learner.  If you have any better suggestions, I'm open!  </p>
  
  <p>The first few lines of the exercise read:</p>
  
  <pre><code>    from sys import argv
      script, filename = argv
      print "We're going to erase %r." % filename
      print "If you don't want that, hit CTRL-C (^C)."
  </code></pre>
  
  <p>My script is titled Ex16.py and the file I am using is Python.txt, and both of these are in the same folder as the PP .exes.  I don't think that's necessary, but hoped maybe it would fix the problem... negative.  When I press "Run" in PP, it doesn't work because argv requires you provide an argument when you start the script: python Ex16.py Python.txt</p>
  
  <p>When I launch Python.exe (which, in PP is Portable-Python.exe), I get the standard Python prompt, >>>, but whatever I enter I get the same error message:</p>
  
  <pre><code>    File "&lt;stdin&gt;", line 1
      with whatever I've just tried repeated back to me with the marker to 
      indicate where the problem is. (has not been helpful so far)
  
      SyntaxError: invalid syntax
  </code></pre>
  
  <p>I have tried typing the following at the >>> prompt: 
  <code>python Ex16.py Python.txt</code>,, 
  <code>Ex16.py Python.txt</code>,, 
  <code>"%PATH&amp;\Ex16.py" "%PATH%\Python.txt" (with the actual filepaths)</code>,, 
  <code>print 'hello world'</code></p>
  
  <p>I just keep getting the same invalid syntax error over and over.  Even a basic print command returned an invalid syntax error.  The only one that triggered a different error was the one where I tried whole filepaths.  That one returned:</p>
  
  <pre><code>    File "&lt;stdin&gt;", line 1
      SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
      position 2-3: truncated \UXXXXXXXX escape
  </code></pre>
  
  <p>Yes, I have Googled the crap outta both errors.  I read that sometimes the problem is not doubling the backspaces, so I tried that, too, putting two \ where just one had been before in both filepaths.  I even tried putting <code>— # -*- coding: utf-8 -*-</code> at the beginning of the script thinking maybe there was some unicode error.  That, with the full filepaths, resulted in the same unicode error mentioned earlier.</p>
  
  <p>Yes, I have checked that my code is matching that in the exercise.<br>
  Yes, this works at home on non-PP.  </p>
  
  <p>All this leads me to believe that the problem is probably in the way I'm trying to run the scripts in PP (but why won't <code>print</code> work?), but I haven't a clue what I'm doing wrong.  </p>
  
  <p>Thanks!</p>