Show More
@@ -21,7 +21,7 b' class Macro(IPyAutocall):' | |||
|
21 | 21 | |
|
22 | 22 | def __init__(self,data): |
|
23 | 23 | """store the macro value, as a single string which can be executed""" |
|
24 | self.value = ''.join(data).rstrip()+'\n' | |
|
24 | self.value = '\n'.join(data).rstrip()+'\n' | |
|
25 | 25 | |
|
26 | 26 | def __str__(self): |
|
27 | 27 | return self.value |
@@ -200,7 +200,7 b' python-profiler package from non-free.""")' | |||
|
200 | 200 | else: |
|
201 | 201 | ini = int(chunk) |
|
202 | 202 | fin = ini+1 |
|
203 | cmds.append(''.join(hist[ini:fin])) | |
|
203 | cmds.append('\n'.join(hist[ini:fin])) | |
|
204 | 204 | return cmds |
|
205 | 205 | |
|
206 | 206 | def arg_err(self,func): |
@@ -2079,10 +2079,9 b' Currently the magic system has the following functions:\\n"""' | |||
|
2079 | 2079 | if ans.lower() not in ['y','yes']: |
|
2080 | 2080 | print 'Operation cancelled.' |
|
2081 | 2081 | return |
|
2082 | cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r'))) | |
|
2083 |
|
|
|
2084 | f.write(cmds) | |
|
2085 | f.close() | |
|
2082 | cmds = '\n'.join(self.extract_input_slices(ranges,opts.has_key('r'))) | |
|
2083 | with open(fname,'w') as f: | |
|
2084 | f.write(cmds) | |
|
2086 | 2085 | print 'The following commands were written to file `%s`:' % fname |
|
2087 | 2086 | print cmds |
|
2088 | 2087 |
General Comments 0
You need to be logged in to leave comments.
Login now