tcl

Linux Expect/TCL Comm Port Comunication Cisco Switch

天涯浪子 提交于 2019-12-25 03:26:46
问题 I have done much reading on TCL/Expect and wrote the following script to connect to the comm port on my RPi-Kali-Linux box. #!/usr/bin/expect -f set timeout -1 ;#set the portID and open it for reading and writing set portID [open /dev/ttyUSB0 r+] set baud 9600 ;#Configure the port with the baud rate ;#and dont block on read, dont buffer output fconfigure $portID -mode "9600,n,8,1" fconfigure $portID -blocking 0 -buffering none ;#Write to the comm port by sending a carrage return spawn -open

RInside with Qt, GTK+ or Tcl [closed]

主宰稳场 提交于 2019-12-25 03:26:28
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . My question is: Do you know what toolkit between Qt, Gtk+ or Tcl/tk is better to develop an app with RInside? I think I can do it with any of them, but I just find examples of RInside using Qt. Can I use, for example, Gtk or Tcl/tk also?, and... What do you think is the best

Using the TCL interpreter repeatedly inside a C program

对着背影说爱祢 提交于 2019-12-25 03:02:05
问题 I wish to use a c program repeatedly run the TCL interpreter many times. For reasons that are complicated, I need this to be a pure C program and not something that is embedded as a shared object. As an example, I wish to run this simple tcl program, tryMe.tcl, twice: prtstr "Test from tryMe.tcl" The prtstr is a TCL function that I have written that for right now just writes to stdout. Below is the c code that is attempting to interpret the tryMe.tcl program twice. I compile the program below

Creating tabs in CSV using TCOM

不问归期 提交于 2019-12-25 02:59:30
问题 I want to add tabs to the .csv file I'm creating using the TCOM package in TCL. The following is the code I used to create a second tab. But I don't see a second Tab. I just see the first tab created. set application [::tcom::ref createobject "Excel.Application"] set XlFileFormat(xlCSV) [expr 6] set workbooks [$application Workbooks] set workbook [$workbooks Add] $application DisplayAlerts False set worksheets [$workbook Worksheets] set worksheet1 [$worksheets Item [expr 1]] set cells

How to draw x axis in a canvas using Tcl/Tk

不打扰是莪最后的温柔 提交于 2019-12-25 02:44:16
问题 I wanted to plot an x-axis with respect to time ,for which i have a list which contains time values. Is it possible to display it in a tk canvas?? 回答1: You can easily plot a graph in a Tk canvas. You've just got to work out what points you really want to plot (i.e., assemble both the X and Y values). Adapted from the code on that page: set width 100 set height 100 pack [canvas .c -width $width -height $height] # Assuming you've got a list of points in $data set count 0 foreach yValue $data {

Configuring values of combobox in a tablelist using tablelist wrapper in python

喜夏-厌秋 提交于 2019-12-25 02:35:00
问题 Basically my problem is in configuring a combobox in a tablelist written in python (not tcl directly). I have prepared an example that could demonstrate the problem, but before that lets see the required steps to run it: Copy the tablelist wrapper from here and save it as 'tablelist.py', then put it at the example code directory. Download "tklib-0.5" from here and copy "tablelist" directory from "modules" directory to the directory of example code. Here it is the code: from tkinter import *

Using a Variable in a sed command called in Tcl Script

不打扰是莪最后的温柔 提交于 2019-12-25 01:43:20
问题 I want to use the following command in a tcl script : sed -n '452,$ { /wire/ {p;q} }' /tmp/foo For that I have changed this command as follow : set MIDLINE2 [ exec sed -n {1134,$ {/wire/{=;q}}} foo.txt ] It gives me correct answer but in place 1134 I want to use variable $MIDLINE that has value 1134. How can I do that ? Please suggest some way. 回答1: This is a simple problem of quoting. You're using curly braces which inhibits variable substitution. Since you want variable substitution you

read the latest line of a serial port

大憨熊 提交于 2019-12-25 00:51:14
问题 I haven't ever written any code in tcl and pretty novice on serial communication, so sorry in advance if my question doesn't make sense. I'm trying to solve this problem where I want to listen to a serial port and print the updates line by line in SciLab like a normal serial terminal (e.g. Arduino's serial monitor). The Serial Communication Toolbox for Scilab has a readserial macro (source on GitHub): function buf=readserial(h,n) if ~exists("n","local") then N=serialstatus(h); n=N(1) end TCL

process multiple lines text file to print in single line

你。 提交于 2019-12-24 14:02:06
问题 I am newbie in TCL scripting. Just wish to get some advice from experts here. I wish to process the report with format as below. I am thinking to print the report without the header and with just single line like - Connections for net 'pmg_ccu_ot2_tam_50mhz_sel_xainfwh' :: Driver a_par/pmg_ccu_ot2_tam_50mhz_sel_xainfwh Output Pin (a_par) :: Load b_par/pmg_ccu_ot2_tam_50mhz_sel_xainfwh Input Pin (b_par) Connections for net 'pmg_ccu_ot2_tam_50mhz_sel_xainfwh_2' :: Driver d_par/pmg_ccu_ot2_tam

Tcl can't read variable: no such variable

戏子无情 提交于 2019-12-24 13:48:07
问题 The following piece of code produces the error: can't read "n": no such variable while executing "$ns duplex-link $n$i $n([expr ($i+1)%120]) 1Mb 10ms DropTail" ("for" body line 2) invoked from within "for {set i 7} {$i < 120} {incr i} { $ns duplex-link $n$i $n([expr ($i+1)%120]) 1Mb 10ms DropTail }" (file "multicast.tcl" line 44) it seems $n$i is not evaluated to the required format of $n7 etc. Any help in the solution is much appreciated. for {set i 0} {$i < 120} {incr i} { set n$i "[$ns