User Profile

Collapse

Profile Sidebar

Collapse
psbasha
psbasha
Last Activity: Aug 26 '10, 05:20 PM
Joined: Feb 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Is there any preprocessor step available in Python?

    Hi,

    I have a code written in Windows creating the spreadsheet as ouput.I need to make use of the same code in UNIX to create spreadsheet or other format.

    Is there any preprocessor step available in Python?

    Similar to C/C++

    #ifdef WIN /*Windows*/

    /*Call Windows Snippet of code*/
    #elseif UNIX-AIX
    /*Call UNIX-AIX Snippet of code*/
    #elseif
    ...
    See more | Go to post

  • psbasha
    started a topic OOPS Concepts Implementation & Performance

    OOPS Concepts Implementation & Performance

    Hi,

    Whether the application performance will be reduced ( Time taken will be more for processing the data ) with the implementation of OOPS Concepts with better memory ussage.

    Can you please correct me I am wrong in this.

    Thanks
    PSB
    See more | Go to post

  • psbasha
    started a topic Parsing huge data

    Parsing huge data

    Hi ,

    I have to parse a huge data of 3GB and store it in the dictnoray.After storing the data ,I need to do lot of calculations and write to the output file.The application is working for 500 MB file data,but for 3GB file it throwing Out of Memory message on the Python Editor.

    Could you please help me with the best approach of data handling and traversing.

    Thanks
    PSB
    See more | Go to post

  • psbasha
    replied to Load Runner compatibility with Python
    Load Runner compatibility with Python

    We are looking for some information on Python Application and whether Load Runner can be used to do the performance testing for the Applications developed on Python

    Thanks
    PSB
    See more | Go to post

    Leave a comment:


  • psbasha
    started a topic Load Runner compatibility with Python

    Load Runner compatibility with Python

    We are looking for some information on Python Application and whether Load Runner can be used to do the performance testing for the Applications developed on Python

    Thanks
    PSB
    See more | Go to post

  • Whether Python can be used for Geograpical Information System (GIS)?

    Hi all,

    I am back again!!!.

    Whether Python can be used for Geograpical Information System (GIS)?.If so,can anybody help me which module of python it falls.

    Is thier any possible links which help me in using Python for GIS?

    Thanks
    PSB
    See more | Go to post

  • psbasha
    replied to File Parsing
    BV,

    Your suggestion is required.

    Thanks
    PSB
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to File Parsing
    Code:
    Output
    matDataDict {1: [100, 40, 30, 2.0, 0], 2: [200, 40, 60, 2.0, 0], 3: [600, 40, 30, 5.0, 0], 4: [500, 40, 70, 2.0, 0]}
    matCDict {2: [[1000.0, 0.10000000000000001], [2000.0, 0.20000000000000001], [3000.0, 0.29999999999999999], [4000.0, 0.59999999999999998]], 3: [[3000.0, 0.10000000000000001], [5000.0, 0.20000000000000001], [6000.0, 0.40000000000000002], [7000.0, 0.59999999999999998]]}
    matTDict {2: [[1000.0, 0.10000000000000001],
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to File Parsing
    Code:
    SampleCode
    key_patt = re.compile(r'/([A-Za-z_\-0-9]+)/')
    data_patt = re.compile(r'\d+\.\d+|\d+|-\.\d+|\w+') 
    def parse_data(fn):
        key = None
        bMFlag = False
        iCount = 0
        dataList = []
        dd = {}
        
        matDataDict = {}
        matCDict = {}
        matTDict = {}
        comFactDict = {}
        bMCFlag = False
        bMTFlag = False
        bMatDataBlockFlag
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to File parsing of different file format
    Code:
    SampleData
    def read_file_data(self,strFile):
            bQuadDataFlag = False
            bTriaDataFlag = False
            bRodDataFlag = False
            bEleStressFlag = False
            iCounter = 0
            dataTempList = []
            dataList = []
            dataID = 0
            dataIDDataDict = {}
            
            f = open(strFile,'r')
            
            strTemp = f.readlines()
    ...
    See more | Go to post
    Last edited by psbasha; Jan 11 '08, 05:58 AM. Reason: Remove data

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    Sorry BV,

    You have understood wrongly.My file data has 8 or 16 digits or combination of both filed formats.I have given a sample data that is not able to read correctly by the Pattern definition.
    To support that we need to define the pattern for X,Y and Z coordinates properly for '8' and '16' digit.

    Could you please help me in fixing this problem.

    Thanks
    PSB[/QUOTE]


    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    >>> [/code][/QUOTE]
    Sorry BV,

    You have understood wrongly.My file data has 8 or 16 digits or combination of both filed formats.I have given a sample data that is not able to read correctly by the Pattern definition.
    To support that we need to define the pattern for X,Y and Z coordinates properly for '8' and '16' digit.

    Could you please help me in fixing this problem.

    Thanks
    ...
    See more | Go to post
    Last edited by psbasha; Jan 10 '08, 12:02 AM. Reason: Edited

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    Code:
    InputData
    Point   5               0.0     1.0     0.0
    Point   6               1.0     1.0     0.0
    Point   7               2.0     1.0     0.0
    Point   86010206        1471.51 -165.842139.
    Point   86090104        1403.56 -148.237126.7
    Point   86090129        1708.72 -722.4  232.274
    Point   86120127        1664.09 -687.   225.852
    $
    END
    BV,

    Not able...
    See more | Go to post
    Last edited by psbasha; Jan 9 '08, 10:54 PM. Reason: Edited

    Leave a comment:


  • BV,

    Please let me know your suggestion on this code

    Thanks
    PSB
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    Thanks BV for your help.

    I have to work more on RegEx.I have gone thru the link link you have shared with me.Still I have to work on that in detail.

    How to verify whether our defined pattern is correct? .Whether we have to use KODOS to verify it or anyother links available

    -PSB
    See more | Go to post

    Leave a comment:


  • Here is the solution:

    Code:
    Filter
    def filter_numberIDs(fileList, idDict, *args):
        astreikFlag = False
        notNumFlag = False
            
        pattkey = re.compile('|'.join([r'\b(%s)' % item for item in args]))    
        iLen = len(fileList)
        fileList1 = []
        for i in range(0,iLen):    
            line = fileList[i]
            if line.startswith('$'):
                pass
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    I tried replacing the last line as shown below.But still iam not getting the results as expected

    Code:
    Pat
    -\.\d+|                   # negative float format
    \.\d+|                    # positive float format                                            
    \\(?<![a-zA-Z])\d{1,8}  # positive integer
    Code:
    Output
    >>> Point
        [0.0, 0.0, 0.0]
        [1.0, 0.0, 0.0]
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to any other best way of reading the file
    I try to add the pattern as suggested at the last

    Code:
    Pat
    pattnum = re.compile(r'''
                          -\d+\.\d+E\+\d+|          # engineering notation -+
                          \d+\.\d+E\+\d+|           # engineering notation ++
                          -\d+\.\d+E-\d+|           # engineering notation --
                          \d+\.\d+E-\d+|            # engineering notation +-
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    replied to Need to split the number
    Thanks for the solution.

    I have read couple of books on Python
    - Dive in python
    - Core Python Programming

    and gone thru the links in the Internet.Python is having so many concepts,that we cannot get everything within short duration.So as we keep programming ,then thier will be more chance of learning more concepts( based on our requirements) than reading.I really appreciapte for your suggestion.
    ...
    See more | Go to post

    Leave a comment:


  • psbasha
    started a topic Need to split the number

    Need to split the number

    Hi,

    I have a number ,i have to split it into 3 digits

    For Example num = 001001001001000 001

    After the split it should be

    001
    001
    001
    001
    000
    001
    Is there any better way to split it

    num = '00100100100100 0001'
    x1 = num[0:3]
    x2 = num[3:6]
    x3 = num[6:9]
    x4 = num[9:12]
    x5 = num[12:15]
    x6 = num[15:18]...
    See more | Go to post
No activity results to display
Show More
Working...