Weird newbie question

Matty Sarro msarro at gmail.com
Thu Jan 26 20:51:43 EST 2012


The issue was a version mismatch. When installing python on windows,
it installs a shortcut so when you right click, you can edit things in
IDLE. I had installed python 3 after installing 2.7, so it apparently
changed the extension.

As for not showing tracebacks, I couldn't. When I ran the program from
the command line, it ran the version 2.7 python because that's the one
I have set in my $PATH. However when I was editing it in IDLE, it
would highlight the second set of quotation marks in the statement and
simply spit out an error saying "Invalid Syntax." There was no
traceback because IDLE wouldn't run the program in the interpreter
that opens along side the editor.

Re-opening the file in the 2.7 version of IDLE removed any issues.

Thanks for your help everyone.

On Thu, Jan 26, 2012 at 5:53 PM, Rick Johnson
<rantingrickjohnson at gmail.com> wrote:
> On Jan 26, 4:05 pm, Matty Sarro <msa... at gmail.com> wrote:
>
>> Here's my code:
>>
>> from sys import argv
>> script,filename=argv
>> txt=open(filename)
>> print "Here is your file %r:" % filename
>> print txt.read()
>> print "I'll also ask you to type it again:"
>> file_again=raw_input("> ")
>> txt_again=open(file_again)
>> print txt_again.read()
>>
>> IDLE is saying that my error is on line 4, at the second set of
>> quotation marks. [...]
>
> Forget about line 4 because line 2 is a problem waiting to happen
> (PEP8 formating added for clarity)
>
> Line2: script, filename = argv
>
> Is this a case of the blind leading the blind?
>
> --
> http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list