electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Run PDRACULA program in TCL/TK


Post new topic  Reply to topic    EDAboard.com Forum Index -> Analog IC Design & Layout -> Run PDRACULA program in TCL/TK
Author Message
shrbht



Joined: 15 Mar 2005
Posts: 111
Helped: 2


Post19 Jan 2008 11:37   

pdracula


puts stdout [cd pathname] ;it can work
puts stdout [PDRACULA] ; it can not work
exec PDRACULA ; it can work. but I can't see the information of run
How can I do ? can I see the infomation of run? thanks.
I am a beginner for TCL/TK.
Back to top
Google
AdSense
Google Adsense




Post19 Jan 2008 11:37   

Ads




Back to top
rimser9



Joined: 22 Jun 2007
Posts: 49
Helped: 1


Post21 Jan 2008 12:39   

Run PDRACULA program in TCL/TK


yes man u can see the o/p. If u have the tcl/tk pdf. or the book in it u will find code of execlog which shows the o/p of the run. If u cant find it try fileevent command. I will try to post the code later.
Back to top
rimser9



Joined: 22 Jun 2007
Posts: 49
Helped: 1


Post22 Jan 2008 5:39   

Run PDRACULA program in TCL/TK


#!/usr/local/bin/wish -f
# execlog - run a UNIX program and log the output
# Set window title
wm title . ExecLog
# Create a frame for buttons and entry.
frame .top -borderwidth 10
pack .top -side top -fill x
# Create the command buttons.
button .top.quit -text Quit -command exit
set but [button .top.run -text "Run it" -command Run]
pack .top.quit .top.run -side right
# Create a labeled entry for the command
label .top.l -text Command: -padx 0
entry .top.cmd -width 20 -relief sunken \
-textvariable command
pack .top.l -side left
pack .top.cmd -side left -fill x -expand true
# Set up key binding equivalents to the buttons
bind .top.cmd <Return> Run
bind .top.cmd <Control-c> Stop
focus .top.cmd
# Create a text widget to log the output
frame .t
set log [text .t.log -width 80 -height 10 \
-borderwidth 2 -relief raised -setgrid true \
-yscrollcommand {.t.scroll set}]
scrollbar .t.scroll -command {.t.log yview}
pack .t.scroll -side right -fill y
pack .t.log -side left -fill both -expand true
pack .t -side top -fill both -expand true
# Run the program and arrange to read its input
proc Run {} {
global command input log but
if [catch {open "|$command"} input] {
$log insert end $input\n
} else {
fileevent $input readable Log
$log insert end $command\n
$but config -text Stop -command Stop
}
}
# Read and log output from the program
proc Log {} {
global input log
if [eof $input] {
Stop
} else {
gets $input line
$log insert end $line\n
$log see end
}
}


# Stop the program and fix up the button
proc Stop {} {
global input but
catch {close $input}
$but config -text "Run it" -command Run
}

Added after 24 seconds:

u may need to modify the code if necessary.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Analog IC Design & Layout -> Run PDRACULA program in TCL/TK
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
which program to download and install to run tcl/tk code (6)
run tcl code (2)
How to run tcl in ActiveTcl Windows? (3)
how to run a Tcl script with argument in windows Modelsim? (2)
A TCL script run in PrimeTime that help you trace your desig (3)
run c program (1)
How to run an application in my program? (4)
how to run c program in AVR STUDIO 4 (2)
How to run an old DOS program in win XP? (12)
How can I run a program (e.g. a PDF) in Delphi (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS