I'm confused about this code! Why # cant't play a role that takes the length of a string?
string="abcd"
!echo ${#string}
In fact, the code behind # has become commented and cannot be executed!
Any advice?
I'm confused about this code! Why # cant't play a role that takes the length of a string?
string="abcd"
!echo ${#string}
In fact, the code behind # has become commented and cannot be executed!
Any advice?
Copyright © 2021 Jogjafile Inc.
This works correctly, but you cannot mix python and bash variables in this way. Try this instead:
The two statements have to be on the same line because in IPython, each
!statement opens a temporary subshell and variables are not persisted between shells. If you want to use multiline bash programs, you can use the%%bashcell magic instead: