Hello everyone,
I was wondering if it is possible to run an mp3 / mp4 file when i run my script.
(Just for fun.) And if this is possible, how can i achieve this?
Regards,
Daan
Hello everyone,
I was wondering if it is possible to run an mp3 / mp4 file when i run my script.
(Just for fun.) And if this is possible, how can i achieve this?
Regards,
Daan
Have a look at this thread.
Hello @Daan,
You can pretty easily use Dynamo to open up files using some simple Python
import os
def playSomething(path):
from os import startfile
startfile(path)
OUT = playSomething(IN[0])
The graph is as simple as this!
I tested with a sample from here: https://file-examples.com/index.php/sample-video-files/sample-mp4-files/
Tried this on my side, I’m getting this error :
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named os
I’m using Revit 2020.1
and Dynamo 2.2.1
for this What set-up do you have?
Hi @Revit_Noob
Just add below few lines before import os, that will work in any version of revit and any version of dynamo.
import sys
path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(path)
Revit 2017 / Dynamo 1.3.4