Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #59666 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-11-17 09:47 +1100 |
| Last post | 2013-11-17 09:47 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Beginner python 3 unicode question Chris Angelico <rosuav@gmail.com> - 2013-11-17 09:47 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-11-17 09:47 +1100 |
| Subject | Re: Beginner python 3 unicode question |
| Message-ID | <mailman.2744.1384642034.18130.python-list@python.org> |
On Sun, Nov 17, 2013 at 8:19 AM, Laszlo Nagy <gandalf@shopzeus.com> wrote:
> print("digest",digest,type(digest))
>
> This function was called inside a script, and gave me this:
>
> ('digest', '\xa0\x98\x8b\xff\x04\xf9V;\xbd\x1eIHzh\x10-\xc5!\x14\x1b', <type
> 'str'>)
>
This looks very much like you're running under Python 2. Take care of
which interpreter you're running; that might be because of your
shebang (as Luuk mentioned), or because of what you're typing to
invoke the script; either way, it makes a huge difference. The easiest
solution is probably to invoke the interpreter explicitly:
Interactive mode:
$ python3
Script mode:
$ python3 scriptname.py
But you seem to have something WAY more complex than a single script.
What's the setup? How is Python getting invoked? If your code is
getting imported by something else, no shebang will help you - you
need the other code to be being executed by the other interpreter.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web