Unable to .show scores in Music21 - music21

I'm working in Jupyter Notebook. I've installed music21, musescore, set the xml path as below:
us = environment.UserSettings()
us['musicxmlPath'] ='Applications/musescore.app'
I've also run config, and see that musescore is being detected by music21. However, when I use the show method, I get the following error:
SubConverterFileIOException: png file of xml not found. Or file >999 pages?
Any help is appreciated. Thanks!

An .app file is a directory. Inside the MuseScore.app directory is a bin directory and a file called mscore -- that's the actual name in the path. It'd be much easier to run python -m music21.configure and let the automatic configuration program take care of it.

Are you sure that file is exist?
try changing 'Applications/musescore.app' to '/Applications/musescore.app'
Hope that helps

I found a answer from here wrote by GaetanBaert,It works well and now I can use show method.
He said that "you should change os.system(musescoreRun) line 891 of subconverters.py by subprocess.run(musescoreRun). You need also to import subprocess at the start of subconverters.py."

Related

How to use yarpgen random C program generator?

I am new here.
Could anyone help me, on how to use yarpgen to generate a random c program.
I tried running the run_gen.py script that I saw in the yarpgen readme.
But, I got a warning and an error like this:
Warning: please set YARPGEN_HOME envirnoment variable to point to test generator path, using C:\Users\..\Python\Python36-32\yarpgen-master for now
and
File C:\Users\..\Python\Python36-32\yarpgen-master\yarpgen wasn't found
Any help would be much appreciated.
Thanks in advance !
The warning very likely points to the source of the problem, run_gen does not know where the other parts of yarpgen are installed.
First, note down the directory you installed/copied yarpgen to.
Then open a command shell. Type this:
cd <where run_gen.py is>
set YARPGEN_HOME=<the path you just noted down>
run_gen.py
If this works, you can write a batch script, that contains the set YARPGEN_HOME=... line and then calls run_gen.py. If the directory where run_gen.py is located is not on your PATH environment variable, call run_gen.py with the full absolute path in the batch script:
set YARPGEN_HOME=<the path to yarpgen>
python3 <absolute_path_to>\run_gen.py
Then you can call your batch script.
You may have to adjust the python3 command depending on the executable Python 3 installed on your machine (it may be just python on Windows).
When I tried this after building with cygwin, I noticed that I had to rename yarpgen.exe to yarpgen to make it work.

Get shareable link form Mega.nz in command line

I'm trying to work with mega.nz via command line (batch file), use for it megatools
https://github.com/megous/megatools
Sync work fine, download work fine, but i can't found how to generate shareable link to file on mega. Is there any possible way?
May be use Megacmd, or something else?
https://github.com/meganz/MEGAcmd
Can't find command to share file...
put YouUploadFileName
export -a YouUploadFileName
https://github.com/meganz/MEGAcmd/blob/master/UserGuide.md

How to get file name when file change is observed via watch_file

I am currently facing an issue which I don't know how to fix. I got the following Julia code:
while true
print(watch_file("test"))
end
So this should get me all the file changes in the directory named "test". At least on windows.
Now thats all well and good, and it kinda works, at least for creating a file or moving a file to that directory. This is an example of what I get:
("New Textfile.txt",Base.FileEvent(true,false,false))
But when I delete or rename that file, I don't get the filename of the file deleted or renamed.
("",Base.FileEvent(true,false,false))
Is there a different method/function I can get the filename with, even when the file is deleted or renamed? Or even better, a way that archives this and is cross-platform-compatible? Any help appreciated.
EDIT: If you could give me an alternative that supports recursive monitoring, that would be even better.
In Linux, Julia 0.4.5 and 0.4.3 watch_file returns file name always. It is a very platform-dependent feature (like in Node.js https://nodejs.org/api/fs.html#fs_caveats) and only manual polling can be truly platform-independent solution.

how to Change the file Attribute from read-only to read/write using Python?

I have a bunch of files which have read-only status. It is not possible to change the status manual so I was thinking of a code that I could say change the status of all the files in one folder from read-only. However, I can't find the right coding. Is the python helpful for this case?
Thanks in advance,
I don't see the need of python here. You could simply type the below written command in the terminal:
chmod -R 777 foldername (777 is just for example)
If you want to stick with python, type the following in the python interpreter:
import subprocess
subprocess.call(['chmod', '-R', '777', 'foldername'])

Working with SASS in Adobe Dreamweaver

I am trying to figure out how to start using SASS files in Dreamweaver.
The error message I get when trying to open is: "Can't find a valid editor for this file extension".
All my SASS files are valid and open well with Eclipse.
Thanks in advance to anyone who could post any tips on this one.
OK. I have found the answer.
All you need to do is open Dreamweaver, go to Edit> Preferences> File Types / Editors
and in the top text box ("Open in code view:") listing various files extensions add .sass.
That's it. Rest is down to haml and compass.
I hope this post will help anyone having similar problem.
To go even further and make Dreamweaver treat .scss files as .css files (applying code coloring and indentation), just follow the instructions on this Adobe TechNote
The visual28 link no longer works. Here is a quick rundown from here
DreamweaverCS?/Configuration/DocumentTypes/MMDocumentTypes.xml
If Windows change winfileextension="css" to winfileextension="css,scss"
If Mac change macfileextension="css" to macfileextension="css,scss"
For older Dreamweaver:
http://www.visual28.com/articles/less-scss-syntax-highlighting-in-dreamweaver
For Dreamweaver 5.5 and above:
http://forums.adobe.com/thread/861133
instead to go in your installation directory to find the 'MMDocumentTypes.xml' file, GO to
C:\Users\\AppData\Roaming\Adobe\Dreamweaver
CS5?\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml
and then find winfileextension="css" and change it to winfileextension="css,scss"...
That would definitely work..
Update to the latest version of Dreamweaver
Ensure that ‘Show hidden files’ is enabled in Control Panel > Folder options
Open your user folder eg C:\users\Dylan\ replacing with your name
Then open AppData/Roaming/Adobe/Dreamweaver CS6/en_US/Configuration/
Open the file Extensions.txt
Replace the first line with the following:
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,LESS,SCSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG:All
Documents
Replace the following line:
CSS:Style Sheets
With
CSS,LESS,SCSS:Style Sheets
Save and exit the file
Go to the folder DocumentTypes
Open the file named MMDocumentTypes.xml
Replace the line beginning with:
=>documenttype id="CSS"
with
<documenttype id="CSS" internaltype="Text"
winfileextension="css,less,sass,scss" macfileextension="css"
file="Default.css" writebyteordermark="false" mimetype="text/css" >
Save and exit the file, and restart Dreamweaver
Syntax highlighting now works

Resources