#๐Ÿ”’ I need help getting my script to run properly for a raspberry pi 4 project.

40 messages ยท Page 1 of 1 (latest)

sacred patioBOT
#

@wheat mason

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wheat mason
#

why was my message deleted?

latent galleon
#

because it was too big

#

!paste

sacred patioBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

wheat mason
#

hmm, text wasn't long... I had two attachments that was the code and an image. Are those the issue?

latent galleon
#

yeah

ocean nimbus
#

can't send attachments either

#

except for imagea

wheat mason
#

alright. Do I need to delete this and try the question again then with just the codeblock and explanation?

latent galleon
# sacred patio

u can continue here just paste ur code in these and write ur explaination

wheat mason
#

DESCRIPTION: My project uses a raspberry pi, a button attached using a GPIO board, a recording and listening device attached via USB, and of course python script to run the program. someone pushes the button and records a message. The next person that hears the message replies to it, and the game continues. When a user pushes the button, they will hear instructions on what to do. then the most recent message is played and a 'beep' noise indicating it's time for them to record their response. They then hang up the phone and the process starts over.

#

I have appx 60% of the script written but the program is not functioning well, so I am asking for help.

#

that's the code.

ocean nimbus
#

you've got a bunch of functions but you don't run them

#

unless you're running this from a different file

#

no mvm the try block confused me

#

can you say what's the problem?

#

what's not working

#

is it the button, the recording device, something else?

wheat mason
#

button works, recording and playback audio both work.

#

the primary issue (among others) is that I can't get the whole program to restart itself if the button is pushed at any time.

#

here's a flowchart I'm using for the whole project as a plan

ocean nimbus
#

you can run the program and a function that handles the button on 2 different threads

#

that way u can stop the program while recording audio for example

wheat mason
#

I don't necessarily want any part of the program, recording, playback or otherwise to continue if the button is pressed. I want the whole thing to start over from the beginning.

covert cave
#

Your while True is blocked while recording so button checks or max length check are not getting done

wheat mason
#

Do you by chance have the code snippet to fix that? I'm a novice at this stuff

covert cave
#

As DORON said put something in another thread

wheat mason
#

so, I'm not even sure what another thread is. I'm a complete novice at this stuff and had ChatGPT help me get this far. Honestly, I would like to just hire someone to finish the code since it 's not my forte. Is there a place on this discord where I can request help on a project for pay?

ocean nimbus
#

I'm not sure if that's ok with the mods... but this community has many people who are willing to help for free

#

your post just kinda fell through the cracks

#

you can try to post again with more specific questions and people will help u

#

also maybe try asking at #microcontrollers as well

sacred patioBOT
#

9. Do not offer or ask for paid work of any kind.

indigo arch
#

Nope. You can try fiverr or upwork or something like that.

sacred patioBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.