| Reference | Downloads | Github

Ordering Psychopy Code


I am just wondering if there are any strict guidelines for the ordering of code in Pscyhopy?

My current code is set up a bit like this:

  1. Imports

  2. Set up GUI

  3. Set up Stimulus i.e. win, textstim, text to be used throughout experiment, etc

  4. Functions

  5. Setting up trials

  6. Practice Experiment

  7. Real Experiment

Should the text that will be displayed throughout the experiment be place right before the bit of code that draws the text to the window? Or is the way I’ve done it fine?

Thanks for any help! Sorry, bit new to psychopy.

There’s no rules on that, no - as long as you define the text before you draw it :wink:

If what you’re concerned about is readability, then the only rule is that it should be accessible to others. I’ve found that splitting functions out into different files and making an import statement helps.

Thank you!

Was just hoping I wasn’t going completely off track.

By the way, this may not be the right place to ask this, but do you know much about following a career in programming?

I am somewhat proficient in Python, and would like to continue on as a programmer. However, I have no idea where to start making money with programming, or whether it’s even worth me trying considering that I only know one language.

I don’t know anything about it as a career, I’m afraid. I use programming for research purposes only. But it is a very adaptable skill, and python is a very sought-after language, so I think you probably could find a career in it.

I recommend researching career paths of people who use python. One source I can recommend is the Talk python to me podcast, which features interviews with people who work with python. A surprising amount of them were scientists, so I’m sure you could find a way in :slight_smile:

Thank You!

I will take a look at the podcast