![]() |
#4
|
|||
|
|||
![]()
Thank you for the input. The reason I want to convert indents to tabs or spaces is that I downloaded a PDF copy (more than 1000 pages) of a book I bought. The book is a computer programming book. I want to convert the PDF to an MS Word because then I can copy the code parts and paste them on my editor so I can run them without having to indent them manually and indenting is important for this language.
Here is an example. The general text, the first 2 lines and the last one, and the indented code in between. I want if possible to select-or any other way- all the code parts and replace indents with tab or spaces. …..only when the file is run as a top-level script, not when it is imported (this new version of the module file is renamed minmax2.py here): print(‘I am:’, name) def minmax(test, *args): res = args[0] for arg in args[1:]: if test(arg, res): res = arg return res We’re also printing the value of nameat the top here to trace its value. Python creates and……. PS..i hope the indents are visible when posted |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Catty | Word VBA | 1 | 12-11-2013 03:57 PM |
Words in my document were converted to numbers???? | MikeD23 | Word | 1 | 08-26-2012 11:09 AM |
Can you see how much time I worked on Word 2007/2010 document when converted to PDF? | Papa Bear | Word | 1 | 08-14-2012 05:14 AM |
My plain text post got converted to rich text in a reply, how to convert it back? | david.karr | Outlook | 0 | 01-05-2012 09:46 AM |
![]() |
gonner | Word | 1 | 09-10-2011 03:25 AM |