Re: A problem with opening a file

2020-11-29 Thread dn via Python-list
On 29/11/2020 20:56, Gabor Urban wrote: Hi, I am facing an issue I was not able to solve yet. I have a class saving messages to a file. The relevant code is: import OS if you're wanting the Python Standard Library, this should not be in upper-case import sys are these two imports

Re: How to run Jupyter notebook in command line and get full error message?

2020-11-29 Thread Skip Montanaro
> > My VPN keeps dropping and can not run Jupyter Notebook as it is. > You don't provide a lot of detail, but this seems similar to the kind of flaky networking we used to deal with in the Before Times. Simply connecting directly to a host over the Internet was often plagued by disconnects. For th

Re: ssl connection has been closed unexpectedly

2020-11-29 Thread Dieter Maurer
Shaozhong SHI wrote at 2020-11-28 23:29 +: >I keep getting the following error when I use engine = >create_engine(logging in details to postgres) >df.to_sql('table_name', and etc.) > > >OperationalError: (psycopg2.OperationalError) SSL connection has been >closed unexpectedly SSL works as foll

Re: A problem with opening a file

2020-11-29 Thread Dieter Maurer
Gabor Urban wrote at 2020-11-29 08:56 +0100: >I am facing an issue I was not able to solve yet. I have a class saving >messages to a file. The relevant code is: > > > >import OS >import sys > >class MxClass: > >def __init__(self, fName, fMode,): >self.fileName = fName >s

Re: numpy problem (follow up)

2020-11-29 Thread MRAB
On 2020-11-29 18:33, Dennis Lee Bieber wrote: On Sat, 28 Nov 2020 17:28:50 -0600, Larry Burford declaimed the following: when trying to run the tutorial program standardplot.py I get a msg that says my numpy won't pass a sanity check due to a problem in the Win runtime Wait for M

Re: numpy problem (follow up)

2020-11-29 Thread Malcolm
Hi https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy also has a numpy wheel 1.19.4+vanilla‑cp39‑cp39‑win_amd64.whl "Vanilla is a minimal distribution, which does not include any optimized BLAS libray or C runtime DLLs." Have not tried this. cheers Malcolm On 30/11/2020 7:19 am, MRAB wrote

Re: ssl connection has been closed unexpectedly

2020-11-29 Thread Dan Stromberg
What happens if you execute this from a shell prompt on a system with openssl installed? openssl s_client -connect host.com:443 (replacing host.com with your server's hostname and 443 with your port of interest) On Sat, Nov 28, 2020 at 3:30 PM Shaozhong SHI wrote: > Hi, > > I keep getting the

Re: filtering out warnings

2020-11-29 Thread Jason Friedman
> > The Box API is noisy ... very helpful for diagnosing, and yet for > production code I'd like less noise. > > I tried this: > > warnings.filterwarnings( > action='ignore', > # category=Warning, > # module=r'boxsdk.*' > ) > > but I still see this: > > WARNING:boxsdk.network.default_ne

A problem with opening a file -- again

2020-11-29 Thread Gabor Urban
Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: class Naplo: def __init__(self, pNeve, pMeret, pMode = 'a'): self.logNev = pNeve self.meret = pMeret

Re: A problem with opening a file -- again

2020-11-29 Thread Chris Angelico
On Mon, Nov 30, 2020 at 8:37 AM Gabor Urban wrote: > class Naplo: > def __del__(self): > if self.sor != 0: > if self.start: > trc = open(self.logNev,self.startMode) > else: > trc = open(self.logNev,self.mode) > for idx

Re: A problem with opening a file -- again

2020-11-29 Thread dn via Python-list
On 30/11/2020 10:36, Gabor Urban wrote: Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: Thanks = helpful +1 @Chris' response! Meantime, what happens if you start python, and ent

Re: A problem with opening a file -- again

2020-11-29 Thread Eryk Sun
On 11/29/20, Chris Angelico wrote: > > This seems like a really REALLY bad idea. You're putting a lot of work > into your __del__ function, and that's not getting called until > everything's shutting down. (Also, xrange doesn't exist, hence the > "exception ignored" thing.) > > Avoid putting this

Reading binary data with the CSV module

2020-11-29 Thread Jason Friedman
Using the Box API: print(source_file.content()) returns b'First Name,Last Name,Email Address,Company,Position,Connected On\nPeter,van (and more data, not pasted here) Trying to read it via: with io.TextIOWrapper(source_file.content(), encoding='utf-8') as text_file: reader = csv.DictRead

Re: Reading binary data with the CSV module

2020-11-29 Thread MRAB
On 2020-11-30 01:31, Jason Friedman wrote: Using the Box API: print(source_file.content()) returns b'First Name,Last Name,Email Address,Company,Position,Connected On\nPeter,van (and more data, not pasted here) Trying to read it via: with io.TextIOWrapper(source_file.content(), encoding=

Re: Reading binary data with the CSV module

2020-11-29 Thread Jason Friedman
> > csv.DictReader appears to be happy with a list of strings representing > the lines. > > Try this: > > contents = source_file.content() > > for row in csv.DictReader(contents.decode('utf-8').splitlines()): > print(row) > Works great, thank you! Question ... will this form potentially use l