Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:51:54+00:00 2026-06-08T17:51:54+00:00

So after some trial and error, I think I have my math finally figured

  • 0

So after some trial and error, I think I have my math finally figured out correctly. Initially, I started this as a set of complex lists, but then found out that the array function is more suited to what I need.

Now that I have established the array, I get this new error:

EDIT:

Traceback (most recent call last):
  File "(stdin)", line 1, in (module)
  File "backandforth3.py", line 118, in (module)
    frames.insert((x+f), (archstartred[x]))
TypeError: list index out of range

As I frustratingly yell at the computer that all the data already is an integer, I spare my computer monitor and thought I’d try here. All the help on here so far has been fantastic.

Here’s how I generate the array and the data for the array: EDIT: Added the list generator to the program code as it seems to be generating non-integer values.

#List Generator

archstartred = []
archstartgrn = []
archstartblu = []

##Red List
for x in range (0, cursorsize):
    if len(archstartred) < cursorsize:archstartred.insert(0,cursred)

for x in range (0, (archnodes-cursorsize)):
    if len(archstartred) < archnodes:archstartred.append(backred)

##Green List
for x in range (0, cursorsize):
    if len(archstartgrn) < cursorsize:archstartgrn.insert(0,cursgrn)

for x in range (0, (archnodes-cursorsize)):
    if len(archstartgrn) < archnodes:archstartgrn.append(backgrn)

##Blue List
for x in range (0, cursorsize):
    if len(archstartblu) < cursorsize:archstartblu.insert(0,cursblu)

for x in range (0, (archnodes-cursorsize)):
    if len(archstartblu) < archnodes:archstartblu.append(backblu)


archstartred = [int(value) for value in archstartred]
archstartgrn = [int(value) for value in archstartgrn]
archstartblu = [int(value) for value in archstartblu]





#Frame Creation

from array import *

frames=array('i', (0 for i in range (0,workingframes*archnodes*3)))






#Frame Population

for f in range (0, workingframes):

    if f<=(workingframes/2):

        for x in range (0, (archnodes*3)):
            frames.pop(x+f)
            frames.insert((x+f), (archstartred[x]))
            frames.pop((x+f)+workingframes)
            frames.insert((x+f+workingframes), (archstartgrn[x]))
            frames.pop((x+f)+workingframes*2)
            frames.insert((x+f+workingframes*2), (archstartblu[x]))

        for y in range (0, nodesperframe):
            archstartred.pop()
            archstartgrn.pop()
            archstartblu.pop()
            archstartred.insert(0, backred)
            archstartgrn.insert(0, backgrn)
            archstartblu.insert(0, backblu)

    else:
        for y in range (0, nodesperframe):
            archstartred.pop(0)
            archstartgrn.pop(0)
            archstartblu.pop(0)
            archstartred.append(backred)
            archstartgrn.append(backgrn)
            archstartblu.append(backblu)

        for x in range (0, (archnodes*3)):
            frames.pop(x+f)
            frames.insert((x+f), (archstartred[x]))
            frames.pop((x+f)+workingframes)
            frames.insert((x+f+workingframes), (archstartgrn[x]))
            frames.pop((x+f)+workingframes*2)
            frames.insert((x+f+workingframes*2), (archstartblu[x]))

This is the same program I’ve been dealing with in my other posts. Basically, it’s to generate data for use in an RGB lighting system. This “simple” program will generate a back and forth effect using 2 colors. The other variables include length of time the effect takes, frame size (we use “Sequencers” to generate displays and you can vary the frame size in the sequencer), “cursor” size, etc.

Of course, once I figure out this effect, I’ll be able to make more complex effects based on mathematical formulas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:51:55+00:00Added an answer on June 8, 2026 at 5:51 pm

    To convert your list of integers in quotes ['255', '255', '255', '255', '0'] to int properly use this code (you were close):

    archstartred = [int(value) for value in archstartred]
    

    it will yield

    [255, 255, 255, 255, 0]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some trial and error (ok, just error) I figured out that c089b69c3d contained
After some trial and a lot of error, I have come to find out
After many cases of trial and error, I have concluded that the only solution
I could use some help. After a few frustrating days of trial and error,
After some recursive function I have an array: first iteration: Array ( [category_id] =>
I have a few some strange issues with my class after migrating from JDK5/Tomcat5
after adding adMob ads to my application, I have noticed some strange memory behaviour.
After some time researching and trying different things I still cannot get my @ExceptionHandler
After some desperate assistance regarding prototype.js on Magento. Please see the below product page
After some great help from Josh Mein with a Javascript Hide/Show menu, the menu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.