Show More
@@ -46,9 +46,9 All the following constructs are valid IPython syntax: | |||||
46 | .. code-block:: ipython |
|
46 | .. code-block:: ipython | |
47 |
|
47 | |||
48 | In [1]: my_files = !ls ~/ |
|
48 | In [1]: my_files = !ls ~/ | |
49 | In [1]: for i,file in enumerate(my_file): |
|
49 | In [1]: for i, file in enumerate(my_files): | |
50 | ...: raw = !echo $file |
|
50 | ...: raw = !echo $file | |
51 |
...: !echo {file |
|
51 | ...: !echo {file[0].upper()} $raw | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | .. code-block:: ipython |
|
54 | .. code-block:: ipython | |
@@ -193,10 +193,9 You can combine the different possibilities in for loops, conditions, functions. | |||||
193 | .. code-block:: ipython |
|
193 | .. code-block:: ipython | |
194 |
|
194 | |||
195 | my_files = !ls ~/ |
|
195 | my_files = !ls ~/ | |
196 | b = "backup file" |
|
196 | for i, file in enumerate(my_files): | |
197 | for i,file in enumerate(my_file): |
|
|||
198 | raw = !echo $backup $file |
|
197 | raw = !echo $backup $file | |
199 | !cp $file {file.split('.')[0]+'.bak'} |
|
198 | !cp $file {file.split('.')[0] + '.bak'} | |
200 |
|
199 | |||
201 |
|
200 | |||
202 | Magics |
|
201 | Magics |
General Comments 0
You need to be logged in to leave comments.
Login now