All,
Is there a pretty printing utility for Python, something like Tidy for
HTML?
That will change:
xp=self.uleft[0]+percentx*(self .xwidth)
To:
xp = self.uleft[0] + percentx * (self.xwidth)
And other formatting issues. 5 2097
On Sat, 07 Jul 2007 21:35:40 +0300, David <dw********@sud denlink.net
wrote:
>
All,
Is there a pretty printing utility for Python, something like Tidy for
HTML?
That will change:
xp=self.uleft[0]+percentx*(self .xwidth)
To:
xp = self.uleft[0] + percentx * (self.xwidth)
And other formatting issues.
Why not just write python as it should be written?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Daniel:
On Sat, 07 Jul 2007 21:35:40 +0300, David <dw********@sud denlink.net>
wrote:
>Is there a pretty printing utility for Python, something like Tidy for HTML?
Why not just write python as it should be written?
Oh, you write all the code you use yourself?
It's relatively common that you have some "legacy" code (e.g. from
(ex-)colleages) that doesn't conform to your style preferences/your
companys coding guidelines.
In such a case those tools can be very helpful.
--
Thomas Wittek http://gedankenkonstrukt.de/
Jabber: st*********@jab ber.i-pobox.net
On Jul 8, 10:59 am, j...@pobox.com (John J. Lee) wrote:
David <dwarnol...@sud denlink.netwrit es:
Is there a pretty printing utility for Python, something like Tidy for
HTML?
That will change:
xp=self.uleft[0]+percentx*(self .xwidth)
To:
xp = self.uleft[0] + percentx * (self.xwidth)
And other formatting issues.
Googled and found these; no idea if they're any good (latter is
commercial):
http://cheeseshop.python.org/pypi/PythonTidy/1.11
http://python.softalizer.com/
See also:
http://svn.python.org/view/python/tr...eindent.py?vie...
John
I did this useing the BeautifulSoup module.
Used it on XML created by msWord which had no formating was
all on one line.
>>import BeautifulSoup soupStr = open('c:/data/quotes.xml').re ad() soup = BeautifulSoup.B eautifulSoup(so upStr) pSoup = soup.prettify() outFile = open('c:/data/quotesTidy.xml' ,'w') outFile.write (pSoup) outFile.close ()
On Jul 8, 1:53 pm, bsneddon <bsned...@yahoo .comwrote:
On Jul 8, 10:59 am, j...@pobox.com (John J. Lee) wrote:
David <dwarnol...@sud denlink.netwrit es:
Is there a pretty printing utility for Python, something like Tidy for
HTML?
That will change:
xp=self.uleft[0]+percentx*(self .xwidth)
To:
xp = self.uleft[0] + percentx * (self.xwidth)
And other formatting issues.
Googled and found these; no idea if they're any good (latter is
commercial):
http://cheeseshop.python.org/pypi/PythonTidy/1.11 http://python.softalizer.com/
See also:
http://svn.python.org/view/python/tr...eindent.py?vie...
John
I did this useing the BeautifulSoup module.
Used it on XML created by msWord which had no formating was
all on one line.
>import BeautifulSoup soupStr = open('c:/data/quotes.xml').re ad() soup = BeautifulSoup.B eautifulSoup(so upStr) pSoup = soup.prettify() outFile = open('c:/data/quotesTidy.xml' ,'w') outFile.write( pSoup) outFile.close( )
Sorry, I answered the wrong question.
You wanted to format code not HTML. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Guenther Schmidt |
last post by:
Hi,
is it possible to have PHP pretty print the HTML output?
Günther
|
by: Anthony |
last post by:
I love the HTML Cleaner-upper Tidy... http://tidy.sourceforge.net and I use
it ALL the time after running my .asp's... however (As you can imagine)..
this is a longer process then I want... :
For example :
Run .asp save source, run tidy, examine html source determine where the
error is (IN what line) go to my .asp and find where the html is generated
from... fix it.. run again
|
by: Mike |
last post by:
Greetings,
I just used Tidy HTML for the first time.
The address below contains the files need to check on Tidy's
corrections.
I would appreciate any feedback on the Tidy report and the necessity
and validity of the changes Tidy has made or recommended.
The following is obvious to me:
line 194 column 98 - Warning: discarding unexpected </font>
|
by: Christoph Schneegans |
last post by:
Hi!
I'd like to present an easy, yet powerful approach to use the HTML
Tidy program from <http://tidy.sourceforge.net/> in ASP.NET. It is
similiar to
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/tchVSAddinEnablingHTMLTidy.asp>.
However, it is not implemented as a Visual Studio Add-in, but as a
response filter. This way, the complete HTML source is tidied,
including the output of web controls.
|
by: VK |
last post by:
Hi,
After the response on my request from W3C I'm still unclear about Tidy
vs. Validator discrepansies. That started with <IFRAME> issue, but
there is more as I know. Anyway, this very basic HTML page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"
"http://www.w3.org/TR/html401/strict.dtd">
<html>
<head>
| |
by: Sebastian Gohres |
last post by:
Hi!
First: sorry for my bad english :)
If I parse template files, html tidy remove all tags beginning with {
for example:
before:
<select name="country" size="1">
|
by: BG Mahesh |
last post by:
hi
I have installed Tidy on Fedore Core 4.0 using RPM. I have a very
simple script that uses tidy,
------------tidy.php------------------
<html>a html document</html>
<?
$html = ob_get_clean();
// Specify configuration
|
by: Carmen Sei |
last post by:
I need to parse HTML page and extract data
should I use HTML Tidy DLL
http://dev.int64.org/tidy.html
or it's easier to use library with source code like
http://users.rcn.com/creitzel/tidy.html#cplusplus
which HTML Tidy C++ version (easiest) should I use for C++ project?
|
by: tobycraftse |
last post by:
any example shows how to use HTML Tidy in VC++ project?
I need to parse HTML page and extract data
should I use HTML Tidy DLL
http://dev.int64.org/tidy.html
or it's easier to use library with source code like
http://users.rcn.com/creitzel/tidy.html#cplusplus
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |