python程序设计与实验

In this post, I will describe the existing free Python applications and libraries for creating experiments.  So far, I have only used PsychoPy but I plan to test most of them. At least the ones that seem to still be maintained. All applications and libraries are open-source which makes it possible to download the source code and add your own stuff to it.

在这篇文章中,我将描述现有的免费Python应用程序和库来创建实验。 到目前为止,我仅使用PsychoPy,但我计划测试其中的大多数。 至少那些似乎仍然得到维护的。 所有应用程序和库都是开源的,这使得下载源代码和向其中添加自己的东西成为可能。

实验建设者 (Experiment builders)

PsychoPy and OpenSesame are two applications for creating psychology, neuroscience, and psychophysics experiments. Both applications are free, open source, alternatives  to Presentation™ or e-Prime™. Judging by the number of citations in Google Scholar, PsychoPy seems to be the most frequently used.

PsychoPy和OpenSesame是创建心理学,神经科学和心理物理学实验的两个应用程序。 两种应用程序都是免费的,开源的,是Presentation™或e-Prime™的替代产品。 从Google Scholar中的引用次数来看,PsychoPy似乎是最常用的。

精神病学 (PsychoPy)

PsychoPy is simple to install and  is cross-platform (works on Linux, OS-X, and Windows).  It promises precision timing and it  has a lot of different types of stimuli ready to use.  An important aspect of PsychoPy is that if you prefer to write code you can do that using the Application Programming Interface (API). However, if you do not want to write code you can use the builder view. You can see PsychoPy – free software to use in Research for a more extensive post on PsychoPy. If you are interested in an example program you can have a look at  Sustained Attention Task In PsychoPy.

PsychoPy易于安装且跨平台(可在Linux,OS-X和Windows上运行)。 它保证了精确的计时,并且有许多不同类型的刺激可供使用。 PsychoPy的一个重要方面是,如果您喜欢编写代码,则可以使用应用程序编程接口(API)进行操作。 但是,如果您不想编写代码,则可以使用构建器视图。 您可以看到PsychoPy –可在Research中使用的免费软件,以获取有关PsychoPy的更广泛的文章。 如果您对示例程序感兴趣,可以查看PsychoPy中的Sustained Attention Task 。

Builder View of PsychoPy GUI
PsychoPy GUI的构建器视图

芝麻开门 (OpenSesame)

OpenSesame is also easy to install and  works on Linux, OS-X, Windows, and Android (both tablets, phones, and computers). OpenSesame is based on PsychoPy and the library Expyriment. As far as I can see you are not able to choose to write your own script (i.e., it does not have a coding interface). However, you are probably able to use your own editor and write a script. It is also possible to choose back-end (see About back-ends). That is, you can choose to use xpyriment (Expyriment), psycho (PsychoPy),  legacy, opengl, and droid. It seems that xpyriment has replaced the opengl back-end. Much like E-prime, it is possible to write in-line scripts when needed. One interesting option in OpenSesame is that you seem to be able to test your experiment using auto responses. Another interesting feature of OpenSesame is that you seem to be able to create your own plug-ins and extensions.

OpenSesame还易于安装,并且可在Linux,OS-X,Windows和Android(平板电脑,手机和计算机)上使用。 OpenSesame基于PsychoPy和库Expyriment。 据我所知,您不能选择编写自己的脚本(即,它没有编码接口)。 但是,您可能可以使用自己的编辑器并编写脚本。 也可以选择后端(请参阅关于后端 )。 也就是说,您可以选择使用xpyriment(Expyriment),psycho(PsychoPy),legacy,opengl和droid。 看来xpyriment已经取代了opengl后端。 与E-prime一样,可以在需要时编写内联脚本。 OpenSesame中一个有趣的选项是,您似乎可以使用自动响应来测试实验。 OpenSesame的另一个有趣的功能是您似乎能够创建自己的插件和扩展。

Experiment Builder OpenSesame
实验构建器OpenSesame

There are a lot of example experiments on both applications websites as well as in the interfaces. Furthermore, you can also find a lot of guides and tutorials on their websites. OpenSesames website also offer some standard tasks. For instance, you can find a Conjunctive Continuous Performance Task.

