Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:31:06+00:00 2026-06-01T06:31:06+00:00

In my previous question, Open a file from a specific program from python ,

  • 0

In my previous question, Open a file from a specific program from python, I found out how to use subprocess in order to open a program (Blender) — well, a specific .blend file — from a specific file path with this code.

import os
import subprocess

path = os.getcwd()
os.system("cd path/")
subprocess.check_call(["open", "-a", os.path.join(path, "blender.app"),"Import_mhx.blend"])

With the help of a guy at a forum, I wanted to use relative paths inside the .blend file, so I changed the code in this way (for Windows)

import os
import subprocess

# This should be the full path to your Blender executable.
blenderPath = "/cygdrive/c/Program Files/Blender Foundation/blender-2.62-release-windows32/blender.exe"

# This is the directory that you want to be your "current" directory when Blender starts
path1 = "/Users/user/Desktop/scenario/Blender"

# This makes makes it so your script is currently based at "path1"
os.chdir(path1)

subprocess.check_call([blenderPath, "Import_mhx.blend"])

and for Mac,

import os
import subprocess

path = os.getcwd()
os.system("cd path/")
print (path)
# This should be the full path to your Blender executable.
blenderPath = path + "/blender.app/Contents/macos/blender"

# This is the directory that you want to be your "current" directory when Blender starts
path1 = "/Users/user/Desktop/scenario/Blender"

# This makes makes it so your script is currently based at "path1"
os.chdir(path1)

subprocess.check_call([blenderPath, "Import_mhx.blend"])

Results:

  1. In Windows, it works fine.
  2. On Macs, the result is that the file is opened, but the program seems not to be opened. It is quite strange, I think.

Questions:

  1. Is there any extension that I should place for the blender (UNIX executable file) in order for it to open?
  2. Is there any other way that I can do it in order to open the program correctly, but also be able to use relative paths inside .blend files?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:31:07+00:00Added an answer on June 1, 2026 at 6:31 am
    import os
    import subprocess
    
    blenderPath = "./blender.app/Contents/MacOS/blender"
    
    path1 = "./"
    
    os.chdir(path1)
    
    subprocess.check_call([ blenderPath, "Animation.blend"])
    

    Both blender opens perfectly and relative paths inside .blend file work ok:)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Concerning my previous question , I found out that maven can't really output jboss
This question follows on from a previous question, that has raised a further issue.
Continuing from my previous question , is there a comprehensive document that lists all
I am continuing from my previous question I need a way to export my
This is a little related to my previous question Solaris: Mounting a file system
This is a separate problem lingering from a previous question I asked here on
Following on from my previous question [link text][1] , I have a new problem.
In my previous question I asked about the problem with encoding and open pragma
This program want to read from a file. the content in the file is
From my previous question I have solved how to display information from MS Access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.