# Scroll Phat - Scroll Text

**URL:** <https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329>\
**Category:** Support\
**Created:** [December 7, 2015, 12:46pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329 "2015-12-07T12:46:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![damienpattrick](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@damienpattrick](https://forums.pimoroni.com/u/damienpattrick)\
**Post date:** [December 7, 2015, 12:46pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/1 "2015-12-07T12:46:01Z")

</div>

Hi,

Having a bit of bother getting the simple text example working.

It compiles and runs fine but no text on the Phat, the shell shows the following:  
python [simple-text-scroll.py](http://simple-text-scroll.py) “message” press CTRL-C to exit

The Phat works fine with all the other examples but i cant figure this one out.  
Im am guessing that the required text goes in the speak marks as shown below?

Any help appreciated:

```
import scrollphat
import sys
import time

if len(sys.argv) != 2:
        print("\nusage: python simple-text-scroll.py \"message\" \npress CTRL-C to exit\n")
        sys.exit(0)

scrollphat.write_string(sys.argv[1] + "HELLO WORLD ")

while True:
        scrollphat.scroll()
        time.sleep(0.1)
```

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [December 7, 2015, 12:54pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/2 "2015-12-07T12:54:42Z")

</div>

Ooh, how are you running it? You should do something like:

```auto
python simple-text-scroll.py "Hello this is my text!"

```

It accepts the text string on the command line. The `" "` at the end of the `write_string` line only serves to pad it with spaces so it wraps nicely.

The `len(sys.argv) != 2:` line is checking to see how many arguments are being passed to the script. By default all scripts get their name passed as the first argument, but this script is expecting at least 2 arguments- the second being the text string to display.

---

<div class="post-metadata">

**Author:** ![damienpattrick](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@damienpattrick](https://forums.pimoroni.com/u/damienpattrick)\
**Post date:** [December 7, 2015, 1:20pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/3 "2015-12-07T13:20:39Z")

</div>

Thanks for the quick response.

I was look to put the text in the code itself.  
I was also running it from the python shell IDEL rather than the command line.

All make sense now.

Thanks =)

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [December 7, 2015, 1:22pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/4 "2015-12-07T13:22:33Z")

</div>

Sorry for our lack of documentation so far. I’m in a mad panic to get everything up to speed.

You could modify the example to do what you’re looking for, like so:

```python
import scrollphat
import time

scrollphat.write_string("HELLO WORLD ")

while True:
        scrollphat.scroll()
        time.sleep(0.1)

```

---

<div class="post-metadata">

**Author:** ![Ariane60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@Ariane60](https://forums.pimoroni.com/u/Ariane60)\
**Post date:** [December 30, 2015, 2:06pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/5 "2015-12-30T14:06:54Z")

</div>

I made _exactly_ the same mistake/s as above :)

However, I now have the same problem from the command line that I was having in Idle:

**ImportError: No module named scrollphat**

I’ve updated the pi and I tried apt-get install python, but it says I have the latest version.

I’m sure I’m doing something really obvious wrong-please help!

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [December 30, 2015, 2:20pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/6 "2015-12-30T14:20:41Z")

</div>

Please run

```
curl -sS get.pimoroni.com/scrollphat | bash

```

… it will reinstall the scrollphat library if required if you answer ‘yes’ to all questions.

---

<div class="post-metadata">

**Author:** ![Ariane60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@Ariane60](https://forums.pimoroni.com/u/Ariane60)\
**Post date:** [December 30, 2015, 2:56pm UTC](https://forums.pimoroni.com/t/scroll-phat-scroll-text/1329/7 "2015-12-30T14:56:07Z")

</div>

Thanks for the quick reply. Running now…and many Ooooooohs in this household :)
