Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Regex search for string
Post: RE: Regex search for string

I'm actually trying to parse a markdown file associated with a pull request using the GitHub API.
DBS Web Scraping & Web Development 3 4,564 Feb-06-2017, 09:34 PM
    Thread: Regex search for string
Post: Regex search for string

Hello, I'm trying to formulate a regex search to see if this exact string, ''op_single_selector" exists in this line of text: -> [!div class="op_single_selector"] This is what I have now that's ...
DBS Web Scraping & Web Development 3 4,564 Feb-06-2017, 08:33 PM
    Thread: Using the and operator to check if two values equal a third
Post: RE: Using the and operator to check if two values ...

Another related question here, I would like to check and see if a value is equal to multiple values using if/or.  Would it be correct to use the statement below? if a == 'no' or 'yes' or 'maybe':   ...
DBS General Coding Help 13 11,240 Jan-17-2017, 06:18 PM
    Thread: Create a new list by comparing values in a list and string
Post: Create a new list by comparing values in a list an...

Hello, I have elements in a predefined list and a query string.  I would like to check if the query_str has any values in predefined list and if so, append them to a new list as separate elements. p...
DBS General Coding Help 2 3,539 Jan-14-2017, 01:37 AM
    Thread: Open previous csv file to read value under column for comparison
Post: RE: Open previous csv file to read value under col...

Thanks for the reply. That's the part I can't quite figure out is how to get the values under the header column into a variable for comparison.
DBS General Coding Help 3 3,928 Jan-13-2017, 07:00 AM
    Thread: Open previous csv file to read value under column for comparison
Post: Open previous csv file to read value under column ...

Hello, I  need to check the value under the columns of two csv files (the current open file and the csv file written immediately before it) and if the value in the number column exists in the previou...
DBS General Coding Help 3 3,928 Jan-13-2017, 05:36 AM
    Thread: Print list items on separate lines with additional text
Post: RE: Print list items on separate lines with additi...

Thanks. Any suggestions on pairing the messages with column headers in the list? Such as if the list only contains two of the elements and I want to pair the messages in the output to those elements ...
DBS General Coding Help 2 6,154 Jan-11-2017, 02:57 AM
    Thread: Print list items on separate lines with additional text
Post: Print list items on separate lines with additional...

Hello, I have some code that reads the columns of a csv and if the column value is True, print the list as a string, which I have working.  I now need to print each on a separate line and add text ba...
DBS General Coding Help 2 6,154 Jan-11-2017, 01:04 AM
    Thread: If and/or statement
Post: RE: If and/or statement

Thanks.  I did that and it looks like what I have works.  I was just worried about some odd outside case and if I needed to group the or statement in parenthesis.
DBS General Coding Help 4 4,848 Nov-04-2016, 07:24 PM
    Thread: If and/or statement
Post: If and/or statement

Hello, I want to construct an if statement using or/and.  If either string value exists in the first element in a list and then look to see if has_signoff == True? I've tried what I have below and i...
DBS General Coding Help 4 4,848 Nov-04-2016, 07:08 PM
    Thread: Check to see if a string exactly matches an element in a list
Post: Check to see if a string exactly matches an elemen...

Hello, I'm splitting the path from the filename and I would like to compare the file name against a list of elements in a list and if there's an exact match to any of the elements in the list, flip a...
DBS General Coding Help 1 22,325 Nov-02-2016, 09:48 PM
    Thread: Regex error: 'NoneType' object has no attribute 'group'
Post: RE: Regex error: 'NoneType' object has no attribut...

(Oct-31-2016, 06:33 PM)snippsat Wrote: Are you talking about the code i have posted or your code? Code i have posted should work for you to. You can test it online here or paste in >Code on top o...
DBS General Coding Help 8 26,364 Oct-31-2016, 06:36 PM
    Thread: Regex error: 'NoneType' object has no attribute 'group'
Post: RE: Regex error: 'NoneType' object has no attribut...

(Oct-31-2016, 05:54 PM)snippsat Wrote: (Oct-31-2016, 05:31 PM)DBS Wrote: When I assign the variable to r as you have above, I get the error message, but if print r.group(1), I get the intended res...
DBS General Coding Help 8 26,364 Oct-31-2016, 06:10 PM
    Thread: Regex error: 'NoneType' object has no attribute 'group'
Post: RE: Regex error: 'NoneType' object has no attribut...

(Oct-31-2016, 12:18 PM)snippsat Wrote: It should work the same way.When I assign the variable to r as you have above, I get the error message, but if print r.group(1), I get the intended results?? ...
DBS General Coding Help 8 26,364 Oct-31-2016, 05:31 PM
    Thread: Regex error: 'NoneType' object has no attribute 'group'
Post: Regex error: 'NoneType' object has no attribute 'g...

Hello, In the code below, I receive the error listed in the title of my question.  I'm trying to extract the substring between asterisks: 'Some text: **string1;string2;string3**'.  If I change the pr...
DBS General Coding Help 8 26,364 Oct-31-2016, 06:22 AM
    Thread: Check to see if file is submitted in correct folder
Post: RE: Check to see if file is submitted in correct f...

I've submitted several pull requests to the repo and everything comes back as expected. Is there another way I should use lambda to check if the elements in the art_path_lst match an element in the m...
DBS General Coding Help 9 8,142 Oct-21-2016, 06:49 PM
    Thread: Check to see if file is submitted in correct folder
Post: RE: Check to see if file is submitted in correct f...

Thanks for the reply.  I came up with the code below that's working. image_ext = [".png", ".jpg", ".jpeg", ".gif"] new_art_wrong_folder = False art_lst = [] md_lst = [] for file_information in repo.p...
DBS General Coding Help 9 8,142 Oct-21-2016, 04:25 AM
    Thread: Check to see if file is submitted in correct folder
Post: RE: Check to see if file is submitted in correct f...

(Oct-19-2016, 09:34 PM)nilamo Wrote: Ok, but...# this if extname.lower() in  (image.lower() for image in image_ext) # is completely identical to this: if extname.lower() in image_extThat's besides ...
DBS General Coding Help 9 8,142 Oct-19-2016, 10:37 PM
    Thread: Check to see if file is submitted in correct folder
Post: RE: Check to see if file is submitted in correct f...

Yes, this is intended as the check is to split the extension name from the filename and check to see if it's in "image_ext".  Thus the reason for these lines: fname,extname = os.path.splittext(file_i...
DBS General Coding Help 9 8,142 Oct-19-2016, 08:49 PM
    Thread: Check to see if file is submitted in correct folder
Post: Check to see if file is submitted in correct folde...

I need to loop through pull requests in GitHub to determine if any new art files are submitted to the correct folder based on the markdown file(s) in the pull request.  For instance, in the code belo...
DBS General Coding Help 9 8,142 Oct-19-2016, 04:51 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020