Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Praveen
I hope this sample code helps

def getfileinfo(filename):
print 'Filename : %s' % filename
stats = os.stat(filename)
size = stats[stat.ST_SIZE]
print 'File Size is %d bytes' % size

accessed = stats[stat.ST_ATIME]
modified = stats[stat.ST_MTIME]

print 'Last accessed: ' + time.ctime(accessed)
print 'Last modified: ' + time.ctime(modified)

Regards,
Praveen

On Oct 30, 8:00 am, [EMAIL PROTECTED] wrote:
> Greetings,
>
> I am attempting to view all files in a directory and if those files
> have not been modified within the last couple days I will remove them.
> In order to do this I need to look at the file date modied and check
> the date. I know how to look at each file name and I know how to remove
> the file. I just can't figure out how to get access to the date last
> modifed filed. Below is how I intend to access the file names in the
> directory.
>
> >>> import os,time,sys
> >>> cachedirectory="c:\\informatica\\cache\\"
> >>> v_filename_array=os.listdir(cachedirectory)
> >>> x_len=len(v_filename_array)v_filename_array[0] = first file name
> v_filename_array[1] - second file name
> 
> Thanks'
> Rich

-- 
http://mail.python.org/mailman/listinfo/python-list


How to get/read Hard disk label / drive label

2006-11-05 Thread Praveen
I want to read individual disk label

for Hard disk (C: drive, D: drive disk label)
and
CD-ROM disk label

Please provide some pointer to the code or document.

Thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


text to DB

2010-08-13 Thread Praveen
I have a text file in this format
PRA 1:13 2:20 3:5
SRA 1:45 2:75 3:9
TRA 1:2 2:65 3:45

pattern is- Book Chapter:Verses

now i have my DB schema like this
book_id chapter_id   versed_id
1   1   13
1   2   20
1   3   5
2   1   45
2   2   75
2   3   9
3   1   2
3   2   65
3   3   45

I want to write a pyhton script which read the text file and dump to
DB

could any one give me suggestion
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: text to DB

2010-08-16 Thread Praveen
On Aug 14, 11:15 am, Dennis Lee Bieber  wrote:
> On Fri, 13 Aug 2010 09:46:34 -0700 (PDT), Praveen
>  declaimed the following in
> gmane.comp.python.general:
>
> > I have a text file in this format
> > PRA 1:13 2:20 3:5
> > SRA 1:45 2:75 3:9
> > TRA 1:2 2:65 3:45
>
> > pattern is- Book Chapter:Verses
>
> > now i have my DB schema like this
> > book_id            chapter_id       versed_id
>
>         Off hand, I'd say that's an incomplete schema since there is not
> enough information available to reconstruct the input data...
>
>         I'd say there should be a second relation containing
>
> book_id book_name
>
>
>
> > could any one give me suggestion
>
>         Is there a possibility that a given book "name" can appear multiple
> times?
>
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>         wlfr...@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

f = open("/Users/Trellisys/Desktop//BibleDB/Booktable.txt","r")
bk=[]
cv = []
j=1
d={}
for line in f:
 for l in line.split():
 if l.isalnum():
   bk.append(j)
   j = j+1
 else:
   cv.append(l.split(":"))
 '''for i in l.split(":"):
   if i.isalpha():
       #print i,j
   j = j+1
   else:
   #print i'''

print bk
print cv
output
[1,2,3] but i am not getting how to map chapterId and versesId with
bookId
Regards,
Praveen
-- 
http://mail.python.org/mailman/listinfo/python-list


(no subject)

2005-03-15 Thread praveen tayal
Hi Guys,

I am having problems in the following C API program where myOtim_system is 
callable from python function. The module is listed below - 

