Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-11 Thread Praveen Kumar via Python-list
Yes, I have 24.3.1 version of pip in my win 11 device, there is a new version of pip available, 25.0.1 Shall I upgrade that? Kind regards, Praveen On Mon, 10 Mar 2025, 03:04 Thomas Passin via Python-list, < python-list@python.org> wrote: > On 3/9/2025 3:16 PM, Gilmeh Serda via Python-list wrot

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-11 Thread Praveen Kumar via Python-list
Is that an approved location for executables? May I know? What do you mean by approved location? Kind regards, Praveen On Mon, 10 Mar 2025, 01:25 Gilmeh Serda via Python-list, < python-list@python.org> wrote: > On Sat, 8 Mar 2025 15:59:51 +0530, Praveen Kumar wrote: > > > "C:\Users\Bharath\AppD

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-10 Thread Praveen Kumar via Python-list
Hi Matt, I pointed out onething that related to the errors, what I pointed out is I just gone through the system 32 path in c drive and I found the python executive and other python files indicating 0 kb, and I deleted these exe, since these are seem to be corrupted to me, then after I tried runn

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-10 Thread Mats Wichmann via Python-list
On 3/10/25 10:08, Praveen Kumar via Python-list wrote: Hi Matt, I pointed out onething that related to the errors, what I pointed out is I just gone through the system 32 path in c drive and I found the python executive and other python files indicating 0 kb, and I deleted these exe, since thes

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-09 Thread Thomas Passin via Python-list
On 3/9/2025 3:16 PM, Gilmeh Serda via Python-list wrote: On Sat, 8 Mar 2025 15:59:51 +0530, Praveen Kumar wrote: "C:\Users\Bharath\AppData\Local\Programs\Python\Python313\python.exe" Is that an approved location for executables? Yes, that's where a python.org install normally goes. If you a

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-09 Thread Praveen Kumar via Python-list
If the path had been set for a local user but not for the system, you would see that behavior. The install from python.org should have installed the "py" launcher. Does that run? IOW, does typing "py" launch Python? Yes it does for both admin and non-admin cmd shells. But p

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-09 Thread Thomas Passin via Python-list
ment Variables. (system variables, > User variables.) > > ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\ > ***C: \Users\Bharath\AppData\Local\Programs\Python\Python313\Scripts\ > > * however, then after I tried ru

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-09 Thread Praveen Kumar via Python-list
o the PATH in the Environment Variables. (system > variables, > > User variables.) > > > > ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\ > > ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\Scripts\ > > > > * however, then after I

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-08 Thread inhahe via Python-list
> > ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\ > ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\Scripts\ > > * however, then after I tried running direct path execution in the cmd. > "C:\Users\Bharath\AppData\Local\Programs\Python\Python313

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-08 Thread Praveen Kumar via Python-list
gt;> > *Uninstalled python software from the apps settings and reinstalled >> python >> > software from the official python.org site >> > >> > *Added Python to the PATH in the Environment Variables. (system >> variables, >> > User variables.) >&g

Re: "Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-08 Thread Thomas Passin via Python-list
I tried running direct path execution in the cmd. "C:\Users\Bharath\AppData\Local\Programs\Python\Python313\python.exe" --version, however it works well and it executed and showed the version, but without file path, it won't work anyway. * Additionally I've checked windows app

"Getting 'This app can’t run on your PC' (Access Denied) error when running Python or checking version in CMD on Windows 11"

