Re: Vim settings for Python (was: tab replace to space 4)

2019-12-08 Thread Peter J. Holzer
On 2019-12-07 11:59:31 -0800, Bill Campbell wrote:
> On Sat, Dec 07, 2019, Peter J. Holzer wrote:
> >As an aside, to prevent vim from inserting tabs in the first place, set
> >expandtab
> >sw=4
> >and maybe also
> >ts=4
> 
> Inserting a comment in the file like this makes thing easy.
> 
> # vim: expandtab sw=4 ts=4 nows wm=0

Yeah, I do that a lot.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Vim settings for Python (was: tab replace to space 4)

2019-12-07 Thread Bill Campbell
On Sat, Dec 07, 2019, Peter J. Holzer wrote:

>As an aside, to prevent vim from inserting tabs in the first place, set
>expandtab
>sw=4
>and maybe also
>ts=4

Inserting a comment in the file like this makes thing easy.

# vim: expandtab sw=4 ts=4 nows wm=0

Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www2.celestial.com/ 6641 E. Mercer Way
Mobile: (206) 947-5591  PO Box 820
Fax:(206) 232-9186  Mercer Island, WA 98040-0820

Political language... is designed to make lies sound truthful and
murder respectable, and to give an appearance of solidity to pure
wind. -- George Orwell
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Vim settings for Python (was: tab replace to space 4)

2019-12-07 Thread Bev In TX

> On Dec 7, 2019, at 4:16 AM, Peter J. Holzer  wrote:
> 
> As an aside, to prevent vim from inserting tabs in the first place, set
>expandtab
>sw=4
> and maybe also
>ts=4
> (The latter is very much a matter of taste. I don't unless I have to
> edit code which already contains tabs intended to be at a certain width.)

I’m not the OP, but I do appreciate this info.  Thanks!
Bev in TX
-- 
https://mail.python.org/mailman/listinfo/python-list


Vim settings for Python (was: tab replace to space 4)

2019-12-07 Thread Peter J. Holzer
On 2019-11-29 13:46:38 +0900, 황병희 wrote:
> usally i write python code in gnu emacs on ubuntu 18.04 sometimes i
> re-edit the code vim in same machine so often when i do run the code in
> shell like as ./test.py i meet consol error -- which line wrong!
> 
> so i am considering how can i replace all tab to space 4 within python

As an aside, to prevent vim from inserting tabs in the first place, set
expandtab
sw=4
and maybe also
ts=4
(The latter is very much a matter of taste. I don't unless I have to
edit code which already contains tabs intended to be at a certain width.)

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-12-02 Thread 황병희
Hi, Gilmeh^^^

> We are Python people, aren't we?

Looks good, i did copy it [1], and thanks^^^

[1] https://gitlab.com/soyeomul/test/blob/master/untabify.py

Sincerely,

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4 (rmlibre)

2019-12-01 Thread rmlibre
> Its just that I've just began to touch tkinter, and would like to know of
> bug-related pitfalls before I waste energy on trying to figure out what I
> did wrong. :-\

One thing which is not obvious or easy to debug: Text widgets have some
kind of 
inefficiency related to really long lines that don't have line breaks.
The 
result is that your cpu will be completely gobbled up if you have a
sufficiently
long line. I haven't run any tests to get an accurate view of what the
breaking 
point is. But one the cores in my cpu was hold up at 100% when
displaying 
many many thousands of characters without line breaks. After lots of
debugging
and optimization finding, I just happened to google for "cpu load issue
with" 
each of the widgets I was using and discovered that this indeed was the
cause
of the cpu load. Swapping in line breaks at regular, known intervals
quickly
fixed this.

tl;dr
Google for "issue with tkinter " for the widgets you'll be
using, or 
" with tkinter" if you're experiencing a particular issue and are
not 
sure if it could be caused for some reason by tkinter.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread R.Wieser
Terry,

> I have been using tk/tkinter based IDLE for over a decade on Windows with 
> very few issues.  I think they are similarly stable on linux, etc.
[Snip]

