I’m using the datetime module in python3.7. When I run it from terminal it throws an error: Answer As you named your file datetime.py it may lead to confusion when calling it from outside. you should rename it to something else like my_datetime.py you also need to import datetime before using it
Tag: linux
Print value of by loop in the end of line in bash
My file which run loop… My program file My result is My should I do so result come like I will be very glad if someone can help me out, Answer A possible solution would be to replace the line: echo $country >> /wdc-cron/count-$yesterday.txt with: printf “$country, ” >> /wdc-cron/…
Recursively change file name in folder and subfolders without changing file path
I have files in a format like 639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The files reside in a folder and sub-folder format that resembles a date. ./2019/05/31/639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The goal is to remove everything before and including the _. Which im able to do with ren…
similarity between the two files using grep, why this work: grep -i “-ffile1” file2
I have two files, file1 and file2, and want to find the similarity between the two files using grep. why -f should flow by the file name without spaces when I surround the -f file1 with quotes? this will work but this will not work but if I remove the quotes these two cases will work Answer By convention, one…
Start docker containers on linux system startup from user directory
I’ve downloaded two docker containers and already configure them. So, now all I want is to start them on system startup. They are in a path like /home/user/docker-mailserver /home/user/docker-webserver Hosted on a Ubuntu 18.04.01 (x64) On boot those docker containers are not running. On login, those doc…
How to get absolute value after subtracting the following value by the previous value in a file with multiple colomns?
I have a file contains numbers. 1 34 44 44 46 5 35 40 40 45 6 36 28 30 40 My goal is for each column to have the absolute value after subtracting the following value by the previous one as the below: 1 34 44 44 46 4 1 4 4 1 1 1 12 10 5 I
Can’t install latest angular cli on ubuntu
I’m trying to install angular via ubuntu. When I type the version commande node -v I get v12.14.1 Then I try to install npm package sudo npm install -g @angular/cli I get a warning npm WARN npm npm does not support Node.js v10.15.2 ng version I get angular-cli: 1.0.0-beta.28.3 The npm version is 6.13.4 …
Use awk command to get information below a pattern
I have a file with a wide range of information and I want to extract some data from here. I only will post here the interesting part. I want to extract IQ and JQ values as well as the J_ij[meV] value which is two lines above. I read this question How to print 5 consecutive lines after a pattern in
What is a drop-in file? What is a drop-in directory? How to edit systemd service [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. The community reviewed whether to reopen this question last month and left it closed: Original close reason(s) wer…
linux kernel panic unable to handle kernel NULL pointer dereference at
I’m facing issues with some kernel panic but I don’t have any idea how to find which soft is exacly causing this issue. I’m trying to compile some soft on remote host using distcc software but my machines which are compiling are going down because of this issue. Could you point me where shou…