2025-03-08 Thread Praveen Kumar via Python-list
ed Python to the PATH in the Environment Variables. (system variables, User variables.) ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\ ***C:\Users\Bharath\AppData\Local\Programs\Python\Python313\Scripts\ * however, then after I tried running direct path execution in the cmd. "C

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-04-01 Thread Barry Scott
> On 30 Mar 2020, at 02:03, Dennis Lee Bieber wrote: > > On Sun, 29 Mar 2020 07:24:03 -0400, Terry Reedy > declaimed the following: > >> To clarify, the pydev/python.org installer does not use msi. I don't >> know that anyone else does. And if someone did, why do you think it >> would al

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Mike Dewhirst
On 30/03/2020 2:55 pm, Michael Torrie wrote: On 3/29/20 6:41 PM, Mike Dewhirst wrote: I would first determine whether it is the 32 or 64 bit version which is installed. I would then visit www.python.org and download the exact same python executable installer. Don't know what msi is but it doesn'

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Michael Torrie
On 3/29/20 6:41 PM, Mike Dewhirst wrote: > I would first determine whether it is the 32 or 64 bit version which is > installed. I would then visit www.python.org and download the exact same > python executable installer. Don't know what msi is but it doesn't > matter. I think it just means micro

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Mike Dewhirst
On 29/03/2020 10:24 pm, Terry Reedy wrote: On 3/29/2020 12:17 AM, Mike Dewhirst wrote: On 29/03/2020 5:06 am, Terry Reedy wrote: On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Terry Reedy
On 3/29/2020 12:17 AM, Mike Dewhirst wrote: On 29/03/2020 5:06 am, Terry Reedy wrote: On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me below error: enter image description here

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-28 Thread Mike Dewhirst
On 29/03/2020 5:06 am, Terry Reedy wrote: On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me below error: enter image description here Python is not currently installed with msi

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-28 Thread Terry Reedy
On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me below error: enter image description here Python is not currently installed with msi, hence cannot use it to uninstall. Images

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-27 Thread Souvik Dutta
wrote: > > > > Hi, > > > > How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec > > /uninstall C:\Python37\python.exe But it gives me below error: enter > > image description here > > > > how do i uninstall it ? > > > You appear to

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-27 Thread boB Stepp
On Fri, Mar 27, 2020 at 1:22 PM deepalee khare wrote: > > Hi, > > How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec > /uninstall C:\Python37\python.exe But it gives me below error: enter > image description here > > how do i uninstall it ? > You appe

How to uninstall Python3.7 in Windows using cmd ?

2020-03-27 Thread deepalee khare
Hi, How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me below error: enter image description here how do i uninstall it ? Thanks, Deepalee Khare -- https://mail.python.org/mailman/listinfo/python-list

Re: python3 subprocess run sudo cmd in remote failed

2019-09-17 Thread Eli the Bearded
In comp.lang.python, lampahome wrote: > what I tried many times like enter password, but it failed. > I just want to use ps.stdin.write(password) to send password, but it always > jump password prompt immediately. Passwords are frequently read from stderr, not stdin, so that tools can get a huma

Re: python3 subprocess run sudo cmd in remote failed

