f



RE: couldn't connect to display ":0"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C44CD4.90830B30
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think that is not a problem with your script, but with the environment =
variable DISPLAY that may be set incorrectly.
Or if you are running that script from a session window that doesn't let =
graphics (spawning windows) though, that is another possibility.
=20
Are you running your script from your local host or telnet'ed / rsh'ed ?
=20
Iggs

-----Original Message-----
From: John Larson [mailto:jwlarson3rd@yahoo.com]
Sent: Monday, June 07, 2004 4:15 PM
To: tk list
Cc: Nick Ing-Simmons
Subject: couldn't connect to display ":0"


help
when I run this program:
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib  =
'/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux';
use Tk;
my $main =3D new MainWindow; ###barfs here###
$main->Label(-text =3D> 'Hello, world!')->pack;
$main->Button(-text =3D> 'Quit', -command =3D> sub{exit} )->pack;
MainLoop;

I recieve the following error
Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at =
/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWi=
ndow.pm line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow->new() =
at /home/bthcraft/cgi-bin/test.cgi line 6=20



  _____ =20

Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo!  <http://messenger.yahoo.com/> =
Messenger


------_=_NextPart_001_01C44CD4.90830B30
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D593470121-07062004>I=20
think that is not a problem with your script, but with the environment =
variable=20
DISPLAY that may be set incorrectly.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D593470121-07062004>Or=20
if&nbsp;you are running that script from a session window that doesn't =
let=20
graphics (spawning windows) though, that is another=20
possibility.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D593470121-07062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D593470121-07062004>Are=20
you running your script from your local host or telnet'ed / rsh'ed=20
?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D593470121-07062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D593470121-07062004>Iggs</SPAN></FONT></DIV>
<BLOCKQUOTE>
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> John Larson=20
  [mailto:jwlarson3rd@yahoo.com]<BR><B>Sent:</B> Monday, June 07, 2004 =
4:15=20
  PM<BR><B>To:</B> tk list<BR><B>Cc:</B> Nick =
Ing-Simmons<BR><B>Subject:</B>=20
  couldn't connect to display ":0"<BR><BR></FONT></DIV>
  <DIV>help</DIV>
  <DIV>when I run this program:</DIV>
  <DIV>#!/usr/bin/perl -w<BR>use strict;<BR>use CGI::Carp=20
  qw(fatalsToBrowser);<BR>use lib&nbsp;=20
  =
'/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux';<BR>use=
=20
  Tk;<BR>my $main =3D new MainWindow; ###barfs =
here###<BR>$main-&gt;Label(-text=20
  =3D&gt; 'Hello, world!')-&gt;pack;<BR>$main-&gt;Button(-text =3D&gt; =
'Quit',=20
  -command =3D&gt; sub{exit} )-&gt;pack;<BR>MainLoop;<BR></DIV>
  <DIV>I recieve the following error</DIV>
  <DIV>Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display =
":0" at=20
  =
/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWi=
ndow.pm=20
  line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow-&gt;new() at=20
  /home/bthcraft/cgi-bin/test.cgi line 6 </DIV>
  <P>
  <HR SIZE=3D1>
  <FONT face=3Darial size=3D-1>Do you Yahoo!?<BR>Friends. Fun. <A=20
  href=3D"http://messenger.yahoo.com/">Try the all-new Yahoo!=20
Messenger</A></FONT></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C44CD4.90830B30--
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
EXT
6/7/2004 9:15:31 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
1296 Views

Similar Articles

[PageSpeed] 27

Reply:

Similar Artilces:

RE: couldn't connect to display ":0" #2
I think the problem is that John is confusing two technologies. Tk is used to interact with a GUI locally (yes, it can display remotely using X-windows if the DISPLAY variable is set to another machine). Contrast this to CGI which is used in a web server environment where there is no display; rather the output is sent back to the requester's browser. So unless you are testing pure locally (i.e. not running under the web server but rather from a command line), this *should* fail. That is why I would say that mixing Tk and CGI is likely a conceptual error on John's part. ...

ptkdb running from Apache couldn't connect to display "localhost:0.0"
I am having a problem running ptkdb when invoked by a local httpd server. The script below works ok and will fire up ptkdb ok from a bash shell: #!/usr/bin/perl -w -d:ptkdb #!/usr/bin/perl -wT $|++; # for debugger when httpd invokes CGI #sub BEGIN {$ENV{DISPLAY} = "localhost:0.0"; }; use strict; print "Content-type: text/html\n\n"; use CGI; use FindBin; my $scriptdir = "$FindBin::Bin"; my $tmpldir = "$scriptdir/../templates/"; use lib "/home/owain/www/v2/perl-lib"; my $q = new CGI; my $t = new_template("hell...

couldn't connect to display ":0"
--0-2076467981-1086639284=:72215 Content-Type: text/plain; charset=us-ascii help when I run this program: #!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use lib '/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux'; use Tk; my $main = new MainWindow; ###barfs here### $main->Label(-text => 'Hello, world!')->pack; $main->Button(-text => 'Quit', -command => sub{exit} )->pack; MainLoop; I recieve the following error Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at /hom...

error: "couldn't execute "date": no such file or directory" in Tk
hi, i am using the following code in a tcl script with the TK framework, and i get the above error on executing the file main file.. main file --------------- #!c:/tcl/bin/tclsh label .l -text "click to execute" button .b -text "Execute" -command "exec_script" proc exec_script {} { set inp 1 source sss.tcl puts $inp } pack .l .b sss.tcl ----------------------------- #!c:/tcl/bin/tclsh set inp 0 puts $inp set d [exec date] The error i get is "couldn't execute "date": no such file or directory" I am using Tk with Tcl and ...

