#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Exclamation Syntax Error -- tried multiple things


    The error message I'm receiving whenever I run my program:

    vlan13-dhcp-21-62:~ Myname$ python (file path)/dvdrip rename
    File "(filepath)/dvdrip", line 1
    SyntaxError: Non-ASCII character '\x81' in file /(filepath) dvdrip on line 2, but no encoding declared; see Python page for details

    This is the top of my Python:

    #!/usr/bin/python
    #coding: utf-8


    I've tried multiple things for line two and nothing works!

    Any ideas?
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    616
    Rep Power
    65
    Generally it's
    # -*- coding: <utf-8> -*-

    Make sure your editor is set too.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by Dietrich
    Generally it's
    # -*- coding: <utf-8> -*-

    Make sure your editor is set too.
    Thanks for the quick reply. Still nothing! Hmmm...

IMN logo majestic logo threadwatch logo seochat tools logo