ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » reading qm.ini Python

Post new topic  Reply to topic
 reading qm.ini Python « View previous topic :: View next topic » 
Author Message
bobbee
PostPosted: Wed May 11, 2022 11:42 am    Post subject: reading qm.ini Python Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 541
Location: Tampa

I have configuration files for my script. I am using configparser. Is there another parser for Python that would read the qm.ini file in the same manner?
Back to top
View user's profile Send private message Send e-mail AIM Address
gbaddeley
PostPosted: Wed May 11, 2022 3:49 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
Location: Melbourne, Australia

qm.ini and other MQ ini files are similar to Windows INI files. Is there any reason why configparser does not work with these?
_________________
Glenn
Back to top
View user's profile Send private message
bobbee
PostPosted: Thu May 12, 2022 4:46 am    Post subject: Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 541
Location: Tampa

I am using configparser to process a properties file. It looks for sections, by default, in the format of '[section]' The qm.ini is formatted as 'section:'. I have run into a configuration where you can change the section search by using REGEDIT. Trying to find more information on how I can change it to look for 'section:'

I searched again after I wrote this. there is this ConfigParser.SECTCRE in configparser for customizing the section search.

https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.SECTCRE
Back to top
View user's profile Send private message Send e-mail AIM Address
bobbee
PostPosted: Thu May 12, 2022 5:14 am    Post subject: Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 541
Location: Tampa

I will admit my REGEDIT is non-existent. I see the example as

Code:
custom.SECTCRE = re.compile(r"\[ *(?P<header>[^]]+?) *\]")

Would changing that to:

Code:
custom.SECTCRE = re.compile(r"*(?P<header>[^]]+?) *:")


solve my problem as instead of looking for '[section]' it would look for 'section:'
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » reading qm.ini Python
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.