2019-09-16 Thread Chris Angelico
On Tue, Sep 17, 2019 at 3:25 PM Cameron Simpson wrote: > However, I repeat my recommendation to use a keypair for the > authentication, as it avoids needing interactive passwords (and having > your programme know the password has its own suite of problems to do > with where that password comes fro

Re: python3 subprocess run sudo cmd in remote failed

2019-09-16 Thread Cameron Simpson
On 17Sep2019 13:02, lampahome wrote: Note also that since stdin and stdout are pipes and not the terminal then ssh will not be interactive, and will not allocate a tty at the far end either. You can get ssh to open a remote tty with the -t option. But I suspect you don't want stdin=PIPE or stdo

Re: python3 subprocess run sudo cmd in remote failed

2019-09-16 Thread lampahome
> > Well, there's a Python library called "paramiko" which implements ssh. > That might help. > > Later I will try lol. > Note also that since stdin and stdout are pipes and not the terminal > then ssh will not be interactive, and will not allocate a tty at the far > end either. You can get ssh t

Re: python3 subprocess run sudo cmd in remote failed

2019-09-16 Thread Cameron Simpson
On 17Sep2019 12:13, lampahome wrote: Hello, I use python3.5 and found no way to solve this problem from subprocess import Popen, PIPE ps = Popen('ssh -o \'StrictHostKeyChecking no\' hello@192.168.80.11 \'sudo sysctl -w vm.drop_caches=3\', stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=0, shell

python3 subprocess run sudo cmd in remote failed

2019-09-16 Thread lampahome
Hello, I use python3.5 and found no way to solve this problem >from subprocess import Popen, PIPE >ps = Popen('ssh -o \'StrictHostKeyChecking no\' hello@192.168.80.11 \'sudo sysctl -w vm.drop_caches=3\', stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=0, shell=True) > hello@192.168.80.11's password

Re: passing a variable to cmd

2016-11-06 Thread Chris Angelico
On Sun, Nov 6, 2016 at 10:48 PM, SS wrote: > # cmd='dig @4.2.2.2 nbc.com ns +short' > cmd="dig @4.2.2.2 %s ns +short", % (domname) > proc=subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE) > out,err=proc.communicate() > print(out) > > The line that

Re: passing a variable to cmd

2016-11-06 Thread Terry Reedy
On 11/6/2016 6:48 AM, SS wrote: cmd="dig @4.2.2.2 %s ns +short", % (domname) does not work. No kidding. ', %' is a syntax error. The , makes a tuple, the % after string does interpolation. You obviously want the latter so omit the ,. The traceback should have poin

Re: passing a variable to cmd

2016-11-06 Thread Jason Friedman
> > import subprocess > import shlex > > domname = raw_input("Enter your domain name: "); > print "Your domain name is: ", domname > > print "\n" > > # cmd='dig @4.2.2.2 nbc.com ns +short' > cmd="dig @4.2.

passing a variable to cmd

2016-11-06 Thread SS
Note the following code: import subprocess import shlex domname = raw_input("Enter your domain name: "); print "Your domain name is: ", domname print "\n" # cmd='dig @4.2.2.2 nbc.com ns +short' cmd="dig @4.2.2.2 %s ns +short", % (domn

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 4:47:33 PM UTC+12, sh.a...@gmail.com wrote: > i have installed python 3.5 , but the python command is not recognized Windows does not make it easy to install things, does it... -- https://mail.python.org/mailman/listinfo/python-list

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread eryk sun
On Wed, Aug 10, 2016 at 2:03 PM, Random832 wrote: > On Wed, Aug 10, 2016, at 06:34, eryk sun wrote: >> On Wed, Aug 10, 2016 at 4:46 AM, wrote: >> > >> > i have installed python 3.5 , but the python command is not recognized >> > >> > C:\Users\sharmaaj>python >> > 'python' is not recognized as an

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread eryk sun
On Wed, Aug 10, 2016 at 1:46 PM, BartC wrote: > On 10/08/2016 11:34, eryk sun wrote: >> >> On Wed, Aug 10, 2016 at 4:46 AM, wrote: >>> >>> i have installed python 3.5 , but the python command is not recognized >>> >>> C:\Users\sharmaaj>python >>> 'python' is not recognized as an internal or exte

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread BartC
On 10/08/2016 15:03, Random832 wrote: On Wed, Aug 10, 2016, at 06:34, eryk sun wrote: On Wed, Aug 10, 2016 at 4:46 AM, wrote: i have installed python 3.5 , but the python command is not recognized C:\Users\sharmaaj>python 'python' is not recognized as an internal or external command, operab

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread Random832
On Wed, Aug 10, 2016, at 06:34, eryk sun wrote: > On Wed, Aug 10, 2016 at 4:46 AM, wrote: > > > > i have installed python 3.5 , but the python command is not recognized > > > > C:\Users\sharmaaj>python > > 'python' is not recognized as an internal or external command, > > operable program or batc

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread BartC
On 10/08/2016 11:34, eryk sun wrote: On Wed, Aug 10, 2016 at 4:46 AM, wrote: i have installed python 3.5 , but the python command is not recognized C:\Users\sharmaaj>python 'python' is not recognized as an internal or external command, operable program or batch file. what should i do to run

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread eryk sun
On Wed, Aug 10, 2016 at 4:46 AM, wrote: > > i have installed python 3.5 , but the python command is not recognized > > C:\Users\sharmaaj>python > 'python' is not recognized as an internal or external command, > operable program or batch file. > > what should i do to run python commands. Modify y

Re: cmd prompt does not recognizes python command on Windows 7

2016-08-10 Thread Wolfgang Maier
Try py instead of python. That invokes a thing called the python launcher (see https://docs.python.org/3/using/windows.html#python-launcher-for-windows for more details). Best, Wolfgang On 10.08.2016 06:46, sh.aja...@gmail.com wrote: Hi Everyone i have installed python 3.5 , but the python

cmd prompt does not recognizes python command on Windows 7

2016-08-09 Thread sh . ajay12
Hi Everyone i have installed python 3.5 , but the python command is not recognized C:\Users\sharmaaj>python 'python' is not recognized as an internal or external command, operable program or batch file. what should i do to run python commands. thanks everyone for reading my post. >From Aja

Re: How do i instantiate a class_name passed via cmd line

2016-02-14 Thread Peter Otten
Gregory Ewing wrote: > Something like this should do it: > >instance = getattr(module, class_name)(module_name, product) > > If the class name is always the same as the module name with the > first letter capitalized, you could use > >instance = getattr(module, module_name.capitalize())

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Rick Johnson
On Saturday, February 13, 2016 at 11:39:56 PM UTC-6, Veek. M wrote: > Nope - this is what i'm doing: > > class Foo(): > pass > > x = 'Foo' > > How do i use 'x' to create an instance of class Foo? Use the builtin function `getattr` on the module that contains the class named "Foo". For exampl

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Cameron Simpson
On 14Feb2016 10:10, Veek. M wrote: I'm writing a price parser. I need to do the equivalent of perl's $$var to instantiate a class where $car is the class_name. I'm passing 'Ebay' or 'Newegg' or 'Amazon' via cmd-line. I have a module named ebay.py

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Veek. M
Gregory Ewing wrote: > Veek. M wrote: >> I'm writing a price parser. I need to do the equivalent of perl's >> $$var to instantiate a class where $car is the class_name. >> >> I'm passing 'Ebay' or 'Newegg' or 'Amazon' via c

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Gregory Ewing
Veek. M wrote: I'm writing a price parser. I need to do the equivalent of perl's $$var to instantiate a class where $car is the class_name. I'm passing 'Ebay' or 'Newegg' or 'Amazon' via cmd-line. I have a module named ebay.py and a class cal

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Veek. M
Rick Johnson wrote: > On Saturday, February 13, 2016 at 10:41:20 PM UTC-6, Veek. M wrote: >> how do i replace the 'Ebay' bit with a variable so that I >> can load any class via cmd line. > > Is this what you're trying to do? > > (Python2.x code)

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Rick Johnson
On Saturday, February 13, 2016 at 10:41:20 PM UTC-6, Veek. M wrote: > how do i replace the 'Ebay' bit with a variable so that I > can load any class via cmd line. Is this what you're trying to do? (Python2.x code) >>> import Tkinter as tk >>> classNames

How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Veek. M
I'm writing a price parser. I need to do the equivalent of perl's $$var to instantiate a class where $car is the class_name. I'm passing 'Ebay' or 'Newegg' or 'Amazon' via cmd-line. I have a module named ebay.py and a class called Ebay (price pa

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Steven D'Aprano
On Wednesday 06 January 2016 07:25, Robert wrote: > Why is there difference between cmd line and .py file? Almost certainly because you are not running exactly the same code each time. > I run below code, which is downloaded from link: Your code fails on the first line with Nam

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Steven D'Aprano
On Wednesday 06 January 2016 07:37, John Gordon wrote: > The built-in function sum() returns a single value, not a list, so this > is a reasonable error. Not quite. It depends on what arguments you give it. py> a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] py> sum(a, []) [1, 2, 3, 4, 5, 6, 7, 8, 9] Bu

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Steven D'Aprano
On Wednesday 06 January 2016 10:25, Thomas 'PointedEars' Lahn wrote: > Robert wrote: > >> I just wonder that the cmd line function sum may be different from the >> .py file used. One is numpy package, the other is a general one. Then, >> how can I further make i

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Thomas 'PointedEars' Lahn
Robert wrote: > I just wonder that the cmd line function sum may be different from the > .py file used. One is numpy package, the other is a general one. Then, > how can I further make it clear for this guess? Among other things: print(sum.__doc__) -- PointedEars Twitter: @Poi

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: > On Tue, Jan 5, 2016 at 3:45 PM, Robert wrote: >> import numpy as np >> >> In [154]: np.sum(expectation_A)[0] >> […] >> IndexError: invalid index to scalar variable. > > I've not used numpy, but you should print expectation_A to see what's in > it. It may be empty, causin

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
On Tuesday, January 5, 2016 at 3:58:44 PM UTC-5, Joel Goldstick wrote: > On Tue, Jan 5, 2016 at 3:45 PM, Robert wrote: > > > On Tuesday, January 5, 2016 at 3:37:53 PM UTC-5, John Gordon wrote: > > > In Robert < > > r...@gmail.com> writes: > > > > > > > > > > > # represent the experi

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Joel Goldstick
On Tue, Jan 5, 2016 at 3:45 PM, Robert wrote: > On Tuesday, January 5, 2016 at 3:37:53 PM UTC-5, John Gordon wrote: > > In Robert < > r...@gmail.com> writes: > > > > > > > > # represent the experiments > > > head_counts = np.array([5,9,8,4,7]) > > > > The code doesn't define 'np', s

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
On Tuesday, January 5, 2016 at 3:37:53 PM UTC-5, John Gordon wrote: > In Robert > writes: > > > > > # represent the experiments > > head_counts = np.array([5,9,8,4,7]) > > The code doesn't define 'np', so this line should produce an error. > > The code you linked contains this im

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
; // > > I can see expectation_A content with: > > In[146]:expectation_A > Out[146]: > array([[ 0.52278641, 0.52278641], >[ 8.55858656, 0.95095406], > [ 6.75024946, 1.68756237], >[ 0.1260128 , 0.1890192 ], >[ 4.20520218, 1

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread John Gordon
In Robert writes: > > # represent the experiments > head_counts = np.array([5,9,8,4,7]) The code doesn't define 'np', so this line should produce an error. The code you linked contains this import: import numpy as np However you didn't show it here, so I wonder if you poste

Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
Hi, I run below code, which is downloaded from link: http://stackoverflow.com/questions/15513792/expectation-maximization-coin-toss-examples?rq=1 # represent the experiments head_counts = np.array([5,9,8,4,7]) tail_counts = 10-head_counts experiments = zip(head_counts,tail_counts)

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Ben Finney : > Chris Angelico writes: > >> On Fri, May 8, 2015 at 1:24 AM, Marko Rauhamaa wrote: >> >> That's Python's job. Abstracting away all those differences so you >> >> don't have to look at them. >> > >> > That's the difference between our opinions: you want Python to work >> > the same

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Ben Finney
Chris Angelico writes: > On Fri, May 8, 2015 at 1:24 AM, Marko Rauhamaa wrote: > >> That's Python's job. Abstracting away all those differences so you > >> don't have to look at them. > > > > That's the difference between our opinions: you want Python to work > > the same on different OS's. I wa

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Fri, May 8, 2015 at 1:24 AM, Marko Rauhamaa wrote: >> That's Python's job. Abstracting away all those differences so you >> don't have to look at them. > > That's the difference between our opinions: you want Python to work the > same on different OS's. I want Python's system programming facili

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Fri, May 8, 2015 at 1:14 AM, Ian Kelly wrote: > On Thu, May 7, 2015 at 8:03 AM, Chris Angelico wrote: >> On Thu, May 7, 2015 at 11:44 PM, Marko Rauhamaa wrote: >>> Whole programming cultures, idioms and "right ways" differ between >>> platforms. What's the right way to write a service (daemon

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
Marko Rauhamaa wrote: > Anyway, Python has os.system() that does the quick and dirty thing you > might be looking for. Always invokes shell ==> overhead for .exe files -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Stefan Zimmermann : > Calling an external command should be one of the simplest tasks in a > high level scripting language like Python. Actually, that's quite a tricky operation in any OS. For example, bash's simplicity is a trap that claims a lot of victims. Anyway, Python has os.system() that

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
Python code which calls external commands that > > are not binary by default: > > Then, write OS-dependent Python code. Then you even have to write tool-distribution-dependent code. Especially Unix tools are often distributed in many different variants for Windows. Some installers exp

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Chris Angelico : > What's the best way to farm work off to a bunch of processes and have > them communicate their results back? You use the subprocess module, > and then it doesn't matter whether they use Unix sockets, named pipes, > physical files on the disk, or miniature nuclear explosions, the

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Ian Kelly
On Thu, May 7, 2015 at 8:03 AM, Chris Angelico wrote: > On Thu, May 7, 2015 at 11:44 PM, Marko Rauhamaa wrote: >> Whole programming cultures, idioms and "right ways" differ between >> platforms. What's the right way to write a service (daemon)? That's >> probably completely different between Wind

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Thu, May 7, 2015 at 11:44 PM, Marko Rauhamaa wrote: > Chris Angelico : > >>> A software system is defined through its interfaces. >> >> And the most important interface is with a human. > > I barely ever program anything for the human interface. > >> If you want to write single-platform code, g

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Chris Angelico : >> A software system is defined through its interfaces. > > And the most important interface is with a human. I barely ever program anything for the human interface. > If you want to write single-platform code, go for it; but if you want > to write cross-platform code, the best

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Thu, May 7, 2015 at 10:41 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> I was specifically disagreeing with the notion that it's right and >> normal to write a bunch of platform-specific code in Python. That >> should be the rarity. > > Why is that? > > Code is written for a specific need a

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Chris Angelico : > I was specifically disagreeing with the notion that it's right and > normal to write a bunch of platform-specific code in Python. That > should be the rarity. Why is that? Code is written for a specific need and environment. Often trying to write generic solutions leads to cum

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Thu, May 7, 2015 at 9:28 PM, Dave Angel wrote: > It's a nice goal. But these aren't OS features in Windows, they're shell > features. And there are several shells. If the user has installed a > different shell, is it Python's job to ignore it and simulate what cmd.exe > does? It might be an

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Dave Angel
On 05/07/2015 06:24 AM, Chris Angelico wrote: On Thu, May 7, 2015 at 8:10 PM, Marko Rauhamaa wrote: Stefan Zimmermann : And last but not least, Popen behavior on Windows makes it difficult to write OS-independent Python code which calls external commands that are not binary by default: Then

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Chris Angelico
On Thu, May 7, 2015 at 8:10 PM, Marko Rauhamaa wrote: > Stefan Zimmermann : > >> And last but not least, Popen behavior on Windows makes it difficult >> to write OS-independent Python code which calls external commands that >> are not binary by default: > > Then, write OS-dependent Python code. >

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Marko Rauhamaa
Stefan Zimmermann : > And last but not least, Popen behavior on Windows makes it difficult > to write OS-independent Python code which calls external commands that > are not binary by default: Then, write OS-dependent Python code. I don't think it's Python's job to pave over OS differences. Java

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
mmand is a Node.js script. And under Windows it is installed with a 'coffee.cmd' wrapper to make it callable. So to make Popen work you have to switch and call 'coffee' on Unix and 'coffee.cmd' on Windows. But from the Windows shell you can just call 'coffee&#x

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
if you want to wrap some command.exe you usually write a command.bat in a path with higher precedence. And in Windows it's standard that .exe, .com, .bat and .cmd files should be callable without writing the file extension. And as already mentioned, there is a defined precedence order if t

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Gisle Vanem
Chris Angelico wrote: There's a specific search order. Back in the days of DOS, it was simply "com, then exe, then bat", but on modern Windowses, I think it's governed by an environment variable. You probably mean '%PATHEXT'. Mine is: .COM;.EXE;.BAT;.BTM;.CMD;.J

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Chris Angelico
on a tangent, > but if I write a short bash script and set the execute permission: > > steve@runes:~$ chmod u+x test.sh > steve@runes:~$ cat test.sh > echo "Running shell script" > > subprocess.call fails unless I set shell=True: > > py> p = subprocess.Pope

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Steven D'Aprano
" subprocess.call fails unless I set shell=True: py> p = subprocess.Popen('./test.sh', shell=True) py> Running shell script py> p = subprocess.Popen('./test.sh', shell=False) Traceback (most recent call last): File "", line 1, in File "/usr/

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Chris Angelico
On Thu, May 7, 2015 at 10:58 AM, Dave Angel wrote: > There's nothing Windows-specific about that behaviour. In Linux, there are > bash commands that can only be run by using shell=True. Fortunately Popen > didn't make the mistake of pretending it's a shell. But bash commands aren't the same as

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Dave Angel
On 05/06/2015 06:11 PM, Stefan Zimmermann wrote: Hi. I don't like that subprocess.Popen(['command']) only works on Windows if there is a command.exe in %PATH%. As a Windows user you would normally expect that also command.bat and command.cmd can be run that way. and command.com. If it'

PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Stefan Zimmermann
Hi. I don't like that subprocess.Popen(['command']) only works on Windows if there is a command.exe in %PATH%. As a Windows user you would normally expect that also command.bat and command.cmd can be run that way. There are simple workarounds like Popen(..., shell=True) but that is a heavy ove

Re: Run python script with CMD error

2014-01-27 Thread FalaG
I m using Python 3.3 and the script is not written by me therefore i'm gonna try to install 2.7 instead and i will let you know the result. Thank you Peter -- https://mail.python.org/mailman/listinfo/python-list

Re: Run python script with CMD error

2014-01-27 Thread Joel Goldstick
Look at lines around 29 On Jan 27, 2014 2:45 PM, wrote: > Hi everyone; > > > Im new with python and i just installed it and added it to the path.I have > already a script that i want to execute(run) but every time i do this > commend python > > > client.py > >

Re: Run python script with CMD error

2014-01-27 Thread Peter Otten
raed...@gmail.com wrote: > Hi everyone; > > > Im new with python and i just installed it and added it to the path.I have > already a script that i want to execute(run) but every time i do this > commend python > >> client.py > > in CMD to execute it,i got

Run python script with CMD error

2014-01-27 Thread raedtjr
Hi everyone; Im new with python and i just installed it and added it to the path.I have already a script that i want to execute(run) but every time i do this commend python > client.py in CMD to execute it,i got this error. Any solutions please? > File ", line 29 except E

Re: pxssh sendline() cmd

2013-02-08 Thread Piet van Oostrum
rajesh kumar writes: > Hi > > I need help in pxssh. > > Steps : > 1) I was login into remote machine usning pxssh and the prompt is '$'. > 2) After successful login running some command and the prompt is '>'. > 3) Here onwards I want to execute cli commands by using sendline(). > > My requirement

