Tuesday, November 14, 2017

When terminal is not starting in Ubuntu

Untitled Document.md

When terminal in Ubuntu is not starting

gnome-termial crashes with python 3.6 update.

  • Go to /usr/bin/gnome-terminal
  • Go to the first line and change python3 to python.
  • Install or reinstall the followings

$sudo apt-get install --reinstall python
$sudo apt-get install python3-pyside

Sunday, November 12, 2017

Friday, November 10, 2017

Worth noting fact :

$ sudo apt-get install python3-tk

and

$ sudo apt-get install python3.6-tk

are different. 

If the python system shows "no module named XXX"

you'd better check if it is correctly installed by type in

$ pip3 freeze | grep tkinter

Python: Text file read and write

These are python codes for reading and writing text files:


read and store the lines into list:

def read_and_store(list_path):
with open(list_path) as f:
content = []
for line in f:
line = line.strip().split(' ')
content.append(line)
return content


write the list into a file:

def read_and_write(w_path, list_to_wr):
with open(w_path, "w") as output:
for k, val in enumerate(list_to_wr):
output.write(' '.join(val))
return None

When terminal is not starting in Ubuntu

Untitled Document.md When terminal in Ubuntu is not starting gnome-termial crashes with python 3.6 update. Go to /usr/bin/gnome-termi...