What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-20 01:41:04
how to delete a specific line in a file
searched = "snow" # every line containing the variable "searched" will be deleted with open("file.txt","r+") as f: # open your file new_f = f.readlines() f.seek(0) for line in new_f: if searched... Add solution -
Javascript 2021-09-18 05:40:02
readline sync javascript
var readlineSync = require('readline-sync'); // Wait for user's response. var userName = readlineSync.question('May I have your name? '); console.log('Hi ' + us... Add solution -
Python 2021-09-17 21:09:02
editing specific line in text file in python
# with is like your try .. finally block in this case with open('stats.txt', 'r') as file: # read a list of lines into data data = file.readlines() print data print "Your name: " + data[0] # now change the 2nd line, note that you have ... Add solution -
Shell/Bash 2021-09-17 15:21:02
le wagon setup
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev sudo apt clean git clone https://github.com/rbenv/rbenv.git ~/.rbenv git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plu... Add solution
Best helpers
Ranking is empty