Show More
@@ -435,7 +435,7 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):' | |||||
435 | """ Attempts to execute file with 'path'. If 'hidden', no output is |
|
435 | """ Attempts to execute file with 'path'. If 'hidden', no output is | |
436 | shown. |
|
436 | shown. | |
437 | """ |
|
437 | """ | |
438 |
self.execute('execfile( |
|
438 | self.execute('execfile(%r)' % path, hidden=hidden) | |
439 |
|
439 | |||
440 | def interrupt_kernel(self): |
|
440 | def interrupt_kernel(self): | |
441 | """ Attempts to interrupt the running kernel. |
|
441 | """ Attempts to interrupt the running kernel. |
@@ -8,8 +8,10 b'' | |||||
8 |
|
8 | |||
9 | # Standard library imports |
|
9 | # Standard library imports | |
10 | from collections import namedtuple |
|
10 | from collections import namedtuple | |
|
11 | import os.path | |||
11 | import re |
|
12 | import re | |
12 | from subprocess import Popen |
|
13 | from subprocess import Popen | |
|
14 | import sys | |||
13 | from textwrap import dedent |
|
15 | from textwrap import dedent | |
14 |
|
16 | |||
15 | # System library imports |
|
17 | # System library imports | |
@@ -233,6 +235,10 b' class IPythonWidget(FrontendWidget):' | |||||
233 | def execute_file(self, path, hidden=False): |
|
235 | def execute_file(self, path, hidden=False): | |
234 | """ Reimplemented to use the 'run' magic. |
|
236 | """ Reimplemented to use the 'run' magic. | |
235 | """ |
|
237 | """ | |
|
238 | # Use forward slashes on Windows to avoid escaping each separator. | |||
|
239 | if sys.platform == 'win32': | |||
|
240 | path = os.path.normpath(path).replace('\\', '/') | |||
|
241 | ||||
236 | self.execute('%%run %s' % path, hidden=hidden) |
|
242 | self.execute('%%run %s' % path, hidden=hidden) | |
237 |
|
243 | |||
238 | #--------------------------------------------------------------------------- |
|
244 | #--------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now