Skip to main content

Posts

Print file content in Python IDLE

During Python 3 learning in IDLE, I can't find a command/module to show a file content. It's boring to switch between IDLE and terminal, so I write this script to avoid boring open/read. For short type, I use pt as shortname of print. Usage: Import pt pt.pt(file_name) Eg: >>> for pyfile in os.listdir(): pt.pt(pyfile) Source code refer GitHub: https://github.com/catinsunshine/ShowFileInPythonIDLE def pt ( filename ): with open (filename) as f: fc = f.read() print (fc)

Install Teamviewer 12 on Debian 8

OS: Debian 8 testing When I tried to install teamviewer, I failed for amd64.deb version installation. Against help page note, I switched to the i386.deb version: Notes on Multiarch: On newer 64-bit DEB-systems with Multiarch-support (Debian 7)  teamviewer_linux_x64.deb  cannot be installed because the package ia32-libs is not available anymore on these systems. In this case you can use  teamviewer_11.0.xxxxx_i386.deb  instead. In case you get the error “wrong architecture i386” you have to execute the following command lines as an administrator: dpkg --add-architecture i386 apt-get update First try 'apt install' command, but get dependencies problems: peter@PDebian:~/Downloads$ sudo apt-get install ./teamviewer_12.0.71510_i386.deb Reading package lists... Done The following packages have unmet dependencies:  teamviewer:i386 : Depends: libc6:i386 (>= 2.11) but it is not installable                 ...

offline install software on Debian (network-manager)

OS: Debian 8.6->testing As I can't custom the WIFI DNS on Debian, I thought there are something wrong for network-manager & its settings. So, I uninstalled it with sudo apt remove network-manager sudo apt autoremove It's really stupid to do it from current viewpoint as you are offline after then. You can't reinstall them from repository. 😣 Even I plugged the wired, no way. After google, I used the 'dpkg' command to recover the network-manager from Debian archives as following: sudo dpkg -i /var/cache/apt/archives/network-manager*.deb After that, Debian prompts lack of dependency about libndp0 & libteamdct10. So, install them first with dpkg command: sudo dpkg -i /var/cache/apt/archives/libndp*.deb sudo dpkg -i /var/cache/apt/archives/libteamdct*.deb Finally, repeat dpkg for network-manager*.deb, the problem solved. No need to reinstall.😂