Thanks for that explanation.

And I see that, in my question, I should have asked for the involved OS too.

Regards,
Rudy Wieser


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread Terry Reedy

On 11/29/2019 3:05 PM, R.Wieser wrote:

Terry,



Its just that I've just began to touch tkinter, and would like to know of
bug-related pitfalls before I waste energy on trying to figure out what I
did wrong. :-\


I have been using tk/tkinter based IDLE for over a decade on Windows 
with very few issues.  I think they are similarly stable on linux, etc.


macOS has been more problematical since Apple a) still provides the 
ancient (15 years old?) and buggy tcl/tk 8.5.9 and b) keeps changing 
things in its Aqua graphics, so that different tk releases has different 
bugs.  tcl/tk on macOS has gotten lots of work in the last few years and 
the devs claim that the brand new 8.6.10 should solve most of the 
problems.  Since 8.7.0, our macOS installer has included a recent 8.6.x. 
 It is possible that the upcoming 3.8.1 will include tk 8.6.10 if our 
tests verify the claims.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread R.Wieser
Terry,

> R.W., are you reading via c.l.p, or the python google group?

The first, using nntp.aioe.org

> Don't hold your breath.  A similar poster I challenged on StackOverflow 
> was honest enough to admit that he had not touched IDLE for a decade.

Its just that I've just began to touch tkinter, and would like to know of 
bug-related pitfalls before I waste energy on trying to figure out what I 
did wrong. :-\

Also, not asking at all makes sure my chances of getting an answer is zero. 
:-)

Regards,
Rudy Wieser


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread Terry Reedy

On 11/29/2019 4:34 AM, R.Wieser wrote:


Moi,


tkinter/IDLE in py380 : completely buggy.


That troll post is not in the python-list archive (whereas RW's response 
is), so it is likely from someone banned on the list itself. R.W., are 
you reading via c.l.p, or the python google group?



Example code please ?  (plus a description of what should happen and what
happens instead if you have it)


Don't hold your breath.  A similar poster I challenged on StackOverflow 
was honest enough to admit that he had not touched IDLE for a decade.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread 황병희
Hello, Pankaj^^^

> In Emacs, use "M-x untabify". [...]

Then i solved problem You nice guy!

Sincerely,

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


tab replace to space 4

2019-11-29 Thread 황병희
[i am writing question on comp.lang.python]

usally i write python code in gnu emacs on ubuntu 18.04 sometimes i
re-edit the code vim in same machine so often when i do run the code in
shell like as ./test.py i meet consol error -- which line wrong!

so i am considering how can i replace all tab to space 4 within python
code. if there is solution in google i am very sorry.

thanks all and any comments welcome^^^

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread R.Wieser


Moi,

> tkinter/IDLE in py380 : completely buggy.

Example code please ?  (plus a description of what should happen and what 
happens instead if you have it)

Regards,
Rudy Wieser


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-29 Thread Terry Reedy

On 11/29/2019 1:53 AM, Pankaj Jangid wrote:

황병희  writes:

usally i write python code in gnu emacs on ubuntu 18.04 sometimes i
re-edit the code vim in same machine so often when i do run the code in
shell like as ./test.py i meet consol error -- which line wrong!

so i am considering how can i replace all tab to space 4 within python
code. if there is solution in google i am very sorry.


In Emacs, use "M-x untabify". And "M-x tabify" if you want to do the
reverse.


IDLE has entries on the Format menu to do the same.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: tab replace to space 4

2019-11-28 Thread Pankaj Jangid
황병희  writes:
> usally i write python code in gnu emacs on ubuntu 18.04 sometimes i
> re-edit the code vim in same machine so often when i do run the code in
> shell like as ./test.py i meet consol error -- which line wrong!
>
> so i am considering how can i replace all tab to space 4 within python
> code. if there is solution in google i am very sorry.

In Emacs, use "M-x untabify". And "M-x tabify" if you want to do the
reverse.

Regards,
-- 
Pankaj Jangid
-- 
https://mail.python.org/mailman/listinfo/python-list