I had a bit of trouble trying to implement this solution.
This is what I did:
- Download pyc from here.
This took me more searching than it should have because it seems that pyc is hard to find (and I think, a little out of date)
- I extracted the pyc folder from the zip file and added it to my IronPython folder in
C:\Program Files
- Now I tried running this command on the windows console, as instructed by the readme in the pyc download:
ipy.exe pyc.py other_hw.py /main:console_hw.py
It gave me this error:
Traceback (most recent call last):
File "pyc\pyc.py", line 35, in pyc\pyc.py
AttributeError: attribute 'CompilerSink' of 'namespace#' object is read-only
I made the following change to line 35:
Before: class PycSink(Hosting.CompilerSink):
After: class PycSink():
Saving the file proved to be a problem due to permissions, so I copied the contents of pyc.py into a new IDLE window (to create a copy), deleted the existing copy of pyc.py
and saved the copy as pyc.py
in the same location. This takes care of permissions issues and allows changes.
After making this change, I tried running the this command again:
ipy.exe pyc.py other_hw.py /main:console_hw.py
However, this time, I got the following error:
Traceback (most recent call last):
File "pyc\pyc.py", line 170, in pyc\pyc.py
File "pyc\pyc.py", line 56, in Main
AttributeError: attribute 'ResourceFile' of 'namespace#' object is read-only
At this point, I took stock of the fact that it is now 1 AM and I have a midterm tomorrow, so I undid the changes and shut it down.
Please let me know if you have a solution, or any advancements on mine.