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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:36:53+00:00 2026-05-22T02:36:53+00:00

This is related to my previous post here . Running the actual script, I

  • 0

This is related to my previous post here. Running the actual script, I output the result like this:

[root@test_vm /]# torque_history.py -m 4
Job Id       User      Real User       Start Date      S  End Date        Exec Host    Queue  
-----------  --------  --------------  --------------  -  --------------  -----------  -------
0.vmtest2    dteam001  Kashif M. Raza  18/04 16:53:03  C  18/04 16:53:05  vmtest1.abc  express
2.vmtest2    dteam007  Arnau Hahkala   19/04 13:21:19  C  19/04 13:23:26  vmtest3.abc  medium
....
....
160.vmtest2  sgmatlas  Andrew Lloyd    30/04 15:44:36  C  30/04 15:54:04  node029.abc  short  
162.vmtest2  sgmops    Maarten Lapka   30/04 16:44:36  C  30/04 16:45:48  vmtest1.abc  express
---------------------------------
107 records in history (0.04 sec)

-m 4 prints the records only for April, if no option is given prints entire records and so on. I want my user to be able to construct the conditional query string, like: m == "4" && RealUser == "Maarten Lapka" and also output the result with the only fields they want, in their desired format, like: JobId && StartDate && User, which means the user is looking for the job records those are submitted by Maarten Lapka in April and want to print only the job-id, job start-date and the user-name in the order he mentioned. So, a possible command could be:

torque_history.py -c 'm == "4" && RealUser == "Maarten Lapka"' -f 'JobId && ExecHost && StartDate'

where -c is the short for --constraint and -f for --format or whatever. Can anyone suggest me some way of doing this? Is it possible using getopt()?

The part of my problem is we use variant of RHEL5 (i.e. SL5, SLC5, CentOS), they all come with python v2.4 as standard and I can’t make sure that every site run v2.6 in parallel. So, I want to stay close as much as possible to v2.4 and using getopt() if possible. My plan is to compile the python code using shedskin and distribute the c++ file to minimize the compatibility issue. In that case I can use v2.6 but I’ve to use the modules that shedskin support and getopt() is one of them.

I’m sorry if I’m making it’s hard for you guys but I’m really looking forward to some help and suggestions. Thanks for your time. Cheers!!!

  • 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-22T02:36:53+00:00Added an answer on May 22, 2026 at 2:36 am

    optparse is pure Python, so I’d forget about getopt() and pull it into your app if need be.

    try:
      import optparse
    except ImportError:
      import external.optparse as optparse
    

    Don’t forget to create external/__init__.py.

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

Sidebar

Related Questions

This question is related to a previous post of mine Here . Basically, I
This question is in continuation to my previous post located here . Since there
This post is closely related to my previous post: TDBadgedCell keeps caching the BadgeNumber
This question is related to my previous one: Running erlang shell as a daemon/service
Ok, so - this is heavily related to my previous question Transforming an object
This question is directly related to my previous question ASP.NET AJAX Is it possible
This is kind of related to my previous question, but not really. I have
Thanks to Insin for answering a previous question related to this one. His answer
This is related question to my previous question but different one. After searching a
This question is related to this previous one on how to replace accented strings

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.