Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: splitting a string with 2 different delimiters
Post: RE: splitting a string with 2 different delimiters

Try this re.findall(r'(X[^Y]+)(Y[^X]+)', string)
BamBi25 General Coding Help 4 2,650 Dec-30-2019, 04:49 AM
    Thread: Problem defining a variable
Post: RE: Problem defining a variable

The problem is userWantsToRegister and userWantsToLogin is local attribut from CheckuserDesiredMethod(). Maybe you can built a class ? or check this: def checkUserDesiredMethod(): userDesiredMeth...
BamBi25 General Coding Help 6 3,138 Dec-16-2019, 01:40 PM
    Thread: Randomly assign values in List 1 to a value in List 2
Post: RE: Randomly assign values in List 1 to a value in...

Another one :p import random dates = ['Jan 6', 'Jan 8', 'Jan 10'] students = ['Joey', 'Henry', 'Daniel', 'James', 'Samantha', 'Jose', 'Salvator', 'Paul', 'Steve', 'Mary', 'Kyle', 'Marcus...
BamBi25 General Coding Help 7 4,881 Dec-16-2019, 12:57 PM
    Thread: splitting a string with 2 different delimiters
Post: RE: splitting a string with 2 different delimiters

Hi, One easy solution: string = "XfooYbar" pars1 = "X" pars2 = "Y" final = [] xpos = string.find("X") ypos = string.find("Y") final.append(string[xpos:ypos]) final.append(string[ypos:]) print(final) ...
BamBi25 General Coding Help 4 2,650 Dec-16-2019, 05:45 AM

User Panel Messages

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