Re: [SLUG] Perl Thing

From: Paul M Foster (paulf@quillandmouse.com)
Date: Sun Mar 03 2002 - 21:46:21 EST


On Sat, Mar 02, 2002 at 09:52:31PM -0500, Bob Stia wrote:

> On Thursday 28 February 2002 05:48 pm, you wrote:
> > On Wed, 27 Feb 2002, Bob Stia wrote:
> > > More guidance ?? Please ??? I really hate being ignorant.
> >
> > Don't worry about it...what's frustrating is that I couldn't figure
> > out why you were having such problems.
> >..............<snip>.......................
> > Whew! It's been a long, strange journey, but I think we're near
> > the end.
>
> Welllll......Paul, evidently my long strange journey is not yet over.
> Tried those things you suggested ...one after the other......
> Here is copy of my terminal replies.
>
> bob@linux:~ > sh /usr/local/pysol-4.60/pysol
> RuntimeError: Bad magic number in .pyc file
>
> bob@linux:~ > ls -l /usr/local/pysol-4.60/pysol
> -rwxr-xr-x 1 1000 users 1900 May 25 2000
> /usr/local/pysol-4.60/pysol
>
> bob@linux:~ > /usr/local/pysol-4.60/pysol
> RuntimeError: Bad magic number in .pyc file
>

Python compiles its source files into bytecode (sort of a python machine
language). The original file will be <something>.py and the bytecode
version will be <something>.pyc. Python will run the bytecode version
automatically, if it's available. OTOH, if you delete the
bytecode/compiled version, it will run the source version. Normally a
"magic number" is something in a file that allows Linux to determine
what type of file it is. Most types of file have some sort of indicator
in them that marks them as distinct from other types of files.

In any case, you should be able to delete the .pyc file and run the
source file as you did above. Hopefully, it should work. Of course, at
this point, who knows? ;-}

Paul (the other one)



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:38:26 EDT