473,386 Members | 1,785 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.

The python not starting under cmd.exe

Hi!

My problem is that:
The "test.py" is working in every machine that I use except in my home
machine.
Formerly it worked but now not. I don't know what happened, I searching
for some solution.

The errormessage is this (after I tried to start test.py under cmd.exe):

Microsoft Windows XP [verziószám: 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\>test.py
A rendszer nem tudja végrehajtani a megadott programot.

c:\>
Sorry for non english, I try to translate it:
"The system cannot execute the program/application."

Interesting thing that the starting from Explorer, FreeCommander, or
other tool (Double clicking, Hit enter on it) is working good, so the
"py" linked to the python.
I tried to set path, and pathext too but it have no effect.

This command is working:
"python test.py".

I don't know, why not working the "test.py" command, because in other
machines it is working good... :-(((((

Thanks for any advance in this problem!

dd

Aug 13 '08 #1
4 4569
du*******@gmail.com wrote:
The "test.py" is working in every machine that I use except in my home
machine.
[...]
c:\>test.py
A rendszer nem tudja végrehajtani a megadott programot.

c:\>
Sorry for non english, I try to translate it:
"The system cannot execute the program/application."

Interesting thing that the starting from Explorer, FreeCommander, or
other tool (Double clicking, Hit enter on it) is working good, so the
"py" linked to the python.
Maybe, maybe not. This 'linked to' is a notion of the shell (i.e. the
Explorer) so it doesn't apply to the CLI necessarily. Anyhow: I guess you
also can't run the interactive Python interpreter from the commandline
(just type 'python' to test that). If that is the case, you simply need to
add the path to the interpreter to the PATH environment variable:

set PATH=C:\Python42;%PATH%

You can also set this somewhere in your user profile, otherwise it only
affects the current commandline and processes started from it.
I tried to set path, and pathext too but it have no effect.

This command is working:
"python test.py".
Hmm, strange. From where did you issue that command? If it was from the
Python install dir, it will find the local python.exe even without the path
and might not do the same when it tries to find the handler from a call to
test.py. And what did you try to set the PATH and PATHEXT to?

Good luck and please drop a note if you manage to solve the issue!

Uli

--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

Aug 13 '08 #2
On Aug 13, 6:34 pm, "durumd...@gmail.com" <durumd...@gmail.comwrote:
Hi!

My problem is that:
The "test.py" is working in every machine that I use except in my home
machine.
Formerly it worked but now not. I don't know what happened, I searching
for some solution.

The errormessage is this (after I tried to start test.py under cmd.exe):

Microsoft Windows XP [verziószám: 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\>test.py
A rendszer nem tudja végrehajtani a megadott programot.

c:\>

Sorry for non english, I try to translate it:
"The system cannot execute the program/application."

Interesting thing that the starting from Explorer, FreeCommander, or
other tool (Double clicking, Hit enter on it) is working good, so the
"py" linked to the python.
I tried to set path, and pathext too but it have no effect.

This command is working:
"python test.py".

I don't know, why not working the "test.py" command, because in other
machines it is working good... :-(((((
This may help:
====
C:\junk>help assoc
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type
with
fileType Specifies the file type to associate with the file
extension

Type ASSOC without parameters to display the current file
associations.
If ASSOC is invoked with just a file extension, it displays the
current
file association for that file extension. Specify nothing for the
file
type and the command will delete the association for the file
extension.

C:\junk>assoc .py
.py=Python.File

C:\junk>help ftype
Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

fileType Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching
files
of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined. FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type. Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation. %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc. %~n gets all the
remaining
parameters starting with the nth parameter, where n may be between 2
and 9,
inclusive. For example:

ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:

script.pl 1 2 3

If you want to eliminate the need to type the extensions, then do the
following:

set PATHEXT=.pl;%PATHEXT%

and the script could be invoked as follows:

script 1 2 3

C:\junk>ftype python.file
python.file="C:\Python25\python.exe" "%1" %*

====
HTH,
John
Aug 13 '08 #3
Hi!

nntpman68 írta:
Did you try

start test.py

from the command line?

Normally this tries to behave as if you clicked on the file from the
explorer?
bye
The associations, filetypes are good:

H:\Dev\ImgOrder>ASSOC .py
..py=Python.File

H:\Dev\ImgOrder>ftype python.file
python.file="C:\Python25\python.exe" "%1" %*

But the start not working. And not only Python Program, but all start
failed...

In other machines the start "anything.xls", or "anything.html" or
"anything.jpg" is working good, it is starts the program that associated
with this file, and open the file.

But in this machine is not working. So it is not pythonic, it is windows
problem.

Thanks for your help! For everyone who helped me!

dd

Aug 15 '08 #4
du*******@gmail.com wrote:
H:\Dev\ImgOrder>ftype python.file
python.file="C:\Python25\python.exe" "%1" %*

But the start not working. And not only Python Program, but all start
failed...

In other machines the start "anything.xls", or "anything.html" or
"anything.jpg" is working good, it is starts the program that associated
with this file, and open the file.

But in this machine is not working. So it is not pythonic, it is windows
problem.
you might want to check if your antivirus/security software is somehow
involved with this (that's more likely on corporate machines, though,
where admins love to set corporate-wide "policies" that mess things up
for programmers ;-).

</F>

Aug 15 '08 #5

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

Similar topics

6
by: Juho Saarikko | last post by:
The program attached to this message makes the Python interpreter segfault randomly. I have tried both Python 2.2 which came with Debian Stable, and self-compiled Python 2.3.3 (newest I could find...
4
by: Jed R. Mallen | last post by:
Hello, Can anyone point me to a nice tute on making python apps for win32? TIA
10
by: Larry Hastings | last post by:
I'm an indie shareware Windows game developer. In indie shareware game development, download size is terribly important; conventional wisdom holds that--even today--your download should be 5MB or...
1
by: Jerry Fleming | last post by:
Hi, I have wrote a game with python curses. The problem is that I want to confirm before quitting, while my implementation doesn't seem to work. Anyone can help me? #!/usr/bin/python # #...
17
by: frederic.pica | last post by:
Greets, I've some troubles getting my memory freed by python, how can I force it to release the memory ? I've tried del and gc.collect() with no success. Here is a code sample, parsing an XML...
1
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after...
6
by: Terry Carroll | last post by:
I am trying to do something with a very large tarfile from within Python, and am running into memory constraints. The tarfile in question is a 4-gigabyte datafile from freedb.org,...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
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
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.