Skip to content

Instantly share code, notes, and snippets.

@SH2282000
SH2282000 / Main.java
Created October 16, 2020 18:37
this is my first try in Java
package com.ShannaX;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(String.valueOf(args))) {
@SH2282000
SH2282000 / dl_requests_tqdm.py
Created October 10, 2024 11:35 — forked from yanqd0/dl_requests_tqdm.py
Python requests download file with a tqdm progress bar
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,