123456789101112131415161718192021222324 |
- import asyncio
- async def system(command: str):
- proc = await asyncio.create_subprocess_shell(command)
- await proc.communicate()
- def to_hhmmss(secs: int):
- hours = secs // 3600
- minutes = (secs - (hours * 3600)) // 60
- seconds = secs - (hours * 3600) - (minutes * 60)
- if minutes < 10:
- minutes = f"0{minutes}"
- if seconds < 10:
- seconds = f"0{seconds}"
- if hours < 10:
- hours = f"0{hours}"
- if hours == 0:
- return f"{minutes}:{seconds}"
- return f"{hours}:{minutes}:{seconds}"
|