# Python: help with create\_sequence

**URL:** <https://forum.logik.tv/t/python-help-with-create-sequence/8038>\
**Category:** Python\
**Tags:** sequence\
**Created:** [March 29, 2023, 3:40pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038 "2023-03-29T15:40:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cicero](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cicero](https://forum.logik.tv/u/cicero)\
**Post date:** [March 29, 2023, 3:40pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/1 "2023-03-29T15:40:05Z")

</div>

Hi, sorry but more beginner’s help with python needed please.

I’m trying to write a simple hook to create an empty sequence in an existing library. Then add extra tracks and versions, name the tracks etc, to follow house conventions.

Despite going through all the usual resources I can’t get the syntax right for the “create\_sequence” function. Exactly how does it all need to be arranged?

Also if I try to run it, nothing happens and the shell says  
_failed because of an error of type ‘Width should be even and between 24 and 16384.’_  
…even though I’m defining a width of 3840 and height of 2160.  
This may be because my syntax isn’t presenting the width value correctly… but then it’s formatted in the same way as earlier attributes, so if it’s the syntax, why isn’t the error showing on a previous line?

TIA!

[create\_online\_seq\_TEST.py](https://forum.logik.tv/uploads/short-url/znzFdNVJuNkHuHoec7jXunJjTjM.py) (1.2 KB)

---

<div class="post-metadata">

**Author:** ![knhn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/knhn/32/5635_2.png) [@knhn](https://forum.logik.tv/u/knhn)\
**Post date:** [March 29, 2023, 5:16pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/2 "2023-03-29T17:16:34Z")

</div>

I think you might be mixing Arguments and Attributes. Width & height are arguments that have to be passed to creation of the PySequence object using the PyLibrary method like `item.create_sequence(width=3840, height=2160)`. But then name is an attribute that could be changed after creation like you are doing there with `onlineSequence.name()`

---

<div class="post-metadata">

**Author:** ![knhn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/knhn/32/5635_2.png) [@knhn](https://forum.logik.tv/u/knhn)\
**Post date:** [March 29, 2023, 5:38pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/3 "2023-03-29T17:38:19Z")

</div>

Tested and working. No colour argument on my version of Flame, so commented out. And no nicknames present over here so changed to just project name.

[create\_online\_seq\_TEST.py](https://forum.logik.tv/uploads/short-url/wHbCaOIiCrVfc56jeqwMRg9dmgz.py) (1.0 KB)

---

<div class="post-metadata">

**Author:** ![cicero](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cicero](https://forum.logik.tv/u/cicero)\
**Post date:** [March 29, 2023, 6:16pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/4 "2023-03-29T18:16:52Z")

</div>

Thanks so much… brilliant.  
Yes you’re right, I’m still not clear on Arguments vs Attributes (as well as most other things). But this is great to help illustrate the difference.  
And I had a little bit of what @andymilkis calls Bracket Hell.

Thanks again.

---

<div class="post-metadata">

**Author:** ![fredwarren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/fredwarren/32/158_2.png) [@fredwarren](https://forum.logik.tv/u/fredwarren)\
**Post date:** [March 29, 2023, 8:45pm UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/5 "2023-03-29T20:45:26Z")

</div>

> [@cicero](#):
>
> I’m still not clear on Arguments vs Attributes

An attribute is something you can get and set.  
An argument is what you pass to a function to set one of its parameters.

**Attributes example**

In flame.batch.current\_node.get\_value().name = “New Name”, name is an attribute of a PyNode

**Argument example**

In flame.batch.create\_batch\_group() you can pass the following arguments: name, nb\_reels, nb\_shelf\_reels, reels, shelf\_reels, start\_frame and duration.

---

<div class="post-metadata">

**Author:** ![cicero](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cicero](https://forum.logik.tv/u/cicero)\
**Post date:** [March 30, 2023, 11:02am UTC](https://forum.logik.tv/t/python-help-with-create-sequence/8038/6 "2023-03-30T11:02:43Z")

</div>

Thanks for clarifying Fred.