在应用程序网站和界面上都有很多示例实验。 此外,您还可以在他们的网站上找到很多指南和教程。 OpenSesames网站还提供一些标准任务。 例如,您可以找到一个连续性连续表现任务。

Python库 (Python Libraries)

报酬 (Expyriment)

Expyriment, The Vision Egg, and PyEPL are Python libraries. That is, while PsychoPy and OpenSesame offer graphical interfaces where you can create your experiment with minimal knowledge of Python programming the libraries requires you to write scripts. However, their aim seems to be to decrease scripting and seems to be relatively easy to use.

Expyriment,Vision Egg和PyEPL是Python库。 就是说,尽管PsychoPy和OpenSesame提供了图形界面,但您可以在其中使用Python编程的最少知识来创建实验,而库则需要您编写脚本。 但是,它们的目的似乎是减少脚本编写,并且似乎相对易于使用。

Expyriment is an open-source library and is, of course, also platform independent. Actually, this library is very promising since it also works on Android systems. This library takes cares of the presentation of stimuli. It can handle the recording of both input and output events, communication with other devices, and the collection and preprocessing of data. On the library’s website, it is stated that it suitable for researchers and students with little experience of programming.

Expyriment是一个开放源代码库,并且当然也是与平台无关的。 实际上,该库非常有前途,因为它也可以在Android系统上运行。 该库负责刺激的呈现。 它可以处理输入和输出事件的记录,与其他设备的通信以及数据的收集和预处理。 在图书馆的网站上说,它适合没有编程经验的研究人员和学生。

视觉蛋 (The Vision Egg)

The Vision Egg is a Python library. The purpose of the library seems to be the production of visual stimuli (the clue might be in its name). Judging from the library’s GitHub page, it has not been updated for roughly 3 years.

Vision Egg是一个Python库。 该库的目的似乎是视觉刺激的产生(线索可能就是它的名字)。 从库的GitHub页面来看,它大约三年没有更新。

PyEPL (PyEPL)

PyEPL (the Python Experiment-Programming Library) is the last Python library, I have found, for coding psychology experiments. PyEPL can be used to create both visual and auditory stimuli. It supports both manual (keyboard/joystick) and sound (microphone) input as responses.

我发现PyEPL(Python实验编程库)是最后一个用于对心理学实验进行编码的Python库。 PyEPL可用于创建视觉和听觉刺激。 它支持手动(键盘/操纵杆)和声音(麦克风)输入作为响应。

Note that for timing critical experiments it is probably wise to write your own scripts PsychoPy API or Expyriment.  This will let you use system specific (e.g., Linux specific if using Linux) settings and optimize your experiment based on the hardware available (see Garaizar & Vadillo, 2014 for tests and comparisons of PsychoPy, E-prime, and DMDX).

请注意,对于定时关键实验,编写自己的脚本PsychoPy API或Expyriment可能是明智的。 这将使您可以使用特定于系统的设置(例如,如果使用Linux,则为特定于Linux的设置),并根据可用的硬件优化实验(有关PsychoPy,E-prime和DMDX的测试和比较,请参阅Garaizar &Vadillo,2014年)。

To summarize,  PsychoPy seem to be the only application that offers both coding and builder interfaces. I am, therefore, suggesting that undergraduate students, as well as graduate students and researchers uses it. Naturally, that it is free and not dependent on windows also make it a really strong alternative to proprietary software such as E-prime and Presentation. However, this is true for all the Python based applications and libraries.  It might be worth end this post with noting that Python is also a free alternative to Matlab. Personally, I did find Python easier to learn compared to Matlab.

总而言之,PsychoPy似乎是唯一提供编码和构建器界面的应用程序。 因此,我建议本科生以及研究生和研究人员使用它。 自然,它是免费的并且不依赖于Windows,这也使其成为专有软件(例如E-prime和Presentation)的强大替代品。 但是,对于所有基于Python的应用程序和库都是如此。 值得一提的是,本文还是指出Python也是Matlab的免费替代品。 我个人确实发现,与Matlab相比,Python更易于学习。

