This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've been wondering how to make a pop-up/prompt window in notepad ++, on the Python Script Plugin. I figured it out, so I'm writing here maybe someone needs it. | |
Basicaly, this is the prompt line: | |
`result = notepad.prompt('Number of modified files: ', '', number_files)` | |
The code below will make multiple search and replace on notepad++. | |
Two Pop-Up/Prompt windows will apear: first, when put the file path for replacing the files from a particular folder. And second pop-up/prompt window will be displayed after the replacement was made, with a message: "Number of modified files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to make a batch processor with multiple search and replace on notepad++. | |
This code works with Python Script Plugon on notepad++. Save this code as .py, and copy it in c:\Program Files\Notepad++\plugins\PythonScript\scripts\ | |
Use Menu -> Plugins -> Python Script -> Scripts -> THIS-SCRIPT.py | |
Remember to change the path on the script, the location of folder where you want to change all files: Path="C:\\python-test" | |
------------------------------------------------------------------------------------------------------------------------------------- | |
# -*- coding: utf-8 -*- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import os | |
import glob | |
filenames = glob.glob('*.txt') | |
with open('output_file.txt','wb') as wfd: | |
for f in filenames: | |
with open(f,'rb') as fd: | |
shutil.copyfileobj(fd, wfd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!------------READ MORE START--------> | |
<script type="text/javascript" > | |
function addLink() { | |
//Get the selected text and append the extra info | |
var selection = window.getSelection(), | |
pagelink = '<br /><br /> Read more at: ' + document.location.href, | |
copytext = selection + pagelink, | |
newdiv = document.createElement('div'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, I have this text that I must translated with library googletrans: | |
<!-- ARTICOL START --> | |
<p class="mb-40px">La muerte de Lorenzo el Magnífico puso fin al periodo.</p> | |
<p class="mb-40px">My name is print</p> | |
<p class="mb-40px">I must go home | |
<p class="mb-40px">I love my laptop when is clean</p> | |
<!-- ARTICOL FINAL --> | |
**The part of the python code with the problem is this:** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- $item_id = 406; // Replace that with your rating id --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Meta Tags --> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"html_file": "https://neculaifantanaru.com/lideri-si-atitudine.html", | |
"line_count": 32 | |
}, | |
{ | |
"html_file": "https://neculaifantanaru.com/leadership-magic.html", | |
"line_count": 33 | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- $item_id = 5576; // Replace that with your rating id --> | |
<!DOCTYPE html> | |
<!--<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head>--> | |
<html lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/"> | |
<head> | |
<title>You Are Me And I Am You (I) | Neculai Fantanaru (en)</title> | |
<link rel="icon" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" sizes="192x192" /> | |
<link rel="apple-touch-icon-precomposed" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" /> | |
<meta name="msapplication-TileImage" content="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- $item_id = 5576; // Replace that with your rating id --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Meta Tags --> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> | |
<title>You Are Me And I Am You (I) | Neculai Fantanaru (en)</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**# Sending email with Cpanel by SMTP** | |
import sys | |
import smtplib | |
from_addr = 'YOUR EMAIL ADRESS' | |
to_addrs = ['YOUR EMAIL ADRESS'] | |
msg = """From: Sender | |
To: Recipient | |
Subject: Okazii |
OlderNewer