A következő címkéjű bejegyzések mutatása: net. Összes bejegyzés megjelenítése
A következő címkéjű bejegyzések mutatása: net. Összes bejegyzés megjelenítése

2020. november 8., vasárnap

COVID statisztika letöltése és táblázatba exportálás Python szkript - covid2xls.py

Előkövetelmények:
  • Python 3
  • Két python könyvtár telepítése
    • pip3 install pandas 
    • pip3 install xlwt
 
Futtatás: python3 covid2xls.py

Kód:
 
import requests
import bs4
from bs4 import BeautifulSoup
import pandas as pd

#######################xlwt###########################

import xlwt
from xlwt import Workbook

wb = Workbook()

sheet1 = wb.add_sheet('Sheet 1')
sheet1.write(0, 0, 'Sorszám ')
sheet1.write(0, 1 ,'Nem')
sheet1.write(0, 2 ,'Kor')
sheet1.write(0, 3 ,'Alapbetegségek')

count=0

#######################xlwt###########################

for i in range(0,40):
    

    user_agent = 'Chrome/80.0.3987.132 Mozilla/5.0'
    response = requests.get(f"https://koronavirus.gov.hu/elhunytak?page={i}", stream=True,headers={'User-Agent': user_agent})

    soup = BeautifulSoup(response.text, 'html.parser')

    tables = soup.find_all('table')

    df = pd.read_html(str(tables))[0]

    print(df)

    for i in range(0,len(df["Sorszám"])):
        count=count+1
        sheet1.write(count, 0, str(df["Sorszám"][i]))
        sheet1.write(count, 1 ,str(df["Nem"][i]))
        sheet1.write(count, 2 ,int( df["Kor"][i]))
        sheet1.write(count, 3 ,str(df["Alapbetegségek"][i]))
        wb.save("out.xls")

2015. február 19., csütörtök

Repeater beállítása

Cél: jelenlegi vezeték nélküli hálózat hatósugarának kiterjesztése egy REPEATER eszközzel.
Példa a felépítésre:

ÚTVÁLASZTÓ (ROUTER) - Internetre kapcsolódó eszköz
STATIKUS CÍM
IP cím pl.: 192.168.1.100
DHCP BE
|
| WLAN ---)))
|
WiFi elosztó - REPEATER
STATIKUS CÍM - DHCP és tűzfal KIKAPCSOLVA
IP cím pl.: 192.168.1.101
GW+DNS is ROUTER IP (192.168.1.100)
|
| WLAN ---)))
|
PC/egyéb kliens
STATIKUS CÍM
IP cím pl.: 192.168.1.1
GW+DNS is ROUTER IP (192.168.1.100)
stb.

FONTOS!
Ugyanazon az alhálózaton kell lenni az eszközöknek, hogy kommunikálni tudjanak!
http://en.wikipedia.org/wiki/Subnetwork

"As it looks Johnny your two devices are on different Subnets, thats why they can't communicate!
You will need to change the IP of the Linksys to 192.168.0.2 for them to be able to communicate. You will also need to disable the DHCP (if it is turned on) on the Linksys.
You can find both of these settings on the Linksys configuration under LAN Settings.
Also if there is a firewall running on the Linksys turning it off will make things easier for you. The D-Link will handle the firewalling for your network!
Turn off the D-Link and set up the Linksys as I described above. When finished the setup save you settings and turn the D-Link back on and you should be fine!
Cheers!"
http://www.tomshardware.co.uk/forum/40841-43-wireless-repeater-headache

2013. június 29., szombat

Felesleges DokuWiki nyelvi fájlok törlése (bash/shell script):

EN: Remove unwanted language files from DokuWiki folders (bash/shell script)

Célszerű meghagyni az angol fájlokat, mert egyes szövegek lehet, hogy nincsenek lefordítva: -not -path "*en"

cd dokuwiki-YOUR_VERSION/lib

$ find . -type d -path "*lang/?*" -not -path "*hu" -not -path "*en" -exec rm -r "$1" '{}' \;