相关文章: (Related posts:)

How to Install Psychopy on LMDE.

如何在LMDE上安装Psychopy。

Python script for trial randomization making use of PsychoPy’s TrialHandler.

利用PsychoPy的TrialHandler 进行随机试验的Python脚本 。

参考资料 (References)

Garaizar, P., & Vadillo, M. A. (2014). Accuracy and Precision of Visual Stimulus Timing in PsychoPy: No Timing Errors in Standard Usage. PLoS ONE, 9(11), e112033. http://doi.org/10.1371/journal.pone.0112033

Garaizar,P.&Vadillo,MA(2014)。 PsychoPy中视觉刺激计时的准确性和准确性:标准用法中没有计时错误。 公共科学图书馆,9(11),e112033。 http://doi.org/10.1371/journal.pone.0112033

Garaizar, P., Vadillo, M. A., López-de-Ipiña, D., & Matute, H. (2014). Measuring Software Timing Errors in the Presentation of Visual Stimuli in Cognitive Neuroscience Experiments. PLoS ONE, 9(1), e85108. http://doi.org/10.1371/journal.pone.0085108

Garaizar,P.,Vadillo,MA,López-de-Ipiña,D.,&Matute,H.(2014年)。 在认知神经科学实验中测量视觉刺激演示中的软件计时错误。 PLoS ONE,9(1),e85108。 http://doi.org/10.1371/journal.pone.0085108

Krause, F. & Lindemann, O. (2014). Expyriment: A Python library for cognitive and neuroscientific experiments. Behavior Research Methods, 46(2), 416-428. doi:10.3758/s13428-013-0390-6.

Krause,F.&Lindemann,O.(2014年)。 Expyriment:用于认知和神经科学实验的Python库。 行为研究方法,46(2),416-428。 doi:10.3758 / s13428-013-0390-6。

Mathôt, S., Schreij, D., & Theeuwes, J. (2012). OpenSesame: An open-source, graphical experiment builder for the social sciences. Behavior Research Methods, 44(2), 314-324. doi:10.3758/s13428-011-0168-7

Mathôt,S.,Schreij,D.和Theeuwes,J.(2012年)。 OpenSesame:社会科学的开源,图形化实验构建器。 行为研究方法,44(2),314-324。 doi:10.3758 / s13428-011-0168-7

Peirce, J. (2010). PsychoPy – Psychology software for Python. Integration The Vlsi Journal.

Peirce,J.(2010年)。 PsychoPy –适用于Python的心理学软件。 集成Vlsi Journal。

Peirce, J. W. (2007). PsychoPy-Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8–13. http://doi.org/10.1016/j.jneumeth.2006.11.017

Peirce,JW(2007)。 Python中的PsychoPy-Psychophysics软件。 神经科学方法杂志,162(1-2),8-13。 http://doi.org/10.1016/j.jneumeth.2006.11.017

翻译自: https://www.pybloggers.com/2015/12/python-apps-and-libraries-for-creating-experiments/

python程序设计与实验