pxssh sendline() cmd

2013-02-08 Thread rajesh kumar
Hi I need help in pxssh. Steps : 1) I was login into remote machine usning pxssh and the prompt is '$'. 2) After successful login running some command and the prompt is '>'. 3) Here onwards I want to execute cli commands by using sendline(). My requirement: I need to pass arguments to sendline()

Re: for-loop on cmd-line

2012-10-11 Thread Gisle Vanem
"Dave Angel" wrote: Why would you write some C-program just to save having two separate files, one batch and one for the script? For that matter, several answers have given you approaches that didn't involve list comprehensions, including merging the two in a single file, using an initial vari

Re: for-loop on cmd-line

2012-10-11 Thread Dave Angel
On 10/11/2012 09:40 AM, Gisle Vanem wrote: > "Dave Angel" wrote: > >> it has nothing to do with being on a command line. You're using >> semicolon to combine several statements, and there are restrictions on >> what can be combined that way. One restriction is the looping >> constructs, for, if,

RE: for-loop on cmd-line

2012-10-11 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Oct 12, 2012 at 3:49 AM, Gisle Vanem wrote: > > wrote in comp.lang.python > > > > (my ISP no longer updates this group. Last message is from 8. April. > > Does the postings to the python mailing-list automatically get reposted to > > comp.lang.python?) > > Yes, c.

