473,396 Members | 1,799 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,396 software developers and data experts.

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 2225
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.GetWindowText(hwnd)
if x.find('PuTTY') >= 0:
left,top,right,bottom = win32gui.GetWindowRect(hwnd)
if top < 30:
width = right - left
height = bottom - top
win32gui.MoveWindow(hwnd,left,top+30,width,height, 1)

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

os.system(command % (p1,))
time.sleep(1.0)
win32gui.EnumWindows(moveWindow, 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
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...
9
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...
4
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...
30
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...
8
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...
16
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...
4
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: ---------------------------------------------------------- ...
6
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...
15
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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.