python程序设计与实验_用于创建实验的Python应用程序和库相关推荐

  1. python新手入门教程思路-Python新手入门教程_教你怎么用Python做数据分析

    Python新手入门教程_教你怎么用Python做数据分析 跟大家讲了这么多期的Python教程,有小伙伴在学Python新手教程的时候说学Python比较复杂的地方就是资料太多了,比较复杂.很多网上 ...

  2. python程序设计课程设计_《Python程序设计》教学大纲.doc

    PAGE 理论课程教学大纲 <Python程序设计>教学大纲 课程编号: 总 学 时:64(其中,讲课:32:实验:32) 学 分:3 实践教学:0周 修读专业:地理信息系统.应用化学 大 ...

  3. python程序设计课程设计_《Python程序设计》课程教学大纲

    < python 程序设计>课程教学大纲 课程代码: 060132002 课程英文名称: Python Program Design 课程总学时: 32 讲课: 32 实验: 0 上机: ...

  4. python 申请内存空间、用于创建多维数组_python 申请内存空间,用于创建多维数组的实例...

    以三维数组为例 先申请1个一维数组空间: mat = [None]*d1 d1是第一维的长度. 再把mat中每个元素扩展为第二维的长度: for i in range(len(mat)): mat[i ...

  5. python程序设计重点_《Python程序设计》怎么样_目录_pdf在线阅读 - 课课家教育

    书籍介绍 本书通过阐述Python语言的基础知识,以及使用Python语言的实际开发应用实例,来介绍如何使用计算机进行问题求解.丰富的例子和习题展示了在真实世界中是如何使用计算机的.目前Python在 ...

  6. python程序设计怎么样-《Python程序设计》怎么样_目录_pdf在线阅读 - 课课家教育...

    书籍介绍 本书通过阐述Python语言的基础知识,以及使用Python语言的实际开发应用实例,来介绍如何使用计算机进行问题求解.丰富的例子和习题展示了在真实世界中是如何使用计算机的.目前Python在 ...

  7. python程序设计教材浅显易懂_这些python自学技巧,你不会?

    python自学,其实很简单. 其实python非常适合初学者入门.相比较其他不少主流编程语言,有更好的可读性,因此上手相对容易.自带的各种模块加上丰富的第三方模块,免去了很多"重复造轮子& ...

  8. 默认栅格大小为多少_用于创建空栅格的ST_MakeEmptyRaster函数

    官方文档地址: ST_MakeEmptyRaster​postgis.net 一.函数签名 二.描述 ST_MakeEmptyRaster用于创建一个空的没有像元值的栅格(没有波段),各个参数用于定义 ...

  9. 职教云python题和答案_智慧职教云课堂Python程序设计试题及答案

    智慧职教云课堂Python程序设计试题及答案 更多相关问题 [判断题]称取某样品 0. 0250g 进行分析,最后分析结果报告为 96.24(质量分数)是合理的. [单选题]3. Why does t ...

  10. 太阳电池板特性实验_太阳能电池特性实验讲义

    太阳能光伏电池实验讲义 一.实验目的 1 .了解 pn 结基本结构与工作原理: 2 .了解太阳能电池的基本结构,理解工作原理: 3 .掌握 pn 结的伏安特性及伏安特性对温度的依赖关系: 4 .掌握太 ...

最新文章

  1. ocr智能图文识别 tess4j 图文,验证码识别
  2. 科略教育——执行力的3W管理法
  3. python共享内存和分布式实现异步加载数据
  4. 机器学习02线性回归、多项式回归、正规方程
  5. 理解分布式id生成算法--雪花算法(SnowFlake)
  6. 【python教程入门学习】六、python中字符串的常用方法
  7. QGIS 3.4 3.6 另存栅格图层到GeoPackage出现覆盖问题 解决方案
  8. 计算机主机特点,计算机的五大特点是什么
  9. 54部经典国外动画片---送给70-80年代的朋友
  10. 华为手机更改系统默认字体
  11. java 异或表示状态
  12. Excel怎么批量删除开头文本
  13. 学习笔记(10):程序员的数学:微积分-常用导数(二):最常用到的技巧
  14. 3ds max 2020 材质编辑器
  15. php账单明细功能怎么实现,php 处理微信账单
  16. 解决h5中video标签返回流无法快进和后退的问题
  17. intellij idea 2016破解方法
  18. VDA6.5认证辅导,VDA6.5是VDA6中的第五部分用产品质量来确认质量能力
  19. .htaccess文件
  20. matlab奇异矩阵高效求逆,奇异矩阵求逆问题!!!

热门文章

  1. 如何在30天内拿下软考初级程序员?
  2. 已知两点坐标和三边长度,求三角形第三点的坐标
  3. 北京联通IPTV机顶盒管理密码
  4. Mysql8.0如何重置密码
  5. KBQA-Bert学习记录-CRF模型
  6. 三因素三水平正交表l9_正交试验在减水剂中的应用
  7. python连接hive--Pyhive
  8. ubuntu dock栏添加应用启动图标
  9. 如何用手机制作一寸或二寸证件照?
  10. 计算机邮件合并应用测试怎么做,四大实例干货:word邮件合并功能步骤详解教程...