static PyObject *
myOptim_system(PyObject *self, PyObject *args)
{
const char *command;
double u0, v0, u1, v1, u2, v2, u3, v3;
int sts;

/* variables */
PyObject *pstr, *pmod, *pdict, *pfunc, *pargs;
char * cstr;
char *dummy = "Test";
char *x = "x = ";


if (!PyArg_ParseTuple(args, "s", &command))
return NULL;

/* convert them to the doubles */
sscanf(command, "%lf %lf %lf %lf %lf %lf %lf %lf", &u0, &v0,
&u1, &v1, &u2, &v2, &u3, &v3);

sts = (int) (u0+v0+u1+v1+u2+v2+u3+v3);

/* trying to call the python program from C */
/*
The module name is test2_module and the function name is cv_calc_func
- get test2_module.cv_calc_func
*/
pmod = PyImport_ImportModule("test2_module");
pdict = PyModule_GetDict(pmod);

/* convert to the PyObject */
pfunc = PyObject_GetAttrString(pmod, "cv_calc_func");
pargs =  Py_BuildValue("s", dummy);
pstr = PyEval_CallObject(pfunc, pargs);

PyArg_Parse(pstr, "s", &cstr);
printf("%s\n", cstr);

Py_DECREF(pmod);
Py_DECREF(pstr);
Py_DECREF(pfunc);
Py_DECREF(pargs);


return Py_BuildValue("i", sts);

}

In the same module I am trying to call the python program from C API. That 
python program is called test2_module.py. It is listed below - 

import string

message = 'Hi I am here'

def cv_calc_func(dummy):
s = "warning" + `dummy`
return s


-
It contains a method called cv_calc_func(). So now the idea must me clear. I 
would need to communicate bi-directionally, i.e. from python to C and C to 
python. This example is inspired by the fact that we use the C func from 
Numerical recepies in C corresponding to lets say some optimization algorithm. 
So that we don't re-invent the wheel in python. So we call a C API from python. 
But in the optimization the objective function value must be returned from a 
python program, so from C API I should be able to call a python program and 
then integrate it with my optimization algorithm.

In this example I have tried to use "PyEval_CallObject()" within the 
"myOptim_system" C API function but it reports memory error. But when I call it 
from main() it doesn't report any errors.
Just wondering what do I do here?

-regards
Prav 
-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com

--
http://mail.python.org/mailman/listinfo/python-list


ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-24 Thread Praveen Gollakota
Hello,

In the ThreadPoolExecutor (TPE), is the callback always guaranteed to run in 
the same thread as the submitted function?

 For example, I tested this with the following code. I ran it many times and it 
seemed like `func` and `callback` always ran in the same thread.

import concurrent.futures
import random
import threading
import time

executor = concurrent.futures.ThreadPoolExecutor(max_workers=3)

def func(x):
time.sleep(random.random())
return threading.current_thread().name

def callback(future):
time.sleep(random.random())
x = future.result()
cur_thread = threading.current_thread().name
if (cur_thread != x):
print(cur_thread, x)

print('main thread: %s' % threading.current_thread())
for i in range(1):
future = executor.submit(func, i)
future.add_done_callback(callback)

However, it seemed to fail when I removed the `time.sleep(random.random())` 
statements, i.e. at least a few `func` functions and `callbacks` **did not** 
run in the same thread. 

For a project that I am working on, the callback must always run on the same 
thread as the submitted function, so I wanted to be sure that this is 
guaranteed by TPE. (And also the results of the test without the random sleep 
seemed puzzling).

