Re: Setting win32 console title from Python

2005-05-02 Thread Duncan Booth
runes wrote: Hi Duncan, sorry, I was unprecise. I'm thinking of a script, called t.py that can be used in the console like an ordinary command. Som if I change directory from S:\scripts to d:\projects and execute the script the title changes to projects etc. I have that functionality

Setting win32 console title from Python

2005-04-28 Thread runes
Hi, I'm trying to set the title of the console window (CMD.EXE) in Windows. I want it set to the basename of the current directory and it should stay after the script has finished. Now, the console title is easily set with the DOS-command 'title NewTitle'. But I'd like to do this from a Python

Re: Setting win32 console title from Python

2005-04-28 Thread Duncan Booth
runes wrote: I'm trying to set the title of the console window (CMD.EXE) in Windows. I want it set to the basename of the current directory and it should stay after the script has finished. Any ideas? I don't think you can do that. Whenever you start an application from the command prompt

Re: Setting win32 console title from Python

2005-04-28 Thread jay graves
Hmm. From an interactive interpreter this works for me. import os os.system('title Jay') but the title returns to its previous value when I Ctrl-Z out of the process. If I save this as a file and run it, it seems to work without spawning a new window but resets it the title after the program

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Whenever you start an application from the command prompt the title is modified by appending a dash and the name of the program you started. When the application terminates the title is reset (to remove the name of the running program). So any change to the title will only last until the next

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Hi Jay. It seems like my requirement is a light edition of your. I like having many console windows open, and to make it easier to switch between them, I like to name them. Todays solution is rather tedious - a batch file that calls a python script that isolates the directory name and stores it

Re: Setting win32 console title from Python

2005-04-28 Thread jay graves
Cool. Let me know if you want a copy of p.py (in all of it's hard-coded glory). I can easily put it under Public Domain and you can copy whatever you want out of it. ... jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting win32 console title from Python

2005-04-28 Thread Duncan Booth
runes wrote: Hi Jay. It seems like my requirement is a light edition of your. I like having many console windows open, and to make it easier to switch between them, I like to name them. Todays solution is rather tedious - a batch file that calls a python script that isolates the directory

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Hi Duncan, sorry, I was unprecise. I'm thinking of a script, called t.py that can be used in the console like an ordinary command. Som if I change directory from S:\scripts to d:\projects and execute the script the title changes to projects etc. I have that functionality today with a

Re: Setting win32 console title from Python

2005-04-28 Thread Bengt Richter
On 28 Apr 2005 12:42:34 -0700, runes [EMAIL PROTECTED] wrote: Hi Duncan, sorry, I was unprecise. I'm thinking of a script, called t.py that can be used in the console like an ordinary command. Som if I change directory from S:\scripts to d:\projects and execute the script the title changes to