小编mar*_*c_s的帖子

将所有行转换为列和列转换为数组中的行

我正在尝试创建这个程序(在python中),它将所有行转换为列,将列转换为行.

更具体地说,第一个输入是2个数字.NM.N- 总行数,M总列数.我用过b=map(int, raw_input().split()).然后基于b[0],每个下一N行将包含M空格分隔的整数.例如:

Input:

3 5
13 4 8 14 1
9 6 3 7 21
5 12 17 9 3  
Run Code Online (Sandbox Code Playgroud)

现在程序将它存储在2D数组中:

arr=[[13, 4, 8, 14, 1], [9, 6, 3, 7, 21], [5, 12, 17, 9, 3]]
Run Code Online (Sandbox Code Playgroud)

输出所需的是打印M行,每行包含N个空格分隔的整数.例如:

Output:

13 9 5
4 6 12
8 3 17
14 7 9
1 21 3
Run Code Online (Sandbox Code Playgroud)

这是我到目前为止所尝试的:

 #Getting N and M from input
 NM=map(int, raw_input().split()) …
Run Code Online (Sandbox Code Playgroud)

python arrays

0
推荐指数
1
解决办法
9143
查看次数

Metasploit更新:捆绑安装错误(nokogiri 1.6.8)

Metasploit工作正常,直到今天早上我更新它msfupdate,然后所有人都去了.

打字msfconsole现在给我这个错误:

Could not find nokogiri-1.6.8 in any of the sources
Run bundle install to install missing gems.
Run Code Online (Sandbox Code Playgroud)

我去打字了bundle install.直到发生这种情况一切顺利:

Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.2 -r ./siteconf20160831-24032-1wim46x.rb extconf.rb --use-system-libraries
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
checking for libxml-2.0... no
checking for libxslt... no
checking for libexslt... no
ERROR: cannot discover where libxml2 is …
Run Code Online (Sandbox Code Playgroud)

ruby linux bundle ruby-on-rails metasploit

-2
推荐指数
2
解决办法
3101
查看次数

标签 统计

arrays ×1

bundle ×1

linux ×1

metasploit ×1

python ×1

ruby ×1

ruby-on-rails ×1