5 Python Use Cases That Only a Few Programmers Know

 



Python for Creating Mobile Apps

Running Python on Browser

console.log(pyodide.runPython(`
import os
os.makedirs('dir/test')
print(os.listdir('dir'))
`));
['test']
import js
js.alert('Hello JavaScript!') # js module refers to window :)

Python for Writing Shell Scripts

#!/usr/bin/env shellpyprint('Hello ShellPy')
`
echo "Hello" > test.txt
cat test.txt
`

Build Pythonic Hybrid Desktop Apps

Create CLI Programs in Record Time

import firedef add(a, b):
return a + b
def sub(a, b):
return a - b
if __name__ == '__main__':
fire.Fire()
./cli.py add 10 5
./cli.py sub 5 2

Conclusion

Δημοσίευση σχολίου

0 Σχόλια