Skip to content

Instantly share code, notes, and snippets.

View AlgorithmAlchemy's full-sized avatar
💭
Open to job opportunities

AlgorithmAlchemy AlgorithmAlchemy

💭
Open to job opportunities
View GitHub Profile
@AlgorithmAlchemy
AlgorithmAlchemy / port_scanner.py
Last active June 29, 2023 10:53
Port Scanner python
# 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()
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"])
@AlgorithmAlchemy
AlgorithmAlchemy / audio_play.py
Last active June 29, 2023 10:55
audio play python
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')