# Python methods for BlinkStickPro/Square

**URL:** <https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126>\
**Category:** Support\
**Created:** [February 26, 2015, 11:23am UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126 "2015-02-26T11:23:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arturr](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@arturr](https://forums.blinkstick.com/u/arturr)\
**Post date:** [February 26, 2015, 11:23am UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126/1 "2015-02-26T11:23:38Z")

</div>

Hi

Sorry for newbie questions, but I’m new to python and blinkstick - I’m using Blinkstick Square on Windows 7 / python 2.79 and can’t call any of BlinkStickPro class methods, like these were not imported at all, returning ‘no attribute’ errors.

I would also like to be able to control all LEDs on BlinkStickSquare at the same time, not individually (having the enclousure makes it larger pixel) - like set range of indexes 0-7 for channel of choice instead of having 8 lines of code. Maybe there is another way to achieve this? Will it also work for blink/pulse/morph methods?

Thanks,  
Artur

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 26, 2015, 11:59am UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126/2 "2015-02-26T11:59:46Z")

</div>

Not sure why BlinkStickPro class does not work for you. Could you please post the code here?

If you want to light up all LEDs at once, you don’t need to use the BlinkStickPro class. Just find the first blinkstick and set mode to 3 via set\_mode(3) command. You only need to do this once as BlinkStick remembers the mode even when you unplug it.

Now every time you send basic color without any index or channel with Python using set\_color method, all LEDs will light up at the same time. All blink, pulse and morph features will work with all LEDs at the same time. For example:

```python
from blinkstick import blinkstick

led = blinkstick.find_first()

led.set_mode(3) # you can omit this command after you run it once

led.set_color(name="red") # all LEDs should light up red

```

---

<div class="post-metadata">

**Author:** ![arturr](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@arturr](https://forums.blinkstick.com/u/arturr)\
**Post date:** [February 26, 2015, 9:12pm UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126/3 "2015-02-26T21:12:52Z")

</div>

Thanks for your reply. Now it makes more sense to set mode to 3, didn’t even know there was more than 0,1,2 modes [BlinkStick | BlinkStick Pro Modes](https://www.blinkstick.com/help/tutorials/blinkstick-pro-modes)

When I’m trying to run the code from your post I get the following:

> ```
> C:\Python27\Scripts\bs>set3.py
> 
> ```
> 
> Traceback (most recent call last):  
> File “C:\Python27\Scripts\bs\set3.py”, line 5, in   
> led.set\_mode(3) # you can omit this command after you run it once  
> File “C:\Python27\lib\site-packages\blinkstick\blinkstick.py”, line 493, in set\_mode  
> self.device.ctrl\_transfer(0x20, 0x9, 0x0004, 0, control\_string)  
> AttributeError: ‘HidDevice’ object has no attribute ‘ctrl\_transfer’

> C:\Python27\Scripts\bs\>

Am I missing something?

I can set colors just fine and blinkstick lights up…

EDIT: I think I found the answer: [Control NeoMatrix with BlinkStickPro and Python - #3 by soeren](https://forums.blinkstick.com/t/control-neomatrix-with-blinkstickpro-and-python/97/3)

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 26, 2015, 10:50pm UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126/4 "2015-02-26T22:50:04Z")

</div>

Yes, that’s the problem. I’ll push a new version of BlinkStick Python package in a bit which has this problem sorted out and includes some other minor fixes. Seems to be stable enough for a new version release.

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 26, 2015, 10:59pm UTC](https://forums.blinkstick.com/t/python-methods-for-blinkstickpro-square/126/5 "2015-02-26T22:59:42Z")

</div>

All done. You can now run the following command to upgrade to 1.1.7:

```bash
pip install --upgrade blinkstick

```
