Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window command window
#7
(Aug-04-2021, 02:56 PM)RobertAlvarez424 Wrote: Question , are there two type of exe's for python. One that would run in the dos type environment and one that would run in windows 10 desktop using an icon. May be a while before I attempt doing an exe.
No there is one .exe,can have multiply version(python 2.7, 3.8 or 3.9 but the name is still the same python.exe.
Windows see Python trough Environment Variables Path.
For install look at Python 3.9/3.8 and pip installation under Windows

So the version use most should be in Path,test both python and pip.
I use cmder if wonder about λ.
# Test python
G:\div_code
λ python -V
Python 3.9.5

# Path to .exe 
G:\div_code
λ python -c "import sys;print(sys.executable)"
C:\python39\python.exe

# Test pip
G:\div_code
λ pip -V
pip 21.1.3 from c:\python39\lib\site-packages\pip (python 3.9)
Quote:Does not like spaces in file name.
Use double quote if run command line in Windows.
# test code.py
import os

clear = lambda: os.system('cls')
clear()

i = 1
while i < 6:
    print(i)
    i += 1

aTuple = (10, 20, 30, 40)
a, b, c, d = aTuple
print(a)
print(b)
print(d)
So if run with this file name test code.py need to this.
G:\div_code
λ python "test code.py"

1  
2  
3  
4  
5  
10 
20 
40 

G:\div_code
Making .exe of this code with pyinstaller.
Have delete os.system('cls') and add last input("Press enter to Exit")
G:\div_code\dist
λ pyinstaller --onefile "test code.py"
112 INFO: PyInstaller: 4.5
112 INFO: Python: 3.9.5
190 INFO: Platform: Windows-10-10.0.19041-SP0
192 INFO: wrote G:\div_code\test code.spec
.....

G:\div_code
λ cd dist

G:\div_code\dist
λ ls
build/  dist/  'test code.exe'*  'test code.spec'

# Run exe
G:\div_code\dist
λ "test code.exe"
1
2
3
4
5
10
20
40
When make .exe should definitely not use space in file name because the from command line have to use "test code.exe",
this is confusing for end users of the .exe.

Quote:one that would run in windows 10 desktop using an icon.
Here comes file associations into the pictue,should point to main version as shown from command line in my case Python 3.9.
Reply


Messages In This Thread
window command window - by RobertAlvarez424 - Aug-03-2021, 10:26 PM
RE: window command window - by bowlofred - Aug-03-2021, 10:37 PM
RE: window command window - by RobertAlvarez424 - Aug-04-2021, 01:35 AM
RE: window command window - by Gribouillis - Aug-04-2021, 06:44 AM
RE: window command window - by buran - Aug-04-2021, 08:18 AM
RE: window command window - by RobertAlvarez424 - Aug-04-2021, 02:56 PM
RE: window command window - by snippsat - Aug-04-2021, 06:19 PM
RE: window command window - by RobertAlvarez424 - Aug-04-2021, 08:18 PM
RE: window command window - by RobertAlvarez424 - Aug-05-2021, 02:17 PM
RE: window command window - by jefsummers - Aug-05-2021, 03:11 PM
RE: window command window - by snippsat - Aug-05-2021, 03:40 PM
RE: window command window - by RobertAlvarez424 - Aug-05-2021, 05:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hide CMD call window tester_V 8 617 Apr-16-2024, 08:26 PM
Last Post: deanhystad
  Open files in an existing window instead of new Kostov 2 495 Apr-13-2024, 07:22 AM
Last Post: Kostov
  How to Minimize ADB window OomKoos 0 470 Dec-29-2023, 12:41 PM
Last Post: OomKoos
  add entries and labels to the window tkinter jacksfrustration 3 799 Oct-10-2023, 06:41 PM
Last Post: buran
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 2,161 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  Can't stop keyboard listener to grab chars typed inside CTk window Valjean 9 1,616 Sep-25-2023, 08:07 PM
Last Post: deanhystad
  read active document name - other than from the window title ineuw 0 607 Sep-11-2023, 09:06 AM
Last Post: ineuw
  how to open a popup window in tkinter with entry,label and button lunacy90 1 1,074 Sep-01-2023, 12:07 AM
Last Post: lunacy90
Bug tkinter.TclError: bad window path name "!button" V1ber 2 977 Aug-14-2023, 02:46 PM
Last Post: V1ber
  Howto do motion event on solely window and not the widgets on it? janeik 3 981 Jul-11-2023, 12:10 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020