简体   繁体   中英

Google colab change variable name everywhere in code cell

When I highlight a variable within a cell in colab, all the instances of that variable shines up. Is it possible to change all these instances of the variables at the same time and if such, how? enter image description here

Google colab uses the same keys short-cuts of microsoft VS, just use Ctrl+D to add to the selection the next occurrence.

Use instead Ctrl+Alt+L to select all occurrence.

Once you selected the occurrences you can edit them by just typing the new name.

If you use short variable names ( as X ) this method will probably not work, as every word with an x in it will also change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM