Re: venv and executing other python programs

2022-02-14 Thread Barry Scott
> On 15 Feb 2022, at 05:35, Mirko via Python-list > wrote: > > Hi, > > I have recently started using venv for my hobby-programming. There > is an annoying problem. Since venv modifies $PATH, python programs > that use the "#!/usr/bin/env python" variant of the hashbang often > fail since the

Re: venv and executing other python programs

2022-02-14 Thread Reto
On Tue, Feb 15, 2022 at 06:35:18AM +0100, Mirko via Python-list wrote: > How to people here deal with that? Don't activate the venv for those programs then? The point of a venv is that you only enter it when you actually want that specific python stack. Get yourself a terminal that can either mul

Re: Saving/exporting plots from Jupyter-labs?

2022-02-14 Thread Reto
On Mon, Feb 14, 2022 at 08:54:01PM +, Martin Schöön wrote: > 1) In notebooks I can save a plot by right-clicking on it and do > save image as. In Jupyter-lab that does not work and so far I > have not been able to figure out how to do it. Yes, I have looked > in the documentation. Shift + righ

venv and executing other python programs

2022-02-14 Thread Mirko via Python-list
Hi, I have recently started using venv for my hobby-programming. There is an annoying problem. Since venv modifies $PATH, python programs that use the "#!/usr/bin/env python" variant of the hashbang often fail since their additional modules aren't install inside in venv. How to people here deal w

Re: C API - How to return a Dictionary as a Dictionary type

2022-02-14 Thread Jen Kris via Python-list
Yes, that works.  This is my first day with C API dictionaries.  Now that you've explained it, it makes perfect sense.  Thanks much.  Jen Feb 14, 2022, 17:24 by ros...@gmail.com: > On Tue, 15 Feb 2022 at 12:07, Jen Kris via Python-list > wrote: > >> >> I created a dictionary with the Python

Re: C API - How to return a Dictionary as a Dictionary type

2022-02-14 Thread Chris Angelico
On Tue, 15 Feb 2022 at 12:07, Jen Kris via Python-list wrote: > > I created a dictionary with the Python C API and assigned two keys and values: > > PyObject* this_dict = PyDict_New(); > const char *key = "key1"; > char *val = "data_01"; > PyObject* val_p = PyUnicode_FromString(val); > int r = PyD

C API - How to return a Dictionary as a Dictionary type

2022-02-14 Thread Jen Kris via Python-list
I created a dictionary with the Python C API and assigned two keys and values: PyObject* this_dict = PyDict_New();  const char *key = "key1"; char *val = "data_01";  PyObject* val_p = PyUnicode_FromString(val);  int r = PyDict_SetItemString(this_dict, key, val_p);  // Add another k-v pair key = "

Saving/exporting plots from Jupyter-labs?

2022-02-14 Thread Martin Schöön
I have used Jupyter notebooks for some time now. I am not a heavy or advanced user. I find the notebook format a nice way to create python documents. Now I am trying out Jupyter-labs. I like it. I have two head- scratchers for now: 1) In notebooks I can save a plot by right-clicking on it and do