Interesting Python system utilities that you created?

I slowly but surely teach Python itself. I study best. I am looking for some neat system performance procedures that I could try to make what you find useful to yourself. Some of the modules that I have successfully done and use are similar to the following:

  • Lock folder
  • Mount the entire set of folders in the archive as an automatic backup
  • Launching an application that opens my most frequently used programs on startup

But I'm stuck right now. What else could I do?

+3
source share
19 answers

script, Bluetooth . (Windows) , Bluetooth, , .

, , .

"""
Intended to run on Windows resume. Scans for bluetooth devices and if a 
particular device is not present, locks the computer.
"""
import bluetooth
import ctypes
import sys

# Bluetooth UID of "token" device
wanted = "XX:XX:XX:XX:XX:XX"

print "performing inquiry..."

# Hack.... if 0 devices are present, pybluez throws an exception
passed = False
try:
    discovered = bluetooth.discover_devices()
    if wanted in discovered:
        print "Found phone"
        passed = True
    else:
        passed = False
except:
    passed = False

if not passed:
    print "Locking"
    ctypes.windll.user32.LockWorkStation()

:

+6

: , Unicode ( !) "Joel On Software", HTML , . , , , , .

+3

Python 2.5, script, Subversion, . . . , , Python .

script rsync -.

, Python.

+3

, , "" "checkUTF8". - , ( ) , :

$ grep '[0-9.]' somefile | sum
567567
$ wc -l * | sum
45647

... , .

, UTF8, , , , , . hex-, . , iso8859-1 utf8, .

"sum" , .

+2

PyZip . , - :

pyzip store\ProjectFiles-[date] *.py *.txt

"store" ,

".zip",

[] , 20090624

[], 155859

[#], , ,

, PKZip PyUnzip


ActiveState Python Windows, win32, ActiveDirectory, Word Excel COM, SQLite , VBScript, , ( ) VBScript.

+2

script, rsync , , (sorta like time machine mac). , .

script bash, - , , "" " python, .

repo .

+2

script, jar java classpath, , . script .

, script.

script, / Java/etc .

, , , script, . , .

, , , , .

+2

, , . .

, . , ( , ).

+1

, . , .wav "MThd", , , Midi, - .

+1

Python script (, , , ), dwm.

, backend Openbox pipe.

+1

, , .. , Cacti MRTG.

mamy, Python, Python Recipes

+1

, , , "myfolder", , , ​​..

script, , .

SO question script:)

+1

- Python, "cleanup" WinCVS. , Microsoft Visual Studio , , - .

+1

, , , , , , , ..

+1

Windows win32file.FindFilesW() API ( python Windows), , . API FindFilesW() Win32 API. , , , . , , , , , ; , ( , , - , 1 , 15 , 1 ..); . , VBScript ( ) , . Windows, , , , - , , .

+1

rsync, user/group . , bash, bash.

javascript , post commit mercurial, , minify/compress, YUItest , , , , . .

script, jwc png graphviz, . , - , , CI .

, , 3 10 . t-sql , py-tk .

.

.

+1
0

script, 71 , - pywapi cron .: -)

0

Source: https://habr.com/ru/post/1711153/