¡@

Home 

python Programming Glossary: text

Decode HTML entities in Python string?

http://stackoverflow.com/questions/2087370/decode-html-entities-in-python-string

import BeautifulSoup soup BeautifulSoup p pound 682m p text soup.find p .string print text pound 682m print html.fromstring.. p pound 682m p text soup.find p .string print text pound 682m print html.fromstring text .text £682m So I'm trying.. p .string print text pound 682m print html.fromstring text .text £682m So I'm trying to produce the same string that lxml..

How do I download a file over HTTP using Python?

http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python

podcast XML file which I've obviously added to iTunes. The text processing that creates updates the XML file is written in Python...

Print in terminal with colors using Python?

http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python

176 177 178 and 219 are the block characters . Some modern text based programs such as Dwarf Fortress emulate text mode in a.. modern text based programs such as Dwarf Fortress emulate text mode in a graphical mode and use images of the classic PC font... Mode Demo Contest has more resources for doing graphics in text mode. Hmm.. I think got a little carried away on this answer...

Extracting text from HTML file using Python

http://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python

text from HTML file using Python I'd like to extract the text from.. text from HTML file using Python I'd like to extract the text from an HTML file using Python. I want essentially the same.. essentially the same output I would get if I copied the text from a browser and pasted it into notepad. I'd like something..

What kinds of patterns could I enforce on the code to make it easier to translate to another programming language?

http://stackoverflow.com/questions/3455456/what-kinds-of-patterns-could-i-enforce-on-the-code-to-make-it-easier-to-translat

application of translation rules regeneration of source text with comments etc. all parameterized by explicit definitions.. that are hard to translate understand and modify in the context of another 80 000 lines of translated program you already don't..

Search and replace a line in a file in Python

http://stackoverflow.com/questions/39086/search-and-replace-a-line-in-a-file-in-python

in a file in Python I want to loop over the contents of a text file and do a search and replace on some lines and write the..

What is the best way to remove accents in a python unicode string?

http://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string

Python, Unicode, and the Windows console

http://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console

details the problem and a solution search the page for the text Wrapping sys.stdout into an instance PrintFails Python Wiki..

Recommendations of Python REST (web services) framework? [closed]

http://stackoverflow.com/questions/713847/recommendations-of-python-rest-web-services-framework

json localhost 8080 x 'message' 'Hello x ' curl H Accept text plain localhost 8080 x Hello x Update April 2012 added information..

Strip HTML from strings in Python

http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python

formatting itself. If it finds ' a href whatever.com some text a ' it will only print 'some text' ' b hello b ' prints 'hello'.. a href whatever.com some text a ' it will only print 'some text' ' b hello b ' prints 'hello' etc. How would one go about doing..

How to get line count cheaply in Python?

http://stackoverflow.com/questions/845058/how-to-get-line-count-cheaply-in-python

f pass return i 1 is it possible to do any better python text files line count share improve this question You can't get..

Sublime Text 2 console input

http://stackoverflow.com/questions/10604409/sublime-text-2-console-input

Text 2 console input I use Sublime Text 2 but it won't let me enter.. Text 2 console input I use Sublime Text 2 but it won't let me enter any value when my code asks for.. anything . Simply USER INPUT isn't working in Sublime Text 2 for me. EDIT FOR EXAMPLE try text input 'Enter something '..

Inserting Line at Specified Position of a Text File in Python

http://stackoverflow.com/questions/1325905/inserting-line-at-specified-position-of-a-text-file-in-python

Line at Specified Position of a Text File in Python I have a text file which looks like this blah..

Text difference algorithm

http://stackoverflow.com/questions/145607/text-difference-algorithm

difference algorithm I need an algorithm that can compare two..

BeautifulSoup Grab Visible Webpage Text

http://stackoverflow.com/questions/1936466/beautifulsoup-grab-visible-webpage-text

Grab Visible Webpage Text Basically I want to use BeautifulSoup to grab strictly the..

How can I add post-install scripts to easy_install / setuptools / distutils?

http://stackoverflow.com/questions/250038/how-can-i-add-post-install-scripts-to-easy-install-setuptools-distutils

'Topic Software Development' 'Topic Utilities' 'Topic Text Editors' EDIT Here's a stub which demonstrates the python setup.py..

Print in terminal with colors using Python?

http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python

on the Dwarf Fortress Wiki see user made tilesets . The Text Mode Demo Contest has more resources for doing graphics in text..

Text Progress Bar in the Console

http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console

Progress Bar in the Console Is there a good way to do the following..

How to bind self events in Tkinter Text widget after it will binded by Text widget?

http://stackoverflow.com/questions/3501849/how-to-bind-self-events-in-tkinter-text-widget-after-it-will-binded-by-text-widg

