Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何同时使用两张iPysheet。附着细胞心房肌_Python_Jupyter Notebook_Ipywidgets - Fatal编程技术网

Python 如何同时使用两张iPysheet。附着细胞心房肌

Python 如何同时使用两张iPysheet。附着细胞心房肌,python,jupyter-notebook,ipywidgets,Python,Jupyter Notebook,Ipywidgets,我想在一个特定的笔记本中呈现两张iPysheet 例如,假设我有: mysheet1 = ipysheet.sheet(rows=3, columns=4) mysheet2 = ipysheet.sheet(rows=3, columns=4) 如果我现在这样做: cell1 = ipysheet.cell(0, 0, 'Hello') cell2 = ipysheet.cell(2, 0, 'World') cell_value = ipysheet.cell(2,2, 42.) 表2中

我想在一个特定的笔记本中呈现两张iPysheet 例如,假设我有:

mysheet1 = ipysheet.sheet(rows=3, columns=4)
mysheet2 = ipysheet.sheet(rows=3, columns=4)
如果我现在这样做:

cell1 = ipysheet.cell(0, 0, 'Hello')
cell2 = ipysheet.cell(2, 0, 'World')
cell_value = ipysheet.cell(2,2, 42.)
表2中的值已更改。 这真的很奇怪。为什么创建的最后一张图纸会被修改

为什么跟踪不起作用

cell1 = mysheet1.cell(0, 0, 'Hello')
也不是

我会假设,因为在Pyton ipysheet中all是一个对象,所以它也是一个对象,但它的“cell”不是mysheet1的atribute

有什么合理的解释吗


这实际上可以扩展到列atributes。

这是因为,
单元格
根据。一种对我有效的方法是将
Cell
作为元组分配给第一个工作表的属性
cells
。就是

from ipysheet import sheet, current, cell, Cell

s1 = sheet(rows=3, columns=4)
s2 = sheet(rows=3, columns=4)

cell1 = cell(0, 0, 'Hello', )
cell2 = cell(2, 0, 'World', )

s1.cells = (Cell(column_end=0, column_start=0, row_end=1, row_start=1, type='text', value='Hello'), Cell(column_end=0, column_start=0, row_end=0, row_start=0, type='text', value='Hello'))
还有一个


但我认为这样分配细胞是不现实的,如果先使用
s1
然后再使用
s2

会更容易一些,我看不出如何以一种实用的方式在voila中呈现几个ipysheet,这些ipysheet的数据会根据其他ipyWidget(即用户交互)而变化。@Berlines是的,用户所做的所有更改都会转到
current()
工作表。因此,目前似乎没有切实可行的方法。
from ipysheet import sheet, current, cell, Cell

s1 = sheet(rows=3, columns=4)
s2 = sheet(rows=3, columns=4)

cell1 = cell(0, 0, 'Hello', )
cell2 = cell(2, 0, 'World', )

s1.cells = (Cell(column_end=0, column_start=0, row_end=1, row_start=1, type='text', value='Hello'), Cell(column_end=0, column_start=0, row_end=0, row_start=0, type='text', value='Hello'))