git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python indentation (3 spaces)


On Sunday 07 October 2018 14:30:04 Chris Angelico wrote:

> On Mon, Oct 8, 2018 at 5:20 AM Gene Heskett <gheskett at shentel.net> 
wrote:
> > This poster is 200% correct. Somewhere, someplace, there should be
> > easily found rule that dictates where one can use a tab, and where
> > spaces only are allowed.
>
> Ask the people who maintain makefiles whether that's a good thing or
> not. HINT: Many will say no.
>
> > > > That
> > > > said, there is an easy fix for tab misuse: in Visual Studio
> > > > Code, you can replace all Tabs with Spaces by highlighting the
> > > > entire code block, hitting Tab once and Shift-Tab after.
> >
> > But that automatically assumes one is running in a windows
> > environment. I don't allow it on the premises if I own the machine.
> > Are there good, alternatives that run on linux?
>
> VSCode runs on Linux. Also, there are easy ways to do the same sort of
> thing in many editors that I've used.
>
> > > IDLE does that also.
> >
> > And idle for python-2.7 runs on linux.
>
> (Not sure why you specifically say 2.7, as IDLE for any version of
> Python runs on Linux, far as I know.)
>
3.5+ has not, and never will arrive on wheezy. We've a stretch based lcnc 
installer now, but I've got stretch on 2 machines now, and I'm not 
impressed. Making networking actually work makes work a 4 letter word.

> > We have a mostly python app called
> > camview that runs on and with LinuxCNC. Giving us the ability to
> > mark a feature on a workpiece, and create a set of co-ordinates that
> > autoaligns the workpiece and a about to be carved code. But with a
> > 640x480 camera, the view dies if the display window its given is
> > equal to or larger, at which point it dies/goes away, whatever, and
> > the only way to restore it to operational status is to reboot the
> > machine.
> >
> > I've installed idle on that particular machine, and will see if it
> > will call my attention to bad coding. I'll be most appreciative if
> > it can find something that will make this code Just Work(TM).  Thank
> > you for mentioning it, Terry.
>
> I don't understand what any of this has to do with anything. Do you
> suspect that your code is fraught with indentation bugs?

Not sure where the problem is Chris, but A: its not my code, and B: a 
potentially very useful machine vision utility to a cnc machinist 
actually works like the teats on a boar hog. Useless if it cannot be 
actually used on a daily basis. I've tried to make it work with pyvcp, 
and with gladevcp. Essentially the same errors (none reported) and 
behavior on both gui interfaces. With 3 different cameras. That, in 3 
versions of it, is the main reason I've been mostly lurking on this list 
for several years.

> If so, pretty 
> much ANY Python-aware editor will help you, as will Python 3.x, as
> will Python2 with the "-tt" option.
>
> ChrisA

Thanks ChrisA.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>