Last page update: November 23, 2011
Classes:
There is no class defined
External methods:
Complete reference:
These methods don’t belong to any class.
Return a list of all the elements included both in wordlist and in mystring
| Parameters: |
|
|---|
Return a dict from a key-value like string (or an empty dict, if there is no string)
| Parameters: |
|
|---|---|
| Returns: | a dict from a key-value like string (or an empty dict, if there is no string) |
>>> asDict('height=22, weight=73')
{'weight': '73', 'height': '22'}
>>> asDict('height=$myheight, weight=73', symbols={'myheight':55})
{'weight': '73', 'height': '55'}
Return False if the given obj string is one of the following values:
(the obj is lowered before comparing it)
| Parameters: | obj – The given object |
|---|
join two strings through the separator attribute sep. If the first string is None, return the second string.
| Parameters: |
|
|---|---|
| Returns: | a string with the two strings joined |
Return the number of the recurrence of the srcString string into the myString string
| Parameters: |
|
|---|---|
| Returns: | the number of the recurrence of the srcString into myString |
>>> a = 'hello hello heeeello hello helo hi'
>>> b = 'hello'
>>> countOf(a,b)
3
Return a text with all dot char escaped
| Parameters: | txt – the text |
|---|---|
| Returns: | the text with all dot char escaped |
Return a string that contains the given number in the specified base
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|---|
| Returns: | TODO |
TODO
| Parameters: | datestring – TODO |
|---|
TODO
| Parameters: | obj – TODO |
|---|
TODO
| Parameters: |
|
|---|
Return a string between two given chunks.
| Parameters: |
|
|---|---|
| Returns: | a string between two given chunks |
>>> getBetween('teststring', 'st','in')
'str'
>>> getBetween('teststring', 'st','te')
''
>>> getBetween('teststring', 'te','te')
''
Return a string after a given chunk
| Parameters: |
|
|---|---|
| Returns: | a string after a given chunk |
>>> getFrom('teststring', 'st')
'string'
>>> getFrom('teststring', 'te')
'ststring'
>>> getFrom('teststring', 'co')
''
Return a string after the last occurence of a given chunk.
| Parameters: |
|
|---|---|
| Returns: | a string after the last occurence of a given chunk |
>>> getFromLast('teststring', 'st')
'ring'
>>> getFromLast('teststring', 'ng')
''
>>> getFromLast('teststring', 'co')
''
Search in a string a chunk: if it is present, return all the characters before this chunk. If not, return an empty string (or the original one, if returnOriginal is True).
| Parameters: |
|
|---|---|
| Returns: | a string until a given chunk |
>>> getUntil('teststring', 'st')
'te'
>>> getUntil('teststring', 'te')
''
>>> getUntil('teststring', 'co')
''
>>> getUntil('teststring', 'co', returnOriginal=True)
'teststring'
Return a string until last occurence of a given chunk
| Parameters: |
|
|---|---|
| Returns: | a string until last occurence of a given chunk |
>>> getUntilLast('teststring', 'st')
'test'
>>> getUntilLast('teststring', 'te')
''
>>> getUntilLast('teststring', 'co')
''
TODO
| Parameters: |
|
|---|
Return True if ... Return False if ... TODO
| Parameters: |
|
|---|---|
| Wildcard : | a special string. Default value is % |
| Returns: | TODO |
TODO
| Parameters: | str_or_unicode – the string to be quoted |
|---|---|
| Returns: | TODO |
>>> print jsquote('pippo')
'pippo'
>>> print jsquote(u'pippo')
'pippo'
Return True if ... Return False if ... TODO
| Parameters: |
|
|---|---|
| Wildcard : | a special string. Default value is % |
| Returns: | TODO |
>>> like('*dog*', 'adogert', '*')
True
>>> like('dog*', 'adogert', '*')
False
>>> like('*dog', '*adogert', '*')
False
TODO
Return the Pickle string for the given object
| Parameters: |
|
|---|
Return a string obtained deleting from the given string any occurrency of the given pattern.
| Parameters: |
|
|---|---|
| Returns: | a string |
>>> regexDelete('When he turns the steering wheel', 'he')
'Wn turns t steering wel'
TODO
| Parameters: | value – TODO |
|---|
Join a list with the separator substring on escaping each occurrency of on within the given list
| Parameters: |
|
|---|---|
| Returns: | the joined string |
>>> smartjoin(['Hello, dog', 'you', 'are', 'yellow'], ',')
'Hello\, dog,you,are,yellow'
Split the string path with the separator substring on ignoring the escaped separator chars
| Parameters: |
|
|---|
Return a list splitting a path string at any occurrency of separation character.
| Parameters: |
|
|---|
>>> split('first.second.third')
['first', 'second', 'third']
Split a string in a list of n+1 items, striping white spaces.
| Parameters: |
|
|---|
>>> splitAndStrip('cola, beer, milk')
['cola', 'beer', 'milk']
>>> splitAndStrip('cola, beer, milk', n=2)
['cola', 'beer, milk']
Return a tuple of two strings created by splitting the string at the last occurence of a given chunk. If the chunk is not included in the string, return a tuple of two strings, with myString as the first one and with an empty string as the second one.
| Parameters: |
|
|---|---|
| Returns: | a tuple of two strings |
>>> splitLast('hello my dear friend', 'e')
('hello my dear fri', 'nd')
>>> splitLast(a, 'w')
('Hello my dear friend', '')
Return a string of key-value pairs taken from a dictionary.
| Parameters: |
|
|---|---|
| Returns: | a string of key-value pairs taken from a dictionary |
>>> stringDict({'height':22,'width':33})
'width=33,height=22'
Allow to replace string’s chunks.
| Parameters: |
|
|---|
>>> templateReplace('$foo loves $bar but she loves $aux and not $foo', {'foo':'John','bar':'Sandra','aux':'Steve'})
'John loves Sandra but she loves Steve and not John'
TODO
| Parameters: | obj – TODO |
|---|
TODO
| Parameters: | obj – TODO |
|---|
TODO
| Parameters: |
|
|---|
Return a unicode string representing an object of any class
If there are locale or format parameters Babel is used to format the value according to the given localization or format
| Parameters: |
|
|---|
Load an object from a pickle string and return it
| Parameters: |
|
|---|
Extract a zip compressed string and return it
| Parameters: |
|
|---|
Append a new s string to the source string. The two strings are linked by a sep char. If there isn’t source string, return the s string.
| Parameters: |
|
|---|
>>> updateString('I drink cola', 'beer')
'I drink cola,beer'
>>> updateString('I drink cola', 'beer', ' and ')
'I drink cola and beer'
TODO
| Parameters: |
|
|---|---|
| Returns: | TODO |
Return a list that contains the words of the given text
| Parameters: | text – text to be splitted |
|---|---|
| Returns: | a list that contains the words of the given text |
>>> wordSplit('hello, my dear friend')
['hello', 'my', 'dear', 'friend']
Return a zip compressed version of the mystring string
| Parameters: |
|
|---|