473,386 Members | 2,078 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,386 software developers and data experts.

I like python.

I'm not a coder.. I'm just a person that trys to do things with
languages he likes. Sometimes I'm successful, mostly not. I do know
that before I bother a list with a silly question I should do my best
to research for an answer myself. ala RTFM. That said my searches
haven't found me what I am looking.. lack of a decent keyword
sequence.. anywho..

Could someone please tell me what I need to put into a python script
to not have a window come up however briefly? Like when I double click
on the script, it will do it's job but won't open a command window
then close it.. I hope that explains what I'm looking for. If I see
the line I can figure out by syntax where it should go. I'm really
good at learning the gist of languages by syntax. Thank you all for
your time
Peace
--
Fidel
Oct 20 '06 #1
8 1149
MC
Hi!

Sorry, I don't understand well english.
But, try to rename your script, from .py to .pyw (sample : titi.py ==>
titi.pyw).

--
@-salutations

Michel Claveau
Oct 20 '06 #2
Renaming the file doesn't work. I am on windows... There is a specific
line of code that tells python not to bother even opening a window. of
any sort for any amount of time. I just don't know what it is and
haven't been able to find any reference to it.... Thanks for the help
though.
>assuming Windows, and assuming that you have a standard Python install for
Windows: use "pyw" instead of "py" as the script's extension.

(Windows applications come in two flavours: console applications and window
applications. the default executable for "py" files is "python.exe",
which is a con-
>sole application. "pyw" uses "pythonw.exe" instead, which is exactly the same
program, but linked as a window application instead).

</F>


On 10/20/06, MC <XX*****@xx.xmclaveaux.comwrote:
Hi!

Sorry, I don't understand well english.
But, try to rename your script, from .py to .pyw (sample : titi.py ==>
titi.pyw).

--
@-salutations

Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list

--
Fidel
Oct 20 '06 #3
Fidel wrote:
Renaming the file doesn't work. I am on windows...
Are you sure? Double-clicking on a *.pyw script file really brings up
a window? Is it a GUI window or a console window? I ask because if
it's a console window and you're really clicking on a .pyw file then it
really should run without opening the console window. If not then
there might be some problem with your python installation. But it's
much more likely that you, say, copied the script and renamed the copy
but then accidentally clicked on the old script.
There is a specific
line of code that tells python not to bother even opening a window. of
How do you know this?
Peace,
~Simon

Oct 20 '06 #4
On Oct 20, 2:59 am, Fidel <fidel.andr...@gmail.comwrote:
Could someone please tell me what I need to put into a python script
to not have a window come up however briefly? Like when I double click
on the script, it will do it's job but won't open a command window
then close it.. I hope that explains what I'm looking for. If I see
the line I can figure out by syntax where it should go. I'm really
good at learning the gist of languages by syntax. Thank you all for
your time
Are you running any external commands by using os.system() or
os.exec()? If you are running a program that is a console program
(i.e. copy, move, del, etc...) then it will open up a command window to
run it. If that is the case, then you can try using the os.popen()
utility instead.

--
Jerry

Oct 20 '06 #5
Ant

Fidel wrote:
Renaming the file doesn't work. I am on windows... There is a specific
line of code that tells python not to bother even opening a window.
Seriously, renaming the script to .pyw should work from a standard
python install. If it doesn't then the file handler for that extension
must have got messed up somewhere along the way. You can fix this by
right-clicking the renamed (*.pyw) file and selecting "open with..." ->
"Choose Program" and finding the pythonw.exe.

Oct 20 '06 #6
Although I just noticed that if the extension is .py then it will
still open a command window. It does indeed need to have a .pyw
extension for this to work. So all of you were correct. it needs to
use popen and have .pyw as the extension in order for python not to
open a command window. Thank you all for you help and support.

On 20 Oct 2006 14:28:23 -0700, Ant <an****@gmail.comwrote:
>
Fidel wrote:
Renaming the file doesn't work. I am on windows... There is a specific
line of code that tells python not to bother even opening a window.

Seriously, renaming the script to .pyw should work from a standard
python install. If it doesn't then the file handler for that extension
must have got messed up somewhere along the way. You can fix this by
right-clicking the renamed (*.pyw) file and selecting "open with..." ->
"Choose Program" and finding the pythonw.exe.

--
http://mail.python.org/mailman/listinfo/python-list

--
Fidel
Oct 20 '06 #7
Thank you Jerry. That was exactly what I was looking for. The script
in fact does call an external program and give it a command from a
randomized list. Specifically it is a random wallpaper setter using
the windows version of bsetroot. script scans a directory, creates a
list of viable walls and tells bsetroot to set the wallpaper. Using
popen instead of system did the trick handily. I thank you verily.

On 20 Oct 2006 14:21:59 -0700, Jerry <jw****@gmail.comwrote:
On Oct 20, 2:59 am, Fidel <fidel.andr...@gmail.comwrote:
Could someone please tell me what I need to put into a python script
to not have a window come up however briefly? Like when I double click
on the script, it will do it's job but won't open a command window
then close it.. I hope that explains what I'm looking for. If I see
the line I can figure out by syntax where it should go. I'm really
good at learning the gist of languages by syntax. Thank you all for
your time

Are you running any external commands by using os.system() or
os.exec()? If you are running a program that is a console program
(i.e. copy, move, del, etc...) then it will open up a command window to
run it. If that is the case, then you can try using the os.popen()
utility instead.

--
Jerry

--
http://mail.python.org/mailman/listinfo/python-list

--
Fidel
Oct 21 '06 #8
Glad I could help.

--
Jerry

Oct 25 '06 #9

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

Similar topics

0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.