I am running ubuntu 15.10 and I have python 3 installed. But I don't have pip3 installed
我尝试使用以下方法安装 pip3:
sudo apt-get install python3-pip
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
toshiba@toshiba-Satellite-Z930:~/Desktop/Telethon-master$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp javascript-common libc-ares-dev libc-ares2 libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore libssl-dev
libssl-doc libv8-3.14-dev libv8-3.14.5 node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream
node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream
node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-gyp …Run Code Online (Sandbox Code Playgroud) for {set count 0} {$count<$num_of_UEs} { incr count } {
puts $count
set tcp$count [new Agent/TCP]
#$tcp$count set fid_ $count
#$tcp$count set prio_ 2
}
Run Code Online (Sandbox Code Playgroud)
我的问题在于线路#$tcp$count set fid_ $count
当我尝试执行它时它说
can't read "tcp": no such variable
while executing
"$tcp$count set fid_ $count"
("for" body line 4)
invoked from within
"for {set count 0} {$count<$num_of_UEs} { incr count } {
puts $count
set tcp$count [new Agent/TCP]
$tcp$count set fid_ $count
$tcp$coun..."
Run Code Online (Sandbox Code Playgroud)
它说无法读取tcp,它不应该读取tcp它应该在第一次迭代中读取为tcp0而在第二次迭代中读取tcp1,依此类推.我究竟做错了什么?
谢谢
编辑:
我尝试使用数组,感谢TIP.它适用于大多数部分,但在我执行此操作时的一个特定情况:
for {set count 0} {$count<$num_of_UEs} …Run Code Online (Sandbox Code Playgroud) 我想实现以下内容:
for (( i=1; i<=sim_users; i++))
do
value[$i] = $RANDOM
done
Run Code Online (Sandbox Code Playgroud)
为什么不这样做?