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 6550619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:14:15+00:00 2026-05-25T12:14:15+00:00

I have two separate subprocess calls in a django app, each in a different

  • 0

I have two separate subprocess calls in a django app, each in a different view. The first calls the dcraw image conversion tool to take an uploaded raw image and convert it into a tiff. (The .tiff output is usually nine times larger than the input, e.g. 8mb image yields 72mb tiff.)

pdcraw = subprocess.Popen(dcraw_args, stdout=None, stderr=None)
pdcraw.communicate()

My second subprocess calls a matlab script which processes the tiff and outputs relevant data files and images. This call usually takes a good 15-20 seconds when I run the script myself.

result = subprocess.Popen(matlab_args, stdout=None, stderr=None)
result.communicate()

My problem: with both of these subprocess calls, I have to reload the view manually for them to actually run. The rest of the code “around” them runs fine. Any thoughts on how I can avoid this? I’m wondering if it’s some sort of cache issue, as I have been able to get the first subprocess to run a couple times before it starts requiring a reload. Your insight is greatly appreciated! Thank you in advance.

Things I’ve tried:

  • Inserting time.sleep around the subprocesses, thinking maybe it’s cut short. Doesn’t work.
  • Using pipes instead of None for stdout. I figure I should use None though, since I don’t need to read the results from the command (they just output images to a directory specified in the args).
  • Cursing at it. Still in progress.
  • 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-05-25T12:14:16+00:00Added an answer on May 25, 2026 at 12:14 pm

    because the whole idea of a subprocess is being asynchronous, it won’t be ready when your view is parsed to the browser.

    Perhaps you make an Ajax request to check the status of the progress, and as soon as files are available, they can then be send by the server.

    Or you work with WebSockets, which can send any data as soon as it is available, omitting the need for extra requests while guaranteeing a superquick response.

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

Sidebar

Related Questions

I have two separate arrays - $array_before and $array_after . Each array can have
I have two separate applications, a c# MVC app and a CMS (Ektron) app.
I have two forms in my rails app. They both exist in separate tabs
I have two separate processes, each with it's own database connection, inserting product records
I have two separate .NET applications, one server and another WinForms. WinForms app has
We have two separate families of sites (example.com and offspring [example.co.uk etc.] and different.com
I have two separate meshes I want to merge with different materials using the
I have two separate java maven projects: one is my web app itself and
I have two separate appliations running on the separate infrastructure. app-a is using MYSQL
I have two separate elements setup which appear on different parts of the DOM

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.