Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Importing a full experiment from PsychoPy as seamlessly as possible

Greetings, all!

I'm a newbie with OpenSesame working on a multi-site data-collection project. Most involved labs will be using an experiment coded up in PsychoPy3 (Builder v2021.2.3) in PsychoPy, but some want to be able to run the experiment entirely using OpenSesame. I was pleased to see that OpenSesame uses Psychopy in the backend, which should ease the process.

Given that we'd like the experiment to run exactly the same way on both platforms (following along with the same experimenter instruction script) and produce compatible output (as well as to save myself some time learning a new interface), ideally I'd be able to simply import the .py script generated by PsychoPy in its entirety into OpenSesame. It'd be great if we could retain everything, down to the organization of the initial prompts for subject number and other demographic information. It'd also be handy to retain the existing file structure (where the script can find the .xlsx file to pull in the word stimuli and spit out the output in the same format as in PsychoPy).

As a very clunky first attempt to do this, I tried creating a blank experiment in OpenSesame and popping in a new_inline_script and pasting in the full text of my .py code from PsychoPy. That got hung up on some of the very early lines of code (NameError: name '__file__' is not defined):

# Ensure that relative paths start from the same directory as this script

_thisDir = os.path.dirname(os.path.abspath(__file__))


If that were the only issue, I don't imagine it would be too bad to get everything up and running. But, given that this error cropped up so early on, I feared what was to come. I wish I had a programmer on hand (or the time) to start re-building the many thousands of lines of code, but I was hoping one or more of you might be able to provide some hacks to make the porting from PsychoPy as straightforward and painless as possible.

I've seen some other discussion posts here indicating that it may be necessary to to import some extra modules, based on error messages. That would be easy enough, if need be (especially if the experimenters don't need to install anything new, which we're trying to minimize). But might one of you point me to a quick-start way to handle the import to minimize the number of coding tweaks that would be necessary?

Apologies for the newbie/non-programmer question--and many thanks in advance for your suggestions :-).

Hope everyone is keeping well and safe out there,



  • Hi Justin,

    Without trying myself it will be hard to estimate whether this will be the only issue or whether there is going to be a long rat-tail of issues propagating down the sequence. However, I am mildly optimistic that most of the script should run fine, as I believe most of the problems should be linked to overhead stuff, like setting up paths, etc.

    So, I think it is worthwhile to attempt the migration to Opensesame. Especially if you are a little experienced with programming, you should be able to get somewhere. In case you get stuck, feel free to report back here and ask for help. (Then also with sharing your code, ideally).

    Hope this helps a bit,


    Buy Me A Coffee

  • Appreciate it, Eduard. I'll give it a try and be sure to post any snags that I can't work my way out of.

    If anyone else has some quick workarounds in the meantime, do feel free to post here, as well. I'd be most grateful.

    Much obliged everyone,


Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games