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
# war 1 | |
import socket | |
def scan_port(ip,port): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.settimeout(0.5) | |
try: | |
connect = sock.connect((ip,port)) | |
print('Port :',port,' its open.') | |
sock.close() |
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 requests | |
url_change = 'https://openexchangerates.org/api/latest.json?app_id=565db73ce703480cb8d8849e32f32035' | |
r = requests.get(url_change) | |
r = r.json() | |
print(r["rates"]["CNY"]) |
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
from gtts import gTTS | |
import os | |
import subprocess | |
from subprocess import check_output | |
text = "Global warming is the long-term rise in the average temperature of the Earth’s climate system" | |
language = "en" | |
speech = gTTS(text=text, lang=language, slow=False) | |
speech.save("text.mp3") | |
os.system('nircmd mediaplay 10000 text.mp3') |
NewerOlder