Skip to content

Instantly share code, notes, and snippets.

@borrougagnou
borrougagnou / writeline_in_file.py
Last active May 22, 2018 21:06
Write - change 1 line anywhere in python file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# HOW TO WORK:
# >> writeline_in_file("./folder/myfile.txt", 12, "I write this line in line 12")
# if you want another carriage return read "open() > newline" python manual
def writeline_in_file(path, numline, str, cr=None):
try:
<html class="has-notifications fixedsticky-withoutfixedfixed skrollr skrollr-desktop" lang="fr"><!--<![endif]--><head><link href="blob:http://www.wakanim.tv/28da2c47-e3b9-924c-8755-7b41c8c09a18" type="text/css" crossorigin="anonymous" rel="stylesheet"><link href="http://cdn.theoplayer.com/theoplayer.1.5.4.min.css" type="text/css" crossorigin="anonymous" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="<p style=&quot;margin: 0px; padding: 0px; border: 0px; font-family: arial; vertical-align: baseline; line Episode 1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<title>Episode 1 - Gate sur Wakanim.TV !</title>
<link rel="apple-touch-icon" href="//cdncontent.wakanim.tv/images/apple-touch-icon.png"><style type="text/css">#detector { display: none !important; }</style><style type="text/css">#nopub { display: block !important; }</style>