I looked at the source code for executors (see 
https://hg.python.org/cpython/file/6d44906344f4/Lib/concurrent/futures/_base.py#l297)
 and it does not seem like we switch the thread to the main thread before we 
run the callback. But just wanted to be sure. 

Any insight would be appreciated!

Thanks,
Praveen
-- 
https://mail.python.org/mailman/listinfo/python-list


Struggling with python-daemon and subprocess module to work together

2014-10-21 Thread Praveen Kumar
Hi,

I am writing a very basic server side application[0] which get data
from a client and create a virtual machine using provided data and
also tells client about what's going on during *virt-install* command
execution. Previously this basic server is executed using *openvt* but
I thought it would be nice to have a daemon process for it and used
python-daemon.

Issue I am facing is after some time server will stop sending data to
client which suppose to happen in #120 and get error message "Cannot
run interactive console without a controlling TTY" . I am not able to
figure out issue is occurred due to module or I missed something
during daemon initialization.



[0] http://fpaste.org/143455/

-- 
Praveen Kumar
http://fedoraproject.org/wiki/User:Kumarpraveen
http://fedoraproject.org/
http://kumar-pravin.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-list


AIX - Python - db2.py

2007-09-20 Thread Shilavantar, Praveen
ggregate members.
"_db2_module.c", line 71.11: 1506-045 (S) Undeclared identifier
SQL_REAL.
"_db2_module.c", line 71.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 72.11: 1506-045 (S) Undeclared identifier
SQL_SMALLINT.
"_db2_module.c", line 72.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 73.11: 1506-045 (S) Undeclared identifier
SQL_TYPE_TIME.
"_db2_module.c", line 73.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 74.11: 1506-045 (S) Undeclared identifier
SQL_TYPE_TIMESTAMP.
"_db2_module.c", line 74.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 75.11: 1506-045 (S) Undeclared identifier
SQL_VARCHAR.
"_db2_module.c", line 75.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 76.11: 1506-045 (S) Undeclared identifier
SQL_VARBINARY.
"_db2_module.c", line 76.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 77.11: 1506-045 (S) Undeclared identifier
SQL_VARGRAPHIC.
"_db2_module.c", line 77.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 78.11: 1506-045 (S) Undeclared identifier
SQL_DATALINK.
"_db2_module.c", line 78.33: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 79.14: 1506-026 (S) Number of initializers cannot
be greater than the number of aggregate members.
"_db2_module.c", line 82.7: 1506-282 (S) The type of the parameters must
be specified in a prototype.
"_db2_module.c", line 90.11: 1506-045 (S) Undeclared identifier
SQL_SUCCESS.
"_db2_module.c", line 91.11: 1506-045 (S) Undeclared identifier
SQL_SUCCESS_WITH_INFO.
"_db2_module.c", line 92.11: 1506-045 (S) Undeclared identifier
SQL_ERROR.
"_db2_module.c", line 93.11: 1506-045 (S) Undeclared identifier
SQL_INVALID_HANDLE.
"_db2_module.c", line 94.11: 1506-045 (S) Undeclared identifier
SQL_NO_DATA_FOUND.
"_db2_module.c", line 95.11: 1506-045 (S) Undeclared identifier
SQL_STILL_EXECUTING.
"_db2_module.c", line 96.11: 1506-045 (S) Undeclared identifier
SQL_NEED_DATA.
"_db2_module.c", line 100.27: 1506-275 (S) Unexpected text SQLRETURN
encountered.
"_db2_module.c", line 150.9: 1506-046 (S) Syntax error.
"_db2_module.c", line 154.33: 1506-045 (S) Undeclared identifier
SQL_MAX_DSN_LENGTH.
"_db2_module.c", line 154.33: 1506-195 (S) Integral constant expression
with a value greater than zero is required.
"_db2_module.c", line 177.19: 1506-282 (S) The type of the parameters
must be specified in a prototype.
"_db2_module.c", line 178.12: 1506-282 (S) The type of the parameters
must be specified in a prototype.
"_db2_module.c", line 179.12: 1506-282 (S) The type of the parameters
must be specified in a prototype.
"_db2_module.c", line 212.9: 1506-046 (S) Syntax error.
"_db2_module.c", line 221.9: 1506-046 (S) Syntax error.
"_db2_module.c", line 237.9: 1506-046 (S) Syntax error.
"_db2_module.c", line 256.9: 1506-046 (S) Syntax error.
"_db2_module.c", line 305.39: 1506-046 (S) Syntax error.
"_db2_module.c", line 327.25: 1506-275 (S) Unexpected text rc
encountered.
"_db2_module.c", line 329.14: 1506-045 (S) Undeclared identifier rc.
"_db2_module.c", line 343.25: 1506-275 (S) Unexpected text rc
encountered.
"_db2_module.c", line 345.14: 1506-045 (S) Undeclared identifier rc.
"_db2_module.c", line 398.35: 1506-022 (S) "hstmt" is not a member of
"struct {...}".
"_db2_module.c", line 398.42: 1506-045 (S) Undeclared identifier
SQL_HANDLE_STMT.
"_db2_module.c", line 434.35: 1506-022 (S) "hstmt" is not a member of
"struct {...}".
"_db2_module.c", line 434.42: 1506-045 (S) Undeclared identifier
SQL_HANDLE_STMT.
"_db2_module.c", line 455.35: 1506-022 (S) "hdbc" is not a member of
"struct {...}".
"_db2_module.c", line 455.41: 1506-045 (S) Undeclared identifier
SQL_HANDLE_DBC.
"_db2_module.c", line 480.27: 1506-275 (S) Unexpected text handle
encountered.
"_db2_module.c", line 480.47: 1506-275 (S) Unexpected text handleType
encountered.
"_db2_module.c", line 482.25: 1506-277 (S) Syntax error: possible
missing ';' or ','?
"_db2_module.c", line 482.9: 

Is there any way to use python scripts in mainframe environment?

2007-12-06 Thread Kolipaka, Praveen

Is there any way to use python scripts in mainframe environment?


Regards,

Praveen KK
Sr.Software Engineer

 Hyderabad | India.



-- 
http://mail.python.org/mailman/listinfo/python-list

Re: finding contents from string

2010-02-16 Thread Praveen Boppana
It looks like you want to extract the query parameters from standard url's. 
There is a standard Python module to accomplish this:

http://www.python.org/doc/2.5.2/lib/module-urlparse.html




From: danin 
To: python-list@python.org
Sent: Tue, 16 February, 2010 4:13:09 PM
Subject: finding contents from string

Hi all,
I am looking for particular solution. I am having one string
say:
string- "http://maps.google.co.in/maps/ms?
hl=en&ie=UTF8&msa=0&msid=106178526636832397420.00047fb46fa8d02481f09&ll=20.730428,86.456909&spn=2.178194,3.526611&z=8
"
  and from this string  i need to extract value
-20.730428,86.456909. These value are dynamic so i cant use filter. So
can anyone please tell me about how to do this.
-- 
http://mail.python.org/mailman/listinfo/python-list



  Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/-- 
http://mail.python.org/mailman/listinfo/python-list


Issues download 2.4 python (for windows) msi

2009-06-11 Thread Praveen Kariyanahalli
Hi

I am having issues downloading any msi prior to the 3.X version. All of them
appear to be truncated. My old scripts dont compile on the later versions.
Can someone please fix this ASAP ?

Thanks
-Praveen
-- 
http://mail.python.org/mailman/listinfo/python-list


Calling the C API from Python and Python program from same C API - bidirectional

2005-03-16 Thread Praveen, Tayal (IE10)
Hi Guys,

I am having problems in the following C API program where myOtim_system is
callable from python function. The module is listed below - 

static PyObject *
myOptim_system(PyObject *self, PyObject *args)
{
const char *command;
double u0, v0, u1, v1, u2, v2, u3, v3;
int sts;

/* variables */
PyObject *pstr, *pmod, *pdict, *pfunc, *pargs;
char * cstr;
char *dummy = "Test";
char *x = "x = ";


if (!PyArg_ParseTuple(args, "s", &command))
return NULL;

/* convert them to the doubles */
sscanf(command, "%lf %lf %lf %lf %lf %lf %lf %lf", &u0, &v0,
&u1, &v1, &u2, &v2, &u3, &v3);

sts = (int) (u0+v0+u1+v1+u2+v2+u3+v3);

/* trying to call the python program from C */
/*
The module name is test2_module and the function name is
cv_calc_func
- get test2_module.cv_calc_func
*/
pmod = PyImport_ImportModule("test2_module");
pdict = PyModule_GetDict(pmod);

/* convert to the PyObject */
pfunc = PyObject_GetAttrString(pmod, "cv_calc_func");
pargs =  Py_BuildValue("s", dummy);
pstr = PyEval_CallObject(pfunc, pargs);

PyArg_Parse(pstr, "s", &cstr);
printf("%s\n", cstr);

Py_DECREF(pmod);
Py_DECREF(pstr);
Py_DECREF(pfunc);
Py_DECREF(pargs);


return Py_BuildValue("i", sts);

}

In the same module I am trying to call the python program from C API. That
python program is called test2_module.py. It is listed below - 

import string

message = 'Hi I am here'

def cv_calc_func(dummy):
s = "warning" + `dummy`
return s


-
It contains a method called cv_calc_func(). So now the idea must me clear. I
would need to communicate bi-directionally, i.e. from python to C and C to
python. This example is inspired by the fact that we use the C func from
Numerical recepies in C corresponding to lets say some optimization
algorithm. So that we don't re-invent the wheel in python. So we call a C
API from python. But in the optimization the objective function value must
be returned from a python program, so from C API I should be able to call a
python program and then integrate it with my optimization algorithm.

In this example I have tried to use "PyEval_CallObject()" within the
"myOptim_system" C API function but it reports memory error. But when I call
it from main() it doesn't report any errors.
Just wondering what do I do here?

-regards
Prav 


-- 
http://mail.python.org/mailman/listinfo/python-list


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
Hi Thomas and team,

It's worked In non-admin privileges after put the file in path at the first
on environmental path variables, but with admin privileges it doesn't work
though. Showing same error, as I mentioned earlier.



Kind regards,
Sincerely,
Praveen Kumar
Mob: +91 9515531643

On Sun, 9 Mar 2025, 09:03 Praveen Kumar, 
wrote:

> Hi Thomas
>
> No, I wasn't installed by admin privileges and I'm not running as a
> non-admin, regardless I tried running with admin and non-admin privileges,
> however the issue still persisted.
>
> Kind regards,
> Sincerely,
> Praveen Kumar
> Mob: +91 9515531643
>
> On Sun, 9 Mar 2025, 03:52 Thomas Passin via Python-list, <
> python-list@python.org> wrote:
>
>> On 3/8/2025 5:29 AM, Praveen Kumar via Python-list wrote:
>> > Hi Python community and members,
>> >
>> > I hope this email finds you well, I want you to be assisted in resolving
>> > this following issue. kindly look at the below concern,
>> >
>> > """I’m running into an error where I get a 'This app can’t run on your
>> PC'
>> > pop-up with (Access is Denied error) whenever I try to run the Python
>> > version (python --version) or run python.exe in the Command Prompt on
>> > Windows 11."""
>> >
>> >
>> > *Here’s what I’ve tried so far:*
>> >
>> > *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.)
>> >
>> > ***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\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 apps interference whether it is
>> causing
>> > this error, and I saw a couple of python.exe files in this folder
>> contains
>> > 0KB size then I thought these were corrupted and after I tried deleting
>> > these files, later I re-checked in cmd, however the issue persisted.
>> refer
>> > to the following error for your further reference.
>> >
>> >
>> >
>> > *https://i.sstatic.net/6koOnZBM.png
>> > <https://i.sstatic.net/6koOnZBM.png>https://i.sstatic.net/65JC9FuB.png
>> > <https://i.sstatic.net/65JC9FuB.png>*
>> >
>> > * Ran the Command Prompt as an administrator.
>> >
>> > *Tried multiple other troubleshooting steps, but none of them worked.
>> >
>> > Despite these efforts, the issue persists. Could someone please help me
>> > resolve this?
>> >
>> > Extending my request you to kindly help me out of this error and give me
>> > the root cause of this problem.
>> >
>> >
>> > *Kind regards, *
>> >
>> > *Sincerely,*
>> >
>> > *Praveen Kumar*
>> >
>> > *Mob: *+91 9515531643
>>
>> It sounds like you installed Python as an admin but are trying to run it
>> as a non-admin user.
>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