Re: for-loop on cmd-line

2012-10-11 Thread Chris Angelico
On Fri, Oct 12, 2012 at 3:49 AM, Gisle Vanem wrote: > wrote in comp.lang.python > > (my ISP no longer updates this group. Last message is from 8. April. > Does the postings to the python mailing-list automatically get reposted to > comp.lang.python?) Yes, c.l.p and python-list mirror each other.

Re: for-loop on cmd-line

2012-10-11 Thread Gisle Vanem
wrote in comp.lang.python (my ISP no longer updates this group. Last message is from 8. April. Does the postings to the python mailing-list automatically get reposted to comp.lang.python?) C:\Windows\system32\python32.zip c:\python32\DLLs I see a similar result: f:\Windows\system32\python

Re: for-loop on cmd-line

2012-10-11 Thread Chris Angelico
On Fri, Oct 12, 2012 at 3:24 AM, wrote: > Le jeudi 11 octobre 2012 15:16:33 UTC+2, Ramchandra Apte a écrit : > > PS C:\> $cmd="import sys;" > PS C:\> $cmd+="print('\n'.join(sys.path))" > PS C:\> $cmd > import sys;print('\n'.

Re: for-loop on cmd-line

2012-10-11 Thread wxjmfauth
Le jeudi 11 octobre 2012 15:16:33 UTC+2, Ramchandra Apte a écrit : PS C:\> $cmd="import sys;" PS C:\> $cmd+="print('\n'.join(sys.path))" PS C:\> $cmd import sys;print('\n'.join(sys.path)) PS C:\> c:\python32\python -c $cmd C:\Windows\syst

Re: for-loop on cmd-line

2012-10-11 Thread Gisle Vanem
"Dave Angel" wrote: it has nothing to do with being on a command line. You're using semicolon to combine several statements, and there are restrictions on what can be combined that way. One restriction is the looping constructs, for, if, while. Ok, I suspected something like that. You can

Re: for-loop on cmd-line

2012-10-11 Thread Chris Angelico
On Fri, Oct 12, 2012 at 12:16 AM, Ramchandra Apte wrote: > What about the "Power" in PowerShell? What about it? Are you suggesting that the OP use it? Are you saying that Windows batch already includes it? You quoted my entire post (double-spaced), but that context adds nothing to your statement;

  1   2   3   >