User Profile

Collapse

Profile Sidebar

Collapse
DanTheL
DanTheL
Last Activity: Nov 18 '14, 11:51 AM
Joined: Nov 9 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • DanTheL
    replied to invalid syntax printing string from file
    bcdet,
    tried both still kicks out same error:

    File "./Documents/Python/Samples/foo.py", line 3
    print ?foo?
    ^
    SyntaxError: invalid syntax


    not recognizing the "

    thanks
    See more | Go to post

    Leave a comment:


  • DanTheL
    replied to invalid syntax printing string from file
    used both single quote and double quote (not both at same time) both result in same error:

    case 1:
    #! /usr/bin/env python
    #encoding:latin-1
    print ‘foo’

    dans-air:~ dan$ python ./Documents/Python/Samples/foo.py
    File "./Documents/Python/Samples/foo.py", line 3
    print ?foo?
    ^
    SyntaxError: invalid syntax


    case 2:
    #! /usr/bin/env...
    See more | Go to post

    Leave a comment:


  • DanTheL
    started a topic invalid syntax printing string from file

    invalid syntax printing string from file

    running 2.7.5
    on Mac
    from the command prompt --
    >>> Print "foo"
    foo

    works fine.

    from script file
    --
    #! /usr/bin/env python
    #encoding:latin-1
    print “foo”
    --

    get following error:
    dans-air:~ dan$ python ./Documents/Python/Samples/foo.py
    File "./Documents/Python/Samples/foo.py", line 3
    ...
    See more | Go to post
No activity results to display
Show More
Working...