473,666 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Shell window

Jay
Is their any way of setting wear the Python Shell window appears on the
screen when I run my program?

I am testing a full screen program with no Window Frame on a comp with
2 monitors and I have to keep pressing the <Window> Key to bring the
Shell to the front and then moving it manually to the other screen
every time I restart the program.

I would like it to just appear on the other screen from the start.

Any ideas

Apr 10 '06 #1
2 2245
Jay wrote:
Is their any way of setting wear the Python Shell window appears on the
screen when I run my program?

I am testing a full screen program with no Window Frame on a comp with
2 monitors and I have to keep pressing the <Window> Key to bring the
Shell to the front and then moving it manually to the other screen
every time I restart the program.

I would like it to just appear on the other screen from the start.

Any ideas


1. Do you really want the CMD prompt to show up? If not, rename your
file from .py to .pyw and it will be hidden. You'll miss all of the
STD* streams though.

2. Find the window and move it to the right place. Here is a script I
use to launch PuTTY (which has the unfortunate problem of 'hiding' its
title bar below my 'Start' bar which I keep at the top of my screen).
It's convient for me to launch PuTTY from this script but I don't see
any reason why you couldn't add this code to your main function and
find the errand CMD prompt and move it.

(For this you need the win32 extension installed)
------------------------------------------------
import win32gui,os,sys ,time

command = r"start putty -load %s"

def moveWindow(hwnd , ignored):
x = win32gui.GetWin dowText(hwnd)
if x.find('PuTTY') >= 0:
left,top,right, bottom = win32gui.GetWin dowRect(hwnd)
if top < 30:
width = right - left
height = bottom - top
win32gui.MoveWi ndow(hwnd,left, top+30,width,he ight,1)

try:
p1 = sys.argv[1]
except IndexError:
#print "you must provide a valid machine name"
p1 = "opus"

os.system(comma nd % (p1,))
time.sleep(1.0)
win32gui.EnumWi ndows(moveWindo w, None)
------------------------------------------------
HTH..

Jay

Apr 10 '06 #2
> find the errand CMD prompt and move it.

errand -> errant

Apr 10 '06 #3

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

Similar topics

4
3838
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or less - during my own installation of Python 2.3 on Fedora Core 1 Linux for a friend of mine). Anyway, HTH, L.
9
3389
by: Peter Wu | last post by:
I'm giving vim a try to program Python. The following are the steps I follow to code/test a python program. vi test.py :wq :!python test.py Is there any other way? I don't want to type 'python test.py' every time
4
9417
by: Chang LI | last post by:
I tried to launch "python.exe test.py" in another program. After the launch the console was showed and exited on Windows. I want the console stay there. Is there a Python statement to wait an event loop like Tcl's "after forever"?
30
2893
by: bblais | last post by:
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for some help to find out how the same thing is done in Python. I am not sure what the standard is. In C++, I open up an editor in one window, a Unix shell in another. I write the code in the editor, then switch to the shell window for compile...
8
4215
by: Dave Potts | last post by:
Hi, I'm just starting a development project in Python having spent time in the Java world. I was wondering what tool advice you could give me about setting up a continuous integration environment for the python code: get the latest source, run all the tests, package up, produce the docs, tag the code repository. I'm used to things like Maven and CruiseControl in the Java world. Cheers,
16
3931
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of the normal bash commands (e.g. print instead of echo). My main reason for asking is that I like using Python for everything, and if I don't need to learn the bash 'language', then I won't just yet. Thanks.
4
3180
by: emin.shopper | last post by:
Emacs seems to freeze when doing certain shell commands on Microsoft Windows. The following is a simple example with Xemacs: ---------------------------------------------------------- Microsoft Windows XP (C) Copyright 1985-2001 Microsoft Corp.
6
5243
by: John (Z R) L | last post by:
Hi all, I am very new to programming, and I chose to study the Python language before C++. I am currently using the Wikibooks "Non-Programmer's Tutorial for Python", and am up to the section "Who goes there"? http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python/Who_Goes_There%3F But after clicking "run module" for " a = 1
15
2163
by: lixinyi.23 | last post by:
Hi! I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You double click the icon of the item, and you see its value. You can
8
5579
by: james.kirin39 | last post by:
Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an interactive Python shell on Windows that supports: - easy copy-pasting to/from an editor? (as opposed to the cumbersome "mark", "copy" and then "paste" sequence that any terminal on Windows
0
8445
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.