Defining multiple digit variables using Python

Discussion in 'Mac Programming' started by mnumbp, Feb 5, 2010.

  1. mnumbp macrumors newbie

    Joined:
    Feb 5, 2010
    #1
    Trying to create program with Python and Tesseract. Goal to extract a multiple digit number from files. Any ideas?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
  3. mnumbp thread starter macrumors newbie

    Joined:
    Feb 5, 2010
    #3
    Need to define a variable numeric with 7 digits from 0000000 to 9999999. Goal is for the optical character recognition program to only pull the 7 digit number. I'm able to only pull all characters at this point.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Look into using regular expressions for matches
    Code:
    \D?\d{7}\D?
    • \d matches any digit
    • \D matches any non-digit
    • ? means may or may not be present
    • {7} means for 7 characters.
     
  5. steavelee2 macrumors newbie

    Joined:
    Feb 3, 2010
    #5
    you will never get any idea about programming by python and i don;t think so that you will actually learn the thing by these way as the subject you are discussing is very large and complicated. So i just want to say you that you must search the Internet for these and you will definitely got the more valuable knowledge from these,actually brother we all are using the forums to discuss the problem related to our technology not to learn the technology.Hope you can understand.Sorry if you don't like my opinion.
     

Share This Page