"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
Hi Python community and members,

I hope this email finds you well, I want you to be assisted in resolving
this following issue. kindly look at the below concern,

"""I’m running into an error where I get a 'This app can’t run on your PC'
pop-up with (Access is Denied error) whenever I try to run the Python
version (python --version) or run python.exe in the Command Prompt on
Windows 11."""


*Here’s what I’ve tried so far:*

*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.)

***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\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 apps interference whether it is causing
this error, and I saw a couple of python.exe files in this folder contains
0KB size then I thought these were corrupted and after I tried deleting
these files, later I re-checked in cmd, however the issue persisted. refer
to the following error for your further reference.



*https://i.sstatic.net/6koOnZBM.png
<https://i.sstatic.net/6koOnZBM.png>https://i.sstatic.net/65JC9FuB.png
<https://i.sstatic.net/65JC9FuB.png>*

* Ran the Command Prompt as an administrator.

*Tried multiple other troubleshooting steps, but none of them worked.

Despite these efforts, the issue persists. Could someone please help me
resolve this?

Extending my request you to kindly help me out of this error and give me
the root cause of this problem.


*Kind regards, *

*Sincerely,*

*Praveen Kumar*

*Mob: *+91 9515531643
-- 
https://mail.python.org/mailman/listinfo/python-list


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
Hi Thomas