to bind self events in Tkinter Text widget after it will binded by Text widget So I want to bind.. self events in Tkinter Text widget after it will binded by Text widget So I want to bind self events after Text widget bind.. binded by Text widget So I want to bind self events after Text widget bind it and change text in widget. Usual 'bind' is called..

How to make python 3 print() utf8

http://stackoverflow.com/questions/3597480/how-to-make-python-3-print-utf8

in utf8 ... or how to output raw bytes.. Test.py TestText Test ..š ūŪžŽ # this is UTF 8 TestText2 b Test2 xc4 x81 xc4.. bytes.. Test.py TestText Test ..š ūŪžŽ # this is UTF 8 TestText2 b Test2 xc4 x81 xc4 x80 xc4 x93 xc4 x92 xc4 x8d xc4 x8c.. xc5.. sys.getdefaultencoding print sys.stdout.encoding print TestText print TestText.encode utf8 print TestText.encode cp1252 replace..

Python regular expression matching a multiline block of text

http://stackoverflow.com/questions/587345/python-regular-expression-matching-a-multiline-block-of-text

text. I'd like match.group 1 to be some_ Varying_ Text and group 2 to be line1 line2 line3 etc until the empty line..

How to capture output of Python's interpreter and show in a Text widget?

http://stackoverflow.com/questions/8356336/how-to-capture-output-of-pythons-interpreter-and-show-in-a-text-widget

to capture output of Python's interpreter and show in a Text widget I have a program in Python with PyQt designed to run.. that all that info appears in the main application in a QTextEdit or so. How can i make the program work so it gets the output.. class MyStream object def write self text # Add text to a QTextEdit... sys.stdout MyStream sys.stderr MyStream If you ever need..

How do I run Python code from Sublime Text 2?

http://stackoverflow.com/questions/8551735/how-do-i-run-python-code-from-sublime-text-2

do I run Python code from Sublime Text 2 I want to set up a complete Python IDE in Sublime Text 2... Text 2 I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the..

Parameter substitution for a SQLite “IN” clause

http://stackoverflow.com/questions/1309989/parameter-substitution-for-a-sqlite-in-clause

TABLE distro id INTEGER PRIMARY KEY AUTOINCREMENT name TEXT ' for name in 'Ubuntu Fedora Puppy DSL SuSE'.split c.execute..

Is there a Python module for converting RTF to plain text?

http://stackoverflow.com/questions/1337446/is-there-a-python-module-for-converting-rtf-to-plain-text

will probably be pretty easy to wrap it up in python. RTF TEXT Converter Perl extension for converting RTF into text . in case..

How to delete a row from a listbox in TKinter and SQLite3

http://stackoverflow.com/questions/19738499/how-to-delete-a-row-from-a-listbox-in-tkinter-and-sqlite3

conn.execute ''' CREATE TABLE IF NOT EXISTS people name TEXT primary key age TEXT phone TEXT fblink TEXT ''' c.execute insert.. TABLE IF NOT EXISTS people name TEXT primary key age TEXT phone TEXT fblink TEXT ''' c.execute insert into people values.. IF NOT EXISTS people name TEXT primary key age TEXT phone TEXT fblink TEXT ''' c.execute insert into people values item item2..

Convert a curl POST request to Python only using standard libary

http://stackoverflow.com/questions/1990976/convert-a-curl-post-request-to-python-only-using-standard-libary

X H 'Content Type application json' d ' message body TEXT ' http sample.com 36576 speak.json TEXT is what i would like.. d ' message body TEXT ' http sample.com 36576 speak.json TEXT is what i would like to replace with a message generated by.. curl itself though you can just invoke os.system import os TEXT ... cmd curl u 7898678 X H 'Content Type application json' d..

Python regular expression matching a multiline block of text

http://stackoverflow.com/questions/587345/python-regular-expression-matching-a-multiline-block-of-text

lines. The example text is ' n' is a newline some Varying TEXT n n DSJFKDAFJKDAFJDSAKFJADSFLKDLAFKDSAF n more of the above.. times . I'd like to capture two things the 'some_Varying_TEXT' part and all of the lines of uppercase text that comes two..

Sending Email With Python

http://stackoverflow.com/questions/6270782/sending-email-with-python

TO jon@mycompany.com # must be a list SUBJECT Hello TEXT This message was sent with Python's smtplib. # Prepare actual.. message From s To s Subject s s FROM .join TO SUBJECT TEXT # Send the mail server smtplib.SMTP 'myserver' server.sendmail.. it in a function like this def sendMail FROM TO SUBJECT TEXT SERVER import smtplib this is some test documentation in the..

How to convert Python decimal to SQLite numeric?

http://stackoverflow.com/questions/6319409/how-to-convert-python-decimal-to-sqlite-numeric

register an adapter to transparently convert Decimals to TEXT when inserting and a converter to transparently convert TEXT.. when inserting and a converter to transparently convert TEXT into Decimals when fetching . The following is a lightly modified..