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

win32 - associate .pyw with a file extension...

Hello!

I'm trying to associate a file extension to my wxPython script so that
all I have to do is double click on the file and my python script will
load up with the path of that file.

For instance, I've associated all .py files to be opened up with
emacs.exe. If I double click on a .py file, emacs.exe would open up
with that file in its buffer.

Is there a way to do this with a non-exe (wxPython script)? Everytime
I try to associate a certain file extension (right clicking file->Open
with->Choose program) with my python script (.pyw) windows states that
I do not have a valid win32 program. Is there a way to do this with a
python script? Thank you for your time.

Aug 22 '05 #1
1 3375
kn********@gmail.com wrote:
Hello!

I'm trying to associate a file extension to my wxPython script so that
all I have to do is double click on the file and my python script will
load up with the path of that file.

For instance, I've associated all .py files to be opened up with
emacs.exe. If I double click on a .py file, emacs.exe would open up
with that file in its buffer.

Is there a way to do this with a non-exe (wxPython script)? Everytime
I try to associate a certain file extension (right clicking file->Open
with->Choose program) with my python script (.pyw) windows states that
I do not have a valid win32 program. Is there a way to do this with a
python script? Thank you for your time.

As long as I can see, you are trying to associate your .pyw extension
directly with your python script, let say "MyProgram.pyw". This cannot work
because Windows does not know how to run MyProgram.pyw itself. You have to
associate the .pyw extension with the python interpreter. The name of your
script has to be passed to python on the command line (together with its
command line parameter). That is, Windows has to be requested to executed
this command line:

c:/.../python_directory/python.exe MyProgram.pyw FirstParam SecondParam

Most likely, you are trying to execute this, instead:

c:/.../MyPrograDir/MyProgram.pyw FirstParam SecondParam

HTH

-----------------------------------
Alessandro Bottoni
Aug 22 '05 #2

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

Similar topics

2
by: Mr Geetar | last post by:
I'm running PHP 4.3.2 with Apache 2.0.46 on Windows XP Home. Intel P4 1.5GHz chip with plenty of memory. I'm trying to enable DOM XML functions in PHP and having a bit of trouble. Per the PHP...
0
by: Quinet, Joel | last post by:
Hi all, I use the Win32 extension (Build 157) module with Python 2.3 to add row in a sql server 2000 sp3 DB. My problem is I can not insert data of type money in the DB. I use the following...
3
by: Tiziano Bettio | last post by:
Hi there I'm looking for a simple solution of a win32 shell extension (virtual drive). It should make available a new drive with letter, which will be read-only. Instead of a network drive or...
5
by: Francois De Serres | last post by:
Hiho, could somebody please enlighten me about the mechanics of C callbacks to Python? My domain is more specifically callbacks from the win32 API, but I'm not sure that's where the problem...
6
by: Ashok | last post by:
hi, i want to know how to make a specific type of file open in an application i developed in python when the user clicks on the file.(in windows) for eg. a .txt file when clicked opens in notepad,...
2
by: S.Creek | last post by:
Does anybody know how to associate an icon with a file extension that windows is not familiar with? thanks
1
by: Tran Hong Quang | last post by:
Hi, Is it possible to write a code in C++ to associate a given file extension with our application? So that if user double click on the file on Windows Explorer, our application will be launched....
0
by: newbie73 | last post by:
Going through the tutorial on http://swig.org, I created the example files (pasted below). After generating the _wrap file, I tried compiling (using mingw32) and received a lot of undefined...
1
by: Petr Gotthard | last post by:
Hello, my C++ extension crashes under Win32 when the tp_print is called. It crashes with both Python 2.5.2 and 2.6. The crash occurs in system32\ntdll.dll, with exception code 0xc0000005. I...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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:
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.