woooee 814 Nearly a Posting Maven

I have to be misunderstanding the concept.

import random
import string

##--- populate a test dictionary with random quanties
letters_dict = {}
for ltr in string.uppercase:
    letters_dict[ltr] = random.randint(1, 100)

## phi = f1 (f1 - 1) + f2 (f2 - 1) + ... + fn (fn - 1)
phi = 0
for ltr in letters_dict:
    qty = letters_dict[ltr]
    phi += qty * (qty-1)
print phi
woooee 814 Nearly a Posting Maven

I found no Image module in Tkinter, WxPython, or Qt, so just a wild guess would be that you are not allowing for the thickness of outside lines. If you are drawing a right angle, the insides would touch but there would be a gap from outside to outside.

woooee 814 Nearly a Posting Maven

phi = f1 (f1 - 1) + f2 (f2 - 1) + ... + fn (fn - 1)

Someone is going to have to explain where f1, f2,... come from or what they mean.

woooee 814 Nearly a Posting Maven

FYI, os.path.join() will take care of this on any OS
print os.path.join('c:', 'path', 'to', 'exe')

woooee 814 Nearly a Posting Maven

The only things you can search for that I can see would be two colons in the line, str.count(), and if found, "Jan" through "Dec" (or "Mon" through "Sun" but they don't all contain the day). If they are both found, you can split and search for the string that has the colon in it, which should be the time.

woooee 814 Nearly a Posting Maven

The "Usage" example on the home page explains it. You call the class for the particular type of barcode you want with the bar code number as a parameter.

woooee 814 Nearly a Posting Maven

I have always found it necessary to use shell=True, on Linux machines anyway.
p = call('DAZZLE tmp\163282.xml', shell=True)

woooee 814 Nearly a Posting Maven

You don't return anything from the function datetimedtoday() so calling it doesn't return any date.

import datetime
from Tkinter import *
 
class Class1:
    def __init__(self):
        obj1= Class2()
        self.root = Tk()
        self.root.title("test window")
        self.can1=Canvas(self.root, width=500, height=510, bg="black")
        self.can1.pack(expand=False, fill=X)
        self.label1 = Label(self.can1, text =obj1.datetimetodayday() , bg = 'black',
                       fg= 'red',font=('Arial Black', 14))
        self.can1.create_window(20,20, window=self.label1, anchor= NW)
 
 
class Class2:
    def __init__(self):
        pass
 
    def datetimetodayday(self):
        tdate=datetime.datetime.now()
        tdateday = str(tdate.day)
        if len(tdateday)==1:
            tdateday= "0"+tdateday
     
        return tdateday
 
gui=Class1()
gui.root.mainloop()
woooee 814 Nearly a Posting Maven

In one of the "add up the cards" spots, print the cards as well. There is a problem with the way you access the class.

for i in self.hand:
                psum=int(i.value) + psum 
                print i.value, i.suit, i.rank

Or, add this print at the end of the class and then take a look at the deck loops. Print statements should be one of the first tools to use to determine what exactly the program is doing. Generally speaking, someone who has not tried this most basic of steps does not get much of a response.

self.cardname = self.rank + " of " + self.suit
        print self.cardname
woooee 814 Nearly a Posting Maven

Once you read a file, that is it, unless you go back to the beginning and start over again, so after the first pass, g.readlines() does nothing. Instead, I think it is save to store the whopping 15 lines in memory as a list and iterate over the list. In the future, you want to develop the habit of adding print statements to debug, which would show that nothing was happening after the first pass through the 'f' for() loop.

for line in f.readlines():
            for ln in g.readlines():
#
#---------- replace with
        g_data=open(self.dcmdir+"/DOPEN/extlib.ded",'r').readlines()
        f_data=open(self.dcmdir+"/DOPEN/dwnext.ded",'r').readlines()
        for line in f.data:
            for ln in g_data():
woooee 814 Nearly a Posting Maven
woooee 814 Nearly a Posting Maven

A string is always larger than a number (any number). Better re-read your other thread and if you are not sure, print type() for both variables.

woooee 814 Nearly a Posting Maven

Using list insert may indeed be slower that string concatenate, since every item after the inserted one has to be moved. This is why I chose to create at list of zeroes first and then extend it using the hex value. It depends on the length of the string or list, of course. These times are going to be longer because functions are called. And timeit extends the execution time considerably.

import timeit
 
n = 500
def test_extend():
   test_list = [ 0 for x in range(n)]
   test_list.extend('ff12')

def test_insert():
   x = ["ff12"]
   for ctr in range(n):
      x.insert(0, '0')

def test_string():
   x = 'ff12'
   for ctr in range(n):
      x = '0' + x

print( "test_extend took %0.3f micro-seconds" % (timeit.Timer(test_extend).timeit()) ) 

print( "test_insert took %0.3f micro-seconds" % (timeit.Timer(test_insert).timeit()) ) 

print( "test_string took %0.3f micro-seconds" % (timeit.Timer(test_string).timeit()) )
 
"""
##--- insert 5 zeroes
test_extend took 3.241 micro-seconds
test_insert took 3.174 micro-seconds
test_string took 1.683 micro-seconds

##-------  insert 500 zeroes
test_extend took 46.459 micro-seconds
test_insert took 330.859 micro-seconds
test_string took 117.718 micro-seconds
"""
vegaseat commented: good point! +10
woooee 814 Nearly a Posting Maven

For starters, you can use a dictionary and a list in the Card class. Test each class and function individually, whether it is in a class or not, before you include it your main program so you know that it works properly and returns the correct value. You obviously have too large of a program here for you to be able to debug.

class Card:
    def __init__(self, suit, rank):
        self.card_dict = {}
        self.card_dict[1]  = ["Ace", 11]
        self.card_dict[11] = ["Jack", 10]
        self.card_dict[12] = ["Queen", 10]
        self.card_dict[13] = ["King", 10]
       
        self.suit_list = ["*", "Clubs", "Spades",
                              "Diamonds", "Hearts" ]

    def rank_suit(self, suit, rank):
        if rank in self.card_dict:
            self.value = self.card_dict[rank][1]
            self.cardname = "%s of %s" % \
                 (self.card_dict[rank][0], self.suit_list[suit])              
        else: 
            self.value = self.rank
            self.cardname = "%s of %s" % \
                 (str(rank), self.suit_list[suit])
woooee 814 Nearly a Posting Maven

Try
line = line.strip() ## instead of line = line[:-1]
or make sure there is a return/newline in the last line of the file.

woooee 814 Nearly a Posting Maven

And you should perhaps leave it as a list to avoid any string slicing later. You can also use list comprehension to prepend the zeros which will be faster. This is only an example, since I'm not sure what is going on.

def IntToNBytes(integer, n):
    tmphex = hex(integer)[2:]
    tmphex_list = [ 0 for x in range(2*n - len(tmphex))]
    tmphex_list.extend(list(tmphex))
    tmpbyte = []
    j = 0
    for i in range(n):
        tmpbyte.append(int(tmphex_list[j], 16)*16+int(tmphex_list[j+1], 16))
        j = j+2
    return tmpbyte

Finally, you only want to convert a number once. If it appears in the string many times (as zero does), you are converting it many times. Try using a dictionary to store the value the first time it is encountered. It may or may not be faster than the calcs. Since this is a function, and you are probably calling it several times, return and pass the accumulated dictionary each time. Again, this is just a rough guess of what I think you are doing.

def IntToNBytes(integer, n, hex_dic):
    tmphex = hex(integer)[2:]
    tmphex_list = [ 0 for x in range(2*n - len(tmphex))]
    tmphex_list.extend(list(tmphex))
    tmpbyte = []
    j = 0
    for i in range(n):
        for current in [tmphex_list[j], tmphex_list[j+1]]:
            if current not in hex_dic:
                hex_dic[current] = int(current, 16)
        tmpbyte.append(hex_dic[tmphex_list[j]*16+hex_dic[tmphex_list[j+1])
        j = j+2
    return tmpbyte, hex_dic
woooee 814 Nearly a Posting Maven

You don't actually split a widget, you use 2 widgets and pass whatever data back and forth. The following code is not exactly what you want but does show how to pass data from one widget to another. When you click on the 'Edit' button the item you selected is passed to the pop up box. The 'edit' function is the function that does this using getText() and setText(). And you could remove the code for the other buttons if that makes the example easier to understand.

Some general references:
http://www.zetcode.com/tutorials/pyqt4/
http://www.diotavelli.net/PyQtWiki/Tutorials
http://wiki.python.org/moin/PyQt4

#!/usr/bin/env python
# Copyright (c) 2007-8 Qtrac Ltd. All rights reserved.
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 2 of the License, or
# version 3 of the License, or (at your option) any later version. It is
# provided for educational purposes and is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

MAC = "qt_mac_set_native_menubar" in dir()


class StringListDlg(QDialog):

    def __init__(self, name, stringlist=None, parent=None):
        super(StringListDlg, self).__init__(parent)

        self.name = name

        self.listWidget = QListWidget()
        self.stringlist = QStringList()
        if stringlist is not None: …
woooee 814 Nearly a Posting Maven

First, don't use "file" as a variable name as it is a reserved word. I would guess that the problem may be with counter equal or not equal to one, or not stripping spaces from the name or term. There were some punctuation errors in the code you posted as well. The following code, using test data, seemed to work for me with the above errors corrected. Finally, "fileappender" is unnecessary and slow in that you have to open and close the file each time. Just return the file pointer from the open() and use it to write.

def filereader (filename):
    """  commented -- using test data
    
    fp = open(filename ,'r')
    text = fp.readlines()
    fp.close()
    """

    text = ["fname1, term1", "fname2, term2", "fname3, term3" ]
    return text
 
def filewriter (filename, text):
    fp = open(filename ,'w')
    return fp
#    file.writelines(text)    
#    file.close()
 
 
resultsfile = 'C:\\resultsfile.txt'
fp_out = filewriter(resultsfile)
fp_out.write("Results File \n")

notes = filereader('C:\\mainlist.txt')

readfile_test = [ ["term1", "term4", "term1"],
                  ["term1", "term2", "term1"],
                  ["term1", "term4", "term3"] ]
ctr = 0
 
for item in notes:
    print "Line: " + item
    substrs = item.split(",")
    fname = substrs[0].strip()
    print "File: " + fname
    term = substrs[1].strip()
    print "Term: " + term
 
    fp_out.write("File : %s\n" % (fname))
    fp_out.write("Error: %s\n" % (term))
 
    ##--- use test data
    readfile = readfile_test[ctr]
    ctr += 1
#    readfile = filereader(fname)
    #print readfile
 
    counter = 0
 
    for subline in readfile:
        print "subline:" + subline
        if counter == 1:
            fp_out.write( "          %s\n" % (subline))
            print "     c0sub: " + subline
            counter …
woooee 814 Nearly a Posting Maven

A "How To" is generally sample code on how you do something, so anyone who doesn't want to know how to do this will not even look at the thread. Try a new thread with a more specific title and some sample code. For example, "How would I link two widgets together using QT4", with some sample code creating the two widgets, and stating exactly what you want to link, i.e. input text, slider bar, calculations, etc.

woooee 814 Nearly a Posting Maven

My guess would be that the system has a different encoding, so when you drop to system level to execute this
os.system("ln -s <src> <dst>")
you get an error. os.symlink stays within the Python program so understands the encoding.

woooee 814 Nearly a Posting Maven

ln has a -f (force option). See man ln. Also, try this instead as it may not be a symlink

if not os.path.exists(path):
woooee 814 Nearly a Posting Maven

You have to declare the encoding somewhere. The following works for me on python 3.x. Note that printing to screen is a different matter as some characters will not print depending on the encoding and font for the system.

#!/usr/bin/python3
# -*- coding: latin-1 -*-

y = 'abcdef' + chr(128)
print(y)
woooee 814 Nearly a Posting Maven
woooee 814 Nearly a Posting Maven

Do you have Hebrew fonts installed on your system? Try the following and see if it prints an Alef. I don't know much about Hebrew, but it appears that the iso8859_8 encoding should be used. Note that all of this depends on which Python version you are using. I tested this on Python 2.6.4

a = unichr(1488)
b = a.encode("iso8859_8")
print "b =",b
woooee 814 Nearly a Posting Maven

I have this example from somewhere on the web that changes based on the slider value. You are interested in the moveSlider and valueChanged functions. Sorry, I didn't note where i came from.

Edit: Just noticed that you are using Qt3, so try this program instead. I don't have Qt3 installed so can't test it.

"""**************************************************************************
** $Id: rangecontrols.py,v 1.1 2003/07/01 14:18:37 phil Exp $
**
** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
**
** This file is part of an example program for Qt.  This example
** program may be used, distributed and modified without limitation.
**
***************************************************************************"""

import sys
from qt import *

INT_MAX = sys.maxint

class RangeControls( QVBox ):
    def __init__( self, parent=None, name=None ):
        QVBox.__init__( self, parent, name )
        
        row1  = QHBox( self )
        cell2 = QVBox( row1 )
        cell2.setMargin( 10 )
        cell2.setFrameStyle( QFrame.WinPanel | QFrame.Sunken )

        QWidget( cell2 )

        label1 = QLabel( QString( "Enter a value between\n%1 and %2:" ).arg( -INT_MAX ).arg( INT_MAX ), cell2 )
        label1.setMaximumHeight( label1.sizeHint().height() )
        sb1 = QSpinBox( -INT_MAX, INT_MAX, 1, cell2 )
        sb1.setValue( 0 )

        label2 = QLabel( "Enter a zoom value:", cell2 )
        label2.setMaximumHeight( label2.sizeHint().height() )
        sb2 = QSpinBox( 0, 1000, 10, cell2 )
        sb2.setSuffix( " %" )
        sb2.setSpecialValueText( "Automatic" )

        label3 = QLabel( "Enter a price:", cell2 )
        label3.setMaximumHeight( label3.sizeHint().height() )
        sb3 = QSpinBox( 0, INT_MAX, 1, cell2 )
        sb3.setPrefix( "$" )
        sb3.setValue( 355 )

        QWidget( cell2 )

        row2 = QHBox( self )

        cell3 = QVBox( row2 )
        cell3.setMargin( 10 )
        cell3.setFrameStyle( QFrame.WinPanel | …
woooee 814 Nearly a Posting Maven

I think you want to use new_sentence (and is one of the positive results of posting code).

def wordFrequences(new_sentence):
    wordFreq = {}

    ##  new_sentence was not defined
    split_sentence =  new_sentence.split()

    for word in split_sentence:
            wordFreq[word] = wordFreq.get(word,0) + 1
    wordFreq.items()
    print wordFreq
 
sentence = "The first test of the function"
new_sentence = removePunctuation(sentence)
wordFrequences(new_sentence)
woooee 814 Nearly a Posting Maven

We can't help without knowing what encoding your program uses (obviously not the right one). It appears to work fine with the universal utf-8 encoding, see here http://effbot.org/pyfaq/what-does-unicodeerror-ascii-decoding-encoding-error-ordinal-not-in-range-128-mean.htm

a = unicode('\u05d0', "utf-8")
print a
woooee 814 Nearly a Posting Maven

Works fine for me (using the following stripped down version). You should include the actual error when posting; it is not always what you think it means.

class Card():
        SUIT = { 'C':'Clubs', 'D':'Diamonds', 'H':'Hearts', 'S':'Spades' }
        VALUES = { '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, \
                        '10':10, 'J':12, 'Q':13, 'K':14, 'A':15 }
 
        def __init__(self):
            print("Card class instance")


class PokerHand():
        SIZE = 5
        RANKS = { 0: "Straight Flush", 1: "Four of a Kind", 2: "Full House", \
                        3: "Flush", 4: "Straight", 5: "Three of a Kind", \
                        6: "Two Pairs", 5: "Pair", 6: "High Card" }
 
        def __init__(self):
            print("PokerHand class instance")
            print("From PokerHand")
            self.issflush()

        def issflush(self):
            print(Card.VALUES)

PH = PokerHand()
print("\nFrom main")
print(Card.VALUES) 
print("\nissflush")
print PH.issflush()
woooee 814 Nearly a Posting Maven

I understand there is a language barrier so please explain if and how you identify this record

For example program read <HEADLINE text="This is headline 1"> and write to the sec. file:

if you are not using startswith(), and we can go on from there. If you have existing code that does this, or anything else, please post the code, or at least a summary of it, so we don't cover things already completed.

woooee 814 Nearly a Posting Maven
woooee 814 Nearly a Posting Maven

if I could do something like sort all values

Try a normal list sort and then print it to see if it is in the order you want. You can then go through the list item by item, and if the first letter of this word is different from the first letter of the previous word, start a new list, although I would use a dictionary of lists.

woooee 814 Nearly a Posting Maven

I've only done this once and used html2ps and then ps2png. I am pretty sure that convert within Imagemagick (located here in most distros file://localhost/usr/share/doc/ImageMagick-6.5.6/www/convert.html ) will do it in one step from the command line but you may have to supply additional paramenters like layers, etc.

woooee 814 Nearly a Posting Maven

Use startswith() on each record to test for <HEADLINE and the string find function to locate the double quotation marks.

woooee 814 Nearly a Posting Maven

You can also strip() the record (remove '\n') and test for endswith zero.

woooee 814 Nearly a Posting Maven

Two more things. You do not pass the variables NUM_SQUARES or EMPTY to the function. If you run/call this function from another program file you will get an "undefined variable" error. Second, I come from another time and another programming style and so code based on the indents rather than chronological order. I will not have the indent problem because the function would be coded as a for statement and a return value. The code under the for statement would be added last. Don't know if this will help or not, but the idea is to vary your style as you go along and improve incrementally .

woooee 814 Nearly a Posting Maven

See if adding this print statement gives you any ideas.

# New board function
def new_board():
    """Create new game board."""
    board = []
    for square in range(NUM_SQUARES):
        print "adding square #", square
        board.append(EMPTY)
        return board
Cjreynol commented: Very very helpful, helped me work out a bug I had been having lots of trouble with! +0
vegaseat commented: nice help +10
woooee 814 Nearly a Posting Maven

print "\n\t", board[0], "|", board[1], "|", board[2]
IndexError: list index out of range

Add a
print len(board)
as the first statement in the function to see if your list contains 9 items (and of course it doesn't, but this will tell you how many items it does contain).

woooee 814 Nearly a Posting Maven

Some of the crazy/weird holidays for February.
Super Bowl Sunday
Jobs in Golf Month
Marijuana Awareness Month (is that an oxymoron)
National Condom Month
National Laugh Friendly Month
National Pet Dental Health Month
Pull Your Sofa Off The Wall Month
Return Supermarket Carts Month

And in the Valentine spirit
Chocolate Lover's Month

First week in February is
Intimate Apparel Week

Second Week is
Dump Your Significant Jerk Week
Just Say 'No' To Powerpoints Week (you love it or hate it)
Rejection Risk Awareness Week
International Flirting Week
National Acts of Kindness Week
Love a Mench Week (look it up; it's not what you think)

Third Week is
National Condom Week (in National Condom Month= No babies born in November)

February 1st is "Working Naked Day" so if you are going to observe it, please tell me where and when so I can be elsewhere.

woooee 814 Nearly a Posting Maven
(r**2) = (x**2) + (y**2) ## syntax error here reads "***cannot assign operator"

This is obvious. You can not solve for r squared. You would have to use

r2 = (x**2) + (y**2) ## syntax error here reads "***cannot assign operator"
r = r2 **0.5
or r = math.sqrt(r2)
woooee 814 Nearly a Posting Maven

Use the modulo "%" which gives the remainder.

for x in [1.1, 1.8, 1.0]:
   if x % 1 > 0:
      y = int(x)+1
      print y
   else:
      print "no conversion for", x 
#
# prints
2
2
no conversion for 1.0
woooee 814 Nearly a Posting Maven

print score(0,-9)
will trigger the last return in this block of code, because x=0. Note that the "y" portion of the code will never be reached, because any value of x will result in a return from the function.

if x>15 or x<-15:
        print "Out of Bounds, No Points"
        return 0
 
    else:
        if x>12 or x<-12:
            return 20
 
        else:
            if x>9 or x<-9:
                return 40
 
            else:
                if x >6 or x<-6:
                    return 60
 
                else:
                    if x >3 or x<-3:
                        return 80
 
                    else:
                        ##======================================
                        ##  x=0 will wind up here
                        ##======================================
                        return 100

Also, you could do something a little more succinct like the following.

if x>15 or x<-15:
        print "Out of Bounds, No Points"
        return 0
## else is not necessary since you have a return that will exit the function if > 15 
test_list = [ (12, 20), (9, 40), (6, 60), (3, 80)] 
for num, ret_val in test_list:
    if abs(x) > num:
        return ret_val

##  nothing found earlier = abs(x) <= 3
return 100
woooee 814 Nearly a Posting Maven

Post back if you want some help with SQLite, or the dictionaries.

woooee 814 Nearly a Posting Maven

TypeError: __add__ nor __radd__ defined for these operands

The error could be here because of backticks
print "Adding strTest to Array " + `unDepSuccess`
Also, you can not concatenate a string and a list (I'm assuming it is a list because you append to it).
print "Printing unDepSuccess " + unDepSuccess
print "Adding strTest to Array " + `unDepSuccess`

Use
print "Printing unDepSuccess ", unDepSuccess

woooee 814 Nearly a Posting Maven

A second for the use of SQLite, then you can select where sex=='Male', etc. If you want to keep your original structure, a dictionary of lists might work better, with each position in the list holding a specitic data value.
exp_dict[Exp#] = [sex, age_band, type_of treatment]

Otherwise, you would want a separate dicitonary wth "Male" and "Female" as keys, pointing to a list of experiment numbers, or whatever is the key of the main dictionary, so you don't have to iterate through all of the main dictionary's keys, to the sub-dictionary of gender.

woooee 814 Nearly a Posting Maven

spell = []
defines an empty list on every pass through the loop. You want it before the while(). Also, your code is an infinite loop, i.e. there is no exit.

woooee 814 Nearly a Posting Maven

t.play(toy) doesn't have a return, which means it returns None, so
print 'Yip! ' + str(t.play(toy))
prints "Yip!None"

Try

print 'Yip!',
t.play(toy)
#
# or
class Toy(object):
    def play(self, toy, lit):
        '''Print squeak'''
        print lit+'Squeak!'

t.play(toy, 'YIP!')  ## note that 'toy' is not used anywhere
#
# or
class Toy(object):
    def play(self, toy):
        '''Print squeak'''
        return 'Squeak!'

print 'Yip! ' + t.play(toy)
woooee 814 Nearly a Posting Maven
woooee 814 Nearly a Posting Maven

I am not a user (of regex's) so would do something like the following. You might prefer to find the first "&" and slice from there instead of using split and join.

test_data = ["sometext herekeywords=walter&keywords=scott",
             "keywords=john&sometexthere",
             "keywords=james&keywords=john& keywords=brian&"]

delim = 'keywords='
found_list = []
for rec in test_data:
   ## find all occurances of 'keywords='
   start = rec.find(delim)
   ctr = 0     ## I always limit while loops when testing
   while (start > -1) and (ctr < 10):
      rec = rec[start+len(delim):]  ## everything after delim
      if "&" in rec:
         substrs = rec.split("&")
         found_list.append(substrs[0])  ## before first "&"
         rec = "&".join(substrs[1:])  ## put the rest back together
      else:
         found_list.append(rec)

      start = rec.find(delim)
      ctr += 1

print found_list
#
# output is ['walter', 'scott', 'john', 'james', 'john', 'brian']
woooee 814 Nearly a Posting Maven

Not using a regex, it would be

mystring = "00:00:11 192.168.21.44 GET /images/help.gif - 200 Mozilla/4.0+(compatible;+MSIE+5.0;+Windows+98;+DigExt) ASPSESSIONIDGGGGGQEG=CLDIHIJBJAPFAGBFIOMCFGGA;+PRO%5FOnline=SEARCHQUERY=%09%3Cinput+type%3Dhidden+name%3D%27HrowColumns%27+ID%3D%27HrowColumns%27++value%3D%271%3B6%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData10%27+ID%3D%27txtScopeData10%27++value%3D%27catherine%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData30%27+ID%3D%27txtScopeData30%27++value%3D%27porter%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData50%27+ID%3D%27txtScopeData50%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData11%27+ID%3D%27txtScopeData11%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData31%27+ID%3D%27txtScopeData31%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData51%27+ID%3D%27txtScopeData51%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27HCollection%5Fid%27+ID%3D%27HCollection%5Fid%27++value%3D%271%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ex%27+ID%3D%27Submit1%2Ex%27++value%3D%2736%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ey%27+ID%3D%27Submit1%2Ey%27++value%3D%2718%27%3E%0D%0A http://www.foo-bar.com/SearchResult.asp"
substrs = mystring.split('++value%3D%27')
for s in substrs:
   if s[0].isalpha():
      print s.split("%27")
woooee 814 Nearly a Posting Maven

There are many ways to flatten a list. Here are two. I'm sure a Google would come up with many more.

a = [[1,2,3], [4,5,6], [7,8,9]]
b = [num for sublist in a for num in sublist]
print b

import itertools
c = itertools.chain(*a)
print list(c)