2

I'd like to be able to include python code snippets in Excel (ideally, in a nice format -- all colors/formats should be kept the same).

What would be the best way to go about it?

EDIT: I just want to store python code in an Excel spreadsheet for an easy overview -- I am not going to run it -- just want it to be nicely visible/formatted as part of an Excel worksheet.

8
  • 1
    Do you want to store the python code in a worksheet? Commented Jun 2, 2011 at 15:09
  • I don't understand what you are trying to archive, do you want run the python in excel? Commented Jun 2, 2011 at 15:11
  • I just want to store the python code in a worksheet (say, in a textbox), for reference purposes and easy overview of the code. I want the code to be easy to view, with colors etc. Commented Jun 2, 2011 at 15:22
  • 3
    Why? Excel seems to be an incredibly poor tool for code review. Commented Jun 2, 2011 at 15:34
  • 1
    How about gist.github.com? It might be exactly what you are looking for (minus the excel.) Commented Jun 2, 2011 at 16:37

2 Answers 2

2

I think that gist (from github) is precisely what you are looking for. From the description:

Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.

Sign up to request clarification or add additional context in comments.

1 Comment

I really which things could be embedded into Excel, but if I can't find a solution, this is an alternative.
1

While Excel itself doesnot support other scripting Langauges than VBA, the open source OpenOffice and LibreOffice packages - which include a spreadsheet - can be scriptable with Python. Still, they won't allow Python code to be pasted on teh cells out of the box - but it is possible to write Python code which can act on the spredsheet contents (and do all the other things Python can do).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.