No, I wasn't installed by admin privileges and I'm not running as a
non-admin, regardless I tried running with admin and non-admin privileges,
however the issue still persisted.

Kind regards,
Sincerely,
Praveen Kumar
Mob: +91 9515531643

On Sun, 9 Mar 2025, 03:52 Thomas Passin via Python-list, <
python-list@python.org> wrote:

> On 3/8/2025 5:29 AM, Praveen Kumar via Python-list wrote:
> > Hi Python community and members,
> >
> > I hope this email finds you well, I want you to be assisted in resolving
> > this following issue. kindly look at the below concern,
> >
> > """I’m running into an error where I get a 'This app can’t run on your
> PC'
> > pop-up with (Access is Denied error) whenever I try to run the Python
> > version (python --version) or run python.exe in the Command Prompt on
> > Windows 11."""
> >
> >
> > *Here’s what I’ve tried so far:*
> >
> > *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.)
> >
> > ***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\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 apps interference whether it is
> causing
> > this error, and I saw a couple of python.exe files in this folder
> contains
> > 0KB size then I thought these were corrupted and after I tried deleting
> > these files, later I re-checked in cmd, however the issue persisted.
> refer
> > to the following error for your further reference.
> >
> >
> >
> > *https://i.sstatic.net/6koOnZBM.png
> > <https://i.sstatic.net/6koOnZBM.png>https://i.sstatic.net/65JC9FuB.png
> > <https://i.sstatic.net/65JC9FuB.png>*
> >
> > * Ran the Command Prompt as an administrator.
> >
> > *Tried multiple other troubleshooting steps, but none of them worked.
> >
> > Despite these efforts, the issue persists. Could someone please help me
> > resolve this?
> >
> > Extending my request you to kindly help me out of this error and give me
> > the root cause of this problem.
> >
> >
> > *Kind regards, *
> >
> > *Sincerely,*
> >
> > *Praveen Kumar*
> >
> > *Mob: *+91 9515531643
>
> It sounds like you installed Python as an admin but are trying to run it
> as a non-admin user.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


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 python.exe and
python do evoke the cited error.


