如何跳过注释行的行号显示?在编写python代码时,我想跳过以#开头的每一行的行号
我的意思是:
1 print "hello"
# skiping line number for commented line
2 print "line number for next line"
3 print "now the next line number"
# again skipping another line that's commented with hash symbol
4 print "I hope yo
cat 没有 -n
user@linux:~$ cat /etc/sysctl.conf | head -4
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
user@linux:~$
在-n命令中有cat选项来显示文件的行号。
user@linux:~$ cat -n /etc/sysctl.conf | head
为什么apt要尝试从archive.ubuntu.com下载档案?
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps teas