473,769 Members | 7,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4599
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:\Python4 2;%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ühr er: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

Aug 13 '08 #2
On Aug 13, 6:34 pm, "durumd...@gmai l.com" <durumd...@gmai l.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[=[openCommandStri ng]]]

fileType Specifies the file type to examine or change
openCommandStri ng 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;%PA THEXT%

and the script could be invoked as follows:

script 1 2 3

C:\junk>ftype python.file
python.file="C: \Python25\pytho n.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.Fil e

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

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

In other machines the start "anything.x ls", or "anything.h tml" or
"anything.j pg" 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\pytho n.exe" "%1" %*

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

In other machines the start "anything.x ls", or "anything.h tml" or
"anything.j pg" 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
3018
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 on www.python.org, compiled with default options (./configure && make). I'm using the pyPgSQL plugin to connect to a PostGreSQL database, and have tried the Debian and self-compiled newest versions of that as well. I'm running BitTorrent, and...
4
1930
by: Jed R. Mallen | last post by:
Hello, Can anyone point me to a nice tute on making python apps for win32? TIA
10
2225
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 less. I'd like to use Python in my games. However, python24.dll is 1.86MB, and zips down to 877k. I can't afford to devote 1/6 of my download to just the scripting interpreter; I've got music, and textures, and my own crappy code to ship. ...
1
3696
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 # # Brick & Ball in Python # by Jerry Fleming <jerryfleming@etang.com>
17
8488
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 file under linux python 2.4 (same problem with windows 2.5, tried with the first example) : #Python interpreter memory usage : 1.1 Mb private, 1.4 Mb shared #Using http://www.pixelbeat.org/scripts/ps_mem.py to get memory information
1
2043
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 the objects for which that memory was allocated are no longer live in the process. This is only a leak if peak memory goes up again each time you create any new objects. Try repeated allocations of a large dictionary and observe how memory...
6
7481
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, http://ftp.freedb.org/pub/freedb/ , and has about 2.5 million members in it. Here's a simple toy program that just goes through and counts the number of members in the tarfile, printing a status message every N records (N=10,000 for the smaller file;...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.