lynx 'browser' can't do "<?xml version="1.0" encoding="utf-8"?>"
lynx is lighteningly fast to fetch a set of pages [via a script] via dump > fileID. But [my current version] doesn't render the 'style' of: "<?xml version="1.0" encoding="utf-8"?>" What is this new "xml" crap ? Will it likely take over the older *.html ? Thanks for any info, == Chris Glur. news@absamail.co.za wrote in news:1172596265.663611@vasbyt.isdsl.net: > lynx is lighteningly fast to fetch a set of pages [via a script] via > dump > fileID. > > But [my current version] doesn't ...

Re: Can't locate object method "OPEN" via package "Tk::Event::IO"
I answered my own question. I needed to undefine the callback near the close of the filehandle. eg close $fh; $mw->fileevent( $fh, 'readable', '' ); ----- Original Message ----- From: "Tim Harsch" <harsch1@llnl.gov> To: "PTK" <ptk@lists.stanford.edu> Sent: Thursday, August 21, 2003 5:48 PM Subject: Can't locate object method "OPEN" via package "Tk::Event::IO" > I'm trying to set up a basic queue of processes to run. Here is an example > where I create 4 sleep jobs, submit NUM_PROCS...

Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
John W Kennedy wrote: > Martijn Lievaart wrote: > > Are you really that thick, or are you pretending to be? > > > > YOU are quoting Larry out of context. When someone gives that > > context, > > you completely ignore it. I didn't ignore it. What you and others have completely ignored is this: Why do many people write "TIMTOWTDI", instead of "There is more than one way to do it"? Maybe it's because it's just more convenient to write it that way. Maybe it's a personal preference to write it that way. It saves time when t...

Tkinter problem: TclError> couldn't connect to display ":0
Hi, I use live Debian on VM and trying to compile this code. import Tkinter root = Tkinter.Tk() root.title("Fenster 1") root.geometry("100x100") root.mainloop() The shell gives out that kind of message: File "test.py", line 5, in <module> root = Tkinter.Tk() File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0" thanks for helping o...

Terminal wedged: "Can't open display: :0.0"
My X11 just crashed unexpectedly (a very rare occurrence, until recently), and after restarting it, I'm no longer able to start X11 programs from Terminal. I killed and re-started both Terminal and X11, for good measure, but still I get the same error in Terminal; e.g.: % echo $DISPLAY :0.0 % xlogo Error: Can't open display: :0.0 Strangely, if I start xlogo directly from X11's Applications->xlogo menu, the xlogo window pops up fine. So clearly the problem is not with X11; it's running fine. I figure that the DISPLAY variable in my Terminal shell is se...

Can't "mk CONF=9pcdisk" --> gives error "rc: #d/0: token '=': syntax error"
I'm in /sys/src/9/pc and I type `mk CONF=9pcdisk` and rc gives me the error "rc: #d/0: token '=': syntax error". Why is this? Just doing mk works fine (I think). Thanks! Plan9 looks very cool... just finished reading through intro (all of it). you're using backquotes, why? that would be `{mk CONF=3D9pcdisk} in rc's syntax. now to compile that kernel the syntax is: % mk 'CONF=3Dpcdisk' now are you sure you want a pcdisk?=20 On Jul 19, 2012, at 6:07 AM, kalaracey@gmail.com wrote: > I'm in /sys/src/9/pc and I type >=20 ...

Re: Mandis Quotes (aka retiring """ and ''')
Russell Nelson wrote: > If you need to put a single quote in, then you put > an arbitrary string in-between the single quotes which does NOT > appear in the string. For example, "Bill's house" becomes > 'x'Bill's house'x'. So possible examples might be: 'xx'somebody's mother'xx' 'xy'somebody's father'xy' 'wink'somebody's uncle'wink' 'quote'somebody's body'quote' not terrible easy on the eyes, and why use the single quote at all? Why no= t use a similar pattern li...

Python version of perl's "if (-T ..)" and "if (-B ...)"?
Perl has the following constructs to check whether a file is considered to contain "text" or "binary" data: if (-T $filename) { print "file contains 'text' characters\n"; } if (-B $filename) { print "file contains 'binary' characters\n"; } Is there already a Python analog to these? I'm happy to write them on my own if no such constructs currently exist, but before I start, I'd like to make sure that I'm not "re-inventing the wheel". By the way, here's what the perl docs say about these constructs. I'm look...

Re: Mandis Quotes (aka retiring """ and ''') #2
Russell Nelson notes: > = > Choose poor examples, and then criticize them as poor choices? > = true enough, but the suggested scheme introduces another variable into the = language syntax; I might always make good choices <wink> on what delimiter = I choose, but I might also end up working on code written by someone else w= ho makes less good choices. Or vice versa. = > Exactly. It really would be better to have one(1) string literal > which can quote anything without reverting to backslashing. Why one? > Simpler parsing, simpler learning of the language, fewe...

Fedora 2 "couldn't add command channel 127.0.0.1#953: not found" [solution]
On a laptop, not connected to any network, nor to Internet. Installed Fedora Core 2 from CD's with book "Red Hat Fedora Linux 2 Bible". Selected various web services and Gnome stuff. Booted. As root, started service "named". Result was a "chrooted" ("jailed") service, in "/var/named/chroot". - - - - - What works: 1. Created a file "/var/www/html/index.html", asked browser to show "http://localhost": that page displays. What doesn't work: 1. "host localhost" - times out, can't find a...

Web resources about - RE: couldn't connect to display ":0" - comp.lang.perl.tk

Resources last updated: 2/7/2016 3:28:14 AM