File: create.rst

package info (click to toggle)
python-loompy 3.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,316 kB
  • sloc: python: 3,152; sh: 63; makefile: 16
file content (24 lines) | stat: -rw-r--r-- 572 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
create (function)
=================

Create a new Loom file. 

.. autofunction:: loompy.create


In order to work with a newly created file you have to connect to it:

.. code:: python

  loompy.create("filename.loom", m, row_attrs, col_attrs)
  with loompy.connect("filename.loom") as ds:
      ....do something with ds
  # File closes automatically

Note: if you simply want to create the file, and not access it, there is no need to use a ``with`` statement:

.. code:: python

  loompy.create("filename.loom", m, row_attrs, col_attrs)

This will leave the file closed.