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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:40:29+00:00 2026-05-24T07:40:29+00:00

im makeing something like a check system before run so it meets the requirements

  • 0

im makeing something like a check system before run so it meets the requirements with python.
heres my code so far;

def checksystem():
    installednode = os.popen('node ' + srctocoffeecompiler + ' -v')
    // version 1.1.1
    print installednode.read()

i can print the version but is there a better way to check its installed with a version higher then 1.0.x ? heres my code so far to do this.

version = installednode.read()
if installednode.read() == 'CoffeeScript version 1.1.1':
    // the code
    // or split the string with space then get the last array
    // check if its more then 1.1.1 or 111 ( dots removed )

*edit ive read the docs about useing subprocess.Popen, that is maybe better, not sure. im still geting errors no such file exist.

*edit2

pn = subprocess.Popen(['node','-v'], stdout = subprocess.PIPE, stdin = subprocess.PIPE, stderr = subprocess.PIPE)
print "NodeJS version: " + pn.read()

ok, somehow i can call it, but i cant read its output return, same with java

pj = subprocess.Popen(['java','-version'], stdout = subprocess.PIPE, stdin = subprocess.PIPE, stderr = subprocess.PIPE)
print "JAVA: " + pj.read()

thanks!

  • 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-24T07:40:30+00:00Added an answer on May 24, 2026 at 7:40 am

    I would split the version string, the comparison is pretty simple if you use lists:

    >>> vers1 = '1.0.1'.split('.')
    >>> vers2 = '1.0.0'.split('.')
    >>> vers1
    ['1', '0', '1']
    >>> vers2
    ['1', '0', '0']
    >>> vers1 > vers2
    True
    >>> vers2 > vers1
    False
    >>> 
    

    Here’s a JavaScript alternative:

    >>> var vers1 = "1.0.1".split('.');
    >>> var vers2 = "1.0.0".split('.');
    >>> vers1
    ["1", "0", "1"]
    >>> vers2
    ["1", "0", "0"]
    >>> vers1 > vers2
    true
    >>> vers2 > vers1
    false
    

    It’s pretty much the same 😉

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

Sidebar

Related Questions

I was thinking about making something like Linq for Lua, and I have a
I'm making a Google Maps-like application for a course at my Uni (not something
When making software, specially games, those resources like graphics and sounds are something freaky
Ultimate Goal Is to make something like Magento offers - basically a logic builder,
I have something like this: uses MSXML2_TLB; type TDocumentType = (dtOrder, dtInvoice, dtStatus, dtError);
I'm working with Java and JSP. I have to create something like a promotion
I would like to create an expiration system for my website, where a user
When we have something like this: interface ISomething<U,V> { ... } class Something<U,V> :
rather than use something like yepnope.js is there a simple method/decent plugin that can
There are some 3rd party in my code, like the World Magnetic Model or

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.