Kind regards,
Praveen

On Sun, 9 Mar 2025, 17:56 Thomas Passin via Python-list, <
python-list@python.org> wrote:

> On 3/8/2025 10:47 PM, Praveen Kumar wrote:
> > Hi Thomas and team,
> >
> > It's worked In non-admin privileges after put the file in path at the
> > first on environmental path variables, but with admin privileges it
> > doesn't work though. Showing same error, as I mentioned earlier.
>
> 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?
>
> >
> > Kind regards,
> > Sincerely,
> > Praveen Kumar
> > Mob: +91 9515531643
> >
> > On Sun, 9 Mar 2025, 09:03 Praveen Kumar,
> >  > <mailto:thitanpraveenkumar...@gmail.com>> wrote:
> >
> > Hi Thomas
> >
> > No, I wasn't installed by admin privileges and I'm not running as a
> > non-admin, regardless I tried running with admin and non-admin
> > privileges, however the issue still persisted.
> >
> > Kind regards,
> > Sincerely,
> > Praveen Kumar
> > Mob: +91 9515531643
> >
> > On Sun, 9 Mar 2025, 03:52 Thomas Passin via Python-list,  > l...@python.org <mailto:python-list@python.org>> wrote:
> >
> > On 3/8/2025 5:29 AM, Praveen Kumar via Python-list wrote:
> >  > Hi Python community and members,
> >  >
> >  > I hope this email finds you well, I want you to be assisted
> > in resolving
> >  > this following issue. kindly look at the below concern,
> >  >
> >  > """I’m running into an error where I get a 'This app can’t
> > run on your PC'
> >  > pop-up with (Access is Denied error) whenever I try to run
> > the Python
> >  > version (python --version) or run python.exe in the Command
> > Prompt on
> >  > Windows 11."""
> >  >
> >  >
> >  > *Here’s what I’ve tried so far:*
> >  >
> >  > *Uninstalled python software from the apps settings and
> > reinstalled python
> >  > software from the official python.org <http://python.org>
> site
> >  >
> >  > *Added 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:
> >
>  \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 apps interference whether
> > it is causing
> >  > this error, and I saw a couple of python.exe files in this
> > folder contains
> >  > 0KB size then I thought these were corrupted and after I
> > tried deleting
> >  > these files, later I re-checked in cmd, however the issue
> > persisted. refer
> >  > to the following error for your further reference.
> >  >
> >  >
> >  >
> >  > *https://i.sstatic.net/6koOnZBM.png  > i.sstatic.net/6koOnZBM.png>
> >  > <https://i.sstatic.net/6koOnZBM.png  > i.sstatic.net/6koOnZBM.png>>https://i.sstatic.net/65JC9FuB.png
> > <https://i.sstatic.net/65JC9FuB.png>
> >  > <https://i.sstatic.net/65JC9FuB.png  > i.sstatic.net/65JC9FuB.png>>*
> >  >
> >  > * Ran the Comm

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 running
python and python --version with admin and all those executables, anyway it
works really well.

(Finally The all issues stand resolved.)

Thank you for support matt and team,

I'm really thankful for your attention to this matter.



Kind regards,
Praveen

On Mon, 10 Mar 2025, 20:42 Praveen Kumar, 
wrote:

> 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 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 are
>> changing the system paths, that location is the one to use. But if
>> that's the location that the system links Python.File to, it should
>> launch without a problem. Maybe you should remove the path steps you
>> added previously and see if that clears up the problem.
>>
>> First, though, try to run python using the absolute path you have just
>> found.
>>
>> BTW, it's always a good idea to run pip using the python install that
>> you will be running.  So if "python" runs the right version, then invoke
>> pip this way:
>>
>> python -m pip
>>
>> If you use the launcher, then:
>>
>> py -m pip
>>
>> This will make sure you use the version of pip that goes with your
>> version of python, just in case there are other versions somewhere on
>> the computer.
>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


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\AppData\Local\Programs\Python\Python313\python.exe"
>
> Is that an approved location for executables?
>
> --
> Gilmeh
>
> Even bytes get lonely for a little bit.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


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 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 are
> changing the system paths, that location is the one to use. But if
> that's the location that the system links Python.File to, it should
> launch without a problem. Maybe you should remove the path steps you
> added previously and see if that clears up the problem.
>
> First, though, try to run python using the absolute path you have just
> found.
>
> BTW, it's always a good idea to run pip using the python install that
> you will be running.  So if "python" runs the right version, then invoke
> pip this way:
>
> python -m pip
>
> If you use the launcher, then:
>
> py -m pip
>
> This will make sure you use the version of pip that goes with your
> version of python, just in case there are other versions somewhere on
> the computer.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list