James Thiele
James Thiele

Reputation: 413

I have a Python program that the customer would like to access as a double clickable desktop icon on Windows 8. How do I do this? 8

I have a program called ftpgrab.py. At the command prompt to run it I type:

c:\path\to\python\dir\python.exe ftpgrab.py

Is there a way on Windows 8 to create an icon which I can double-click to run this?

Upvotes: 0

Views: 81

Answers (3)

tdelaney
tdelaney

Reputation: 77357

Assuming that you used one of the standard installers for python on windows, .py is already registered and it should just work. Copy it to your desktop and double-click. A console running the program should appear and run as normal. Its still a console app - the the customer wants a gui app, that's a different story.

btw, you shouldn't even have to type c:\path\to\python\dir\python.exe ftpgrab.py, just a plain ftpgrab.py or ftpgrab should do.

Upvotes: 1

Michael0x2a
Michael0x2a

Reputation: 64148

You can either create a batch file that will launch the program, or use something like pyinstaller to transform your script into an executable that can be run directly.

Upvotes: 4

zhangxaochen
zhangxaochen

Reputation: 34027

  1. create a file named foo.bat;
  2. copy your command to that file and save it;
  3. double click foo.bat...

Upvotes: 2

Related Questions