小编Ram*_*kar的帖子

错误“无法打开Jupyter Notebook:端口8888已在使用中”

运行Jupyter Notebook时出现以下错误:

(base) C:\Users\ramne>jupyter notebook
[I 01:19:00.648 NotebookApp] The port 8888 is already in use, trying another port.
Run Code Online (Sandbox Code Playgroud)

而当我做netstat -ano | 找到Str“ 8888”,得到以下信息:

C:\Users\ramne>netstat -ano | findStr "8888"
TCP    127.0.0.1:8888         0.0.0.0:0              LISTENING       16024
TCP    [::1]:8888             [::]:0                 LISTENING       16024
Run Code Online (Sandbox Code Playgroud)

我不知道端口8888的默认连接是什么或其行为应该是什么样的。如何解决此错误,以便可以打开Jupyter Notebook?

python port jupyter-notebook

2
推荐指数
1
解决办法
7651
查看次数

search and replace multiple "foo" and "bar" in a file using Perl? SED is too slow

I have a really huge text file (more than 4GB). And I have multiple entries to be searched and replaced in this huge file (pattern.txt).

So, I made up a file called leo.sed and used sed -f command.

leo.sed: This file contains around 500 entries. Example:

s/"PET10"/"PETfdfd0"/g
s/"PET11"/"PET123wef"/g
s/"PET12"/"TETPrandom"/g


Run Code Online (Sandbox Code Playgroud)

I am using following sed command but it is extremely slow.

sed -f leo.sed pattern.text | sed -f leo1.sed > pattern_after_leo_leo1_sed.txt
Run Code Online (Sandbox Code Playgroud)

Any faster way to do with perl one-liner?

perl sed

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

使用变量名来命名动态创建的数组(或标量)

我想在@array_mem_depth_$i 中使用 $i 值,以便我动态创建的数组看起来像@array_mem_depth_1024,@array_mem_depth_512。

如何实现这一目标?

while(<FH>) {
$line = $_;
chomp($line);
foreach my $i (@depth_uarr) { if ( $line =~ /$i/) {push (@array_mem_depth_${i}, $line);} }
}
Run Code Online (Sandbox Code Playgroud)

谢谢

arrays variables perl

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

标签 统计

perl ×2

arrays ×1

jupyter-notebook ×1

port ×1

python ×1

sed ×1

variables ×1