Re: How come logging.error writes to a file, but not logging.debug or logging.info?

2020-03-28 Thread Dan Campbell
I probably won't need to do that, in this case.  But good advice, in other
contexts ; I'll put it in the pim, for further reference, thanks.



On Fri, Mar 27, 2020 at 7:09 PM Cameron Simpson 
wrote:

> On 27Mar2020 16:18, Dan Campbell  wrote:
> >Got it.  I had to set the minimum level, in the basic config, thus:
> >
> >logging.basicConfig( filename = "whatthe.log", level=logging.INFO )
>
> Good, you've found the table of predefined logging levels in the module
> docs then?
>
> You'll notice that they are spaced apart by 10; in principle one can
> choose levels between them. Kind of irrelevant if nothing logs at such
> an intermediate level, but...
>
> For example, I define for myself a TRACE value between INFO and WARNING,
> and a trace() call which logs at that level (like the predefined
> warning() function logs at logging.WARNING level). I often find my info
> calls are too verbose, and the warnings are only for badness, so I have
> a kind of intermediate call for "high level" far less frequent logs.
>
> Cheers,
> Cameron Simpson 
>
-- 
https://mail.python.org/mailman/listinfo/python-list


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 and attachments are not allowed.



--
Terry Jan Reedy

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


mport pytorch fails on my windows 10 PC

2020-03-28 Thread joseph pareti
apologies for asking here a presumably off-topic question:

I have installed pytorch using (miniconda3) the following command:

*conda install pytorch torchvision cpuonly -c pytorch*

In the jupyter notebook, the 'import torch' fails:

*ModuleNotFoundError: No module named 'torch._C'*

I am not sure if having several python versions on the system could cause
the issue:

./Users/joepareti/Miniconda3/envs/myenv/python.exe
./Users/joepareti/Miniconda3/envs/myenv1/python.exe
./Users/joepareti/Miniconda3/pkgs/python-3.6.8-h9f7ef89_0/python.exe
./Users/joepareti/Miniconda3/pkgs/python-3.6.8-h9f7ef89_1/python.exe
./Users/joepareti/Miniconda3/pkgs/python-3.7.1-h8c8aaf0_6/python.exe
./Users/joepareti/Miniconda3/python.exe
-- 
Regards,
Joseph Pareti - Artificial Intelligence consultant
Joseph Pareti's AI Consulting Services
https://www.joepareti54-ai.com/
cell +49 1520 1600 209
cell +39 339 797 0644
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create an Excel app that runs Python?

2020-03-28 Thread Paolo G. Cantore

Am 25.03.20 um 15:21 schrieb [email protected]:



Hello Paolo,

Thanks for your reply, indeed now I'm thinking on building a web app, do you 
have any suggestions for this? I am thinking of using Tkinter, the method that 
you describe using HTML is also using Javascript?

Kind Regards
Felipe


Hello Felipe,

only bare HTML is needed, no Tkinter, no JavaScript.

Have a look in the attached prototype. For use in your Intranet some 
definitions have to be done by your IT people and the script run mode 
has to be changed too.


So far it is tested on my machine (Linux, Python3.6). The only 
dependancy is bottle.


Maybe it's suited for your needs.

Kind Regards
Paolo
--
https://mail.python.org/mailman/listinfo/python-list


How to cover connection exception errors, and exit

2020-03-28 Thread dcwhatthe
Hi,

I've tried urllib, requests, and some other options.  But I haven't found a way 
to trap certain urls that aren't possible to connect from, outside the office.  
In those cases, I need to just output an error.


So, the following code will cover the 404s and similar errors for most of the 
problem IPs and urls.  But for these particular problem urls, while debugging 
it keeps transferring control to adapters.py, and outputting 

 requests.exceptions.ConnectionError: 
 HTTPSConnectionPool(host='xxx.state.gov', port=443): Max retries 
 exceeded with url: /xxx/xxx/xxx(Caused by 
 NewConnectionError(': Failed to establish a new connection: [Errno 11001] 
 getaddrinfo failed'))


How do I trap this error, without invoking adapters.py?


I've tried many things, but the most recent is this code, from the web:



try:
r = requests.get(url,timeout=3)
r.raise_for_status()
except requests.exceptions.HTTPError as errh:
print ("Http Error:",errh)
except requests.exceptions.ConnectionError as errc:
print ("Error Connecting:",errc)
except requests.exceptions.Timeout as errt:
print ("Timeout Error:",errt)
except requests.exceptions.RequestException as err:
print ("OOps: Something Else",err)


It seems like the error should be trapped by the exception above 
requests.exceptions.ConnectionError, but instead its' hitting adapters.py.


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


Re: mport pytorch fails on my windows 10 PC

2020-03-28 Thread Souvik Dutta
Yes having two versions of python causes that problem.

On Sat, 28 Mar, 2020, 11:53 pm joseph pareti,  wrote:

> apologies for asking here a presumably off-topic question:
>
> I have installed pytorch using (miniconda3) the following command:
>
> *conda install pytorch torchvision cpuonly -c pytorch*
>
> In the jupyter notebook, the 'import torch' fails:
>
> *ModuleNotFoundError: No module named 'torch._C'*
>
> I am not sure if having several python versions on the system could cause
> the issue:
>
> ./Users/joepareti/Miniconda3/envs/myenv/python.exe
> ./Users/joepareti/Miniconda3/envs/myenv1/python.exe
> ./Users/joepareti/Miniconda3/pkgs/python-3.6.8-h9f7ef89_0/python.exe
> ./Users/joepareti/Miniconda3/pkgs/python-3.6.8-h9f7ef89_1/python.exe
> ./Users/joepareti/Miniconda3/pkgs/python-3.7.1-h8c8aaf0_6/python.exe
> ./Users/joepareti/Miniconda3/python.exe
> --
> Regards,
> Joseph Pareti - Artificial Intelligence consultant
> Joseph Pareti's AI Consulting Services
> https://www.joepareti54-ai.com/
> cell +49 1520 1600 209
> cell +39 339 797 0644
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


NEED ASSISTANCE WITH PYTHON CLASS

2020-03-28 Thread gentleman . for . ever . and . ever
Hi, I need help with coding assignments (python to be exact) in school. I am 
willing to pay for your attention by the hour. Please email me at 
[email protected] if you’re interested. Please only reach out if you’re 
not a beginner. Trying to avoid the blind being led by the blind. Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


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, hence cannot use it to 
uninstall.  Images and attachments are not allowed.





In that case install that same version of Python to the same location 
using msi - then remove it.

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