Re: [Python] Risolto. Re: Qualcuno usa ipython come interprete?

2024-03-14 Per discussione Carlo Miron
Il giorno gio 14 mar 2024 alle ore 10:32 Gabriele Battaglia
 ha scritto:
>
> ...di nuovo, buongiorno a tutti ed a Carlo M in particolare.
>
> Ho risolto.

Grande!

> Mancava la libreria pickleshare che, chissà per quale strano motto del
> destino, non era stata installata fra le molte dipendenze di ipython.
>
> Grazie.
> Gabry.
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Qualcuno usa ipython come interprete?

2024-03-14 Per discussione Carlo Miron
Ciao Gabriele

Il giorno gio 14 mar 2024 alle ore 08:23 Gabriele Battaglia
 ha scritto:
>
> Se sì, continuate a leggere please, altrimenti, tuffo doppio carpiato
> nel cestino.

Uso IPython 8.21.0 su Python 3.12.2 (su linux)

> [...]
> E' un problema mio?

Qui si comporta come previsto

```py
cm@heap:~
$ ipython
Python 3.12.2 (main, Feb 11 2024, 21:08:54) [GCC 13.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.21.0 -- An enhanced Interactive Python. Type '?' for help.
>>> a=88
time: 2.99 ms (started: 2024-03-14 08:51:23 +01:00)
>>> %store a
Stored 'a' (int)
time: 1.23 ms (started: 2024-03-14 08:51:32 +01:00)
>>> %store
Stored variables and their in-db values:
a -> 88
time: 1.54 ms (started: 2024-03-14 08:51:38 +01:00)
>>>^D
cm@heap:~
$ ipython
Python 3.12.2 (main, Feb 11 2024, 21:08:54) [GCC 13.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.21.0 -- An enhanced Interactive Python. Type '?' for help.
>>> a
NameError: name 'a' is not defined

time: 3.06 ms (started: 2024-03-14 08:52:09 +01:00)
>>> %store
Stored variables and their in-db values:
a -> 88
time: 1.48 ms (started: 2024-03-14 08:52:32 +01:00)
>>> %store -r
time: 9.51 ms (started: 2024-03-14 08:52:42 +01:00)
>>> a
88
time: 4.5 ms (started: 2024-03-14 08:52:45 +01:00)
```

Non saprei dirti cosa potrebbe essere successo nel tuo caso; se
perdere il valore delle tue variabili persistenti non è un problema,
potresti provare a cancellare i file contenuti nella subdirectory
`db/autorestore` all'interno della configurzione di ipython. Nel mio
caso,

```sh
cm@heap:~
$ ls -lh ~/.ipython/profile_default/db/autorestore
total 4.0K
-rw-rw-r-- 1 cm cm 5 Mar 14 08:51 a
```

HTH,
㎝

-- 
 THE -WARE LICENSE (Revision ㊷):
 wrote this . As long as you retain this notice you can
do whatever you want with this stuff. If we meet some day, and you
think this stuff is worth it, you can buy me a  in return. — Carlo
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


[Python] Qualcuno usa ipython come interprete?

2024-03-14 Per discussione Gabriele Battaglia
Se sì, continuate a leggere please, altrimenti, tuffo doppio carpiato 
nel cestino.



Python 3.11.8, win11, ipython 8.22.2


Magic function Store:

a=88

%store a


sembra andare.

Poi

%store per vedere le variabili salvate:

File 
~\AppData\Local\Programs\Python\Python311\Lib\site-packages\IPython\extensions\storemagic.py:161

, in StoreMagics.store(self, parameter_s)
159 # run without arguments -> list variables & values
160 elif not args:
--> 161 vars = db.keys('autorestore/*')
162 vars.sort()
163 if vars:

AttributeError: 'PickleShareDB' object has no attribute 'keys'

In [4]:


E stessa cosa con tutti gli altri switcher che ho provato, -r -d eccetera.


E' un problema mio?


Grazie mille.

Gabry.

--
Gabriele Battaglia (IZ4APU)
--... ...--  -.. .  .. --.. - .- .--. ..-  - ..-  . .
Sent from my Giant Desktop PC

___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python