473,408 Members | 1,788 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

very odd, random window dumps


This is weird...

Running small Python scripts, now and again a window dump is
created, and saved as the module name without the extension.
This happens on Linux. The dumped file is a PostScript file with
the image of one Window that was active at the moment
(completely unrelated to the Python application), and has a
header comment that says it was created by ImageMagick. Magic,
indeed. The file has the somewhat unusual access bits
-rwxr--r--, but normal user and group.
--
Peter Kleiweg L:NL,af,da,de,en,ia,nds,no,sv,(fr,it) S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html

Jul 18 '05 #1
2 1596
Peter Kleiweg schreef:

This is weird...

Running small Python scripts, now and again a window dump is
created, and saved as the module name without the extension.
This happens on Linux. The dumped file is a PostScript file with
the image of one Window that was active at the moment
(completely unrelated to the Python application), and has a
header comment that says it was created by ImageMagick. Magic,
indeed. The file has the somewhat unusual access bits
-rwxr--r--, but normal user and group.


I think I solved it. A script that starts with this:

import somemodule

Call it with sh instead of python, and the shell calls the
program 'import', which happens to be an existing program, part
of ImageMagick, and that program writes a screen dump to its
argument, in this case to file 'somemodule'.

My scripts start with this line:

#!/usr/bin/env python

So they should be run with python. However, I discovered that if
I make a small typo, and use this:

!/usr/bin/env python

Then the shell doesn't understand the first line, prints an error, and
continues processing the rest of the file as if it were a common shell
script.

That must be what happened.

--
Peter Kleiweg L:NL,af,da,de,en,ia,nds,no,sv,(fr,it) S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html

Jul 18 '05 #2
Peter Kleiweg wrote:
Running small Python scripts, now and again a window dump is
created, and saved as the module name without the extension.
This happens on Linux. The dumped file is a PostScript file with
the image of one Window that was active at the moment
(completely unrelated to the Python application), and has a
header comment that says it was created by ImageMagick. Magic,
indeed. The file has the somewhat unusual access bits
-rwxr--r--, but normal user and group.


This is probably the result of accidentally typing "import somemodule" on
the Linux command line before invoking the python interpreter. "import" is
an ImageMagick command that takes a window capture.

i.e.:

$ import myprog
<hangs>
<click the window>
$ python
import myprog

....

Jeffrey
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Heath | last post by:
Using MSIE 5+ Heath writes: My problem deals with working with window objects between pages as follows: My Introduction page contains a link to my Action page. The onClick of that link...
1
by: Terry Haufler | last post by:
I am trying to swap/rotate random flash banners using the following Javascript code. I have 3 flash headers/banners. I can get it to open a page with a random header using...
9
by: Vito DeCarlo | last post by:
I've been having this problem for a few weeks. PLEASE read this post before responding with some simple reason that has nothing to do with my problem. If you need more information, please request...
8
by: Lars-Erik Aabech | last post by:
Hi! We've got an ASP.NET application that runs swell on development PC's and one live production server. Another prod. server though crashes a couple of times a week. Either something that...
11
by: Amy | last post by:
Hello, I need to make this select an array item randomly instead of in order. Anyone know how? Thank you very much. Amy <BODY onload="changelink();"><a href="#" id="url"></a> var arr = ,, ,...
4
by: Christina | last post by:
A project I am working on requires 5 random popup windows that rotate. A cookie is set each time one of the popups occurs with a 5 day expire period. The visitor isn't supposed to see the same...
4
by: Ekix | last post by:
Hello guys, I'd like to know hoe to do a PopUnder window (to an URL) so, that it starts only randomly. for example every 20'th time someone loads the page. The frequency should be changeable, so...
8
by: Victor Kryukov | last post by:
Hello list, I've found the following strange behavior of cPickle. Do you think it's a bug, or is it by design? Best regards, Victor. from pickle import dumps from cPickle import dumps as...
1
by: bn4 | last post by:
I have been trying to modify a script that i had working in the past but have lost.. ORIGINAL URL: http://www.thescripts.com/forum/thread147097.html STEPS: I want it to do the following:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.