datacamp / pythonwhat

Verify Python code submissions and auto-generate meaningful feedback messages.
http://pythonwhat.readthedocs.io/
GNU Affero General Public License v3.0
69 stars 31 forks source link

IPython magic shell commands #6

Closed hugobowne closed 8 years ago

hugobowne commented 8 years ago

With IPython, you call execute Shell commands by prefacing them with !, e.g. ! ls for directory contents.

I use this in my course and Hamel will use it in his Cleaning Data in Python course.

We will need some test functions for this.

vvnkr commented 8 years ago

Is this only ! ls? You can use test_student_typed() for this.

hugobowne commented 8 years ago

there'll be more cases. Hamel will use commands from csvkit and csvfix for his course:

http://csvkit.readthedocs.io/en/0.9.1/tutorial.html

http://neilb.bitbucket.org/csvfix/

the 1st has a python package but it may have less functionality than the shell toolkit. i'll know more when he gets back from vacation

vvnkr commented 8 years ago

I'll look in to it. Also if you want to use another "magic" command than ! for system operations, be sure to first check with product on the pythonbackend GitHub. Some of these might not be supported.

filipsch commented 8 years ago

@vincentvankrunkelsven @hugobowne this can become challenging as ast, the syntax parser that we use to parse a submission, does not recognize IPython commands (give a syntax error in this case). So we need to make sure to work around them.

hugobowne commented 8 years ago

ahhhh wait I just raised this in a new issue: https://github.com/datacamp/pythonwhat/issues/31

because the error message is now thrown. feel free to merge issues

vvnkr commented 8 years ago

Moved to #33