- Previous thread: [opensuse] 11.2 and Ext4 and Reiserfs
- Next thread: [opensuse] MESA xorg Patch set
- Threads sorted by date: opensuse 200906
I have just learnt, to my dismay, that python syntax is sensitive to indent=
ation, even if python is supposed to be a modern language ...=0AI figured t=
hat out when I used Mac textEditor to copy some lines from a python script =
and paste them into the pdb text window for debugging.=0A=0ASince I will be=
using SuSE systems to debug such a script, my question is:=0Ado you know o=
f an editor, running on SuSE, which does not cut off the precious indentati=
on characters making a mess of a python script ?=0AFor instance, Emacs won'=
t work for this particular problem.=0A=0ASome time ago I got an editor runn=
ing on Windows (on campus I had to use a Windows box) named "UltraEdit" (I =
am not sure the spelling is right).=0AIt was a very flexible editor tta cou=
ld be configured for performing very basic as well as very sophisticated ed=
iting functions.=0AI wonder whether something similar is available on Linux=
platforms.=0A=0AThank you so much,=0AMaura=0A=0A=0A=0A
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 15 June 2009 13:28:48, Maura Monville wrote:
> I have just learnt, to my dismay, that python syntax is sensitive to
> indentation, even if python is supposed to be a modern language ... I
> figured that out when I used Mac textEditor to copy some lines from a
> python script and paste them into the pdb text window for debugging.
>
> Since I will be using SuSE systems to debug such a script, my question is:
> do you know of an editor, running on SuSE, which does not cut off the
> precious indentation characters making a mess of a python script ? For
> instance, Emacs won't work for this particular problem.
>
> Some time ago I got an editor running on Windows (on campus I had to use a
> Windows box) named "UltraEdit" (I am not sure the spelling is right). It
> was a very flexible editor tta could be configured for performing very
> basic as well as very sophisticated editing functions. I wonder whether
> something similar is available on Linux platforms.
>
> Thank you so much,
> Maura
I love kwrite :-)
it doesn't do anything you don't tell it to do and leaves everything as you
typed/copied it, unless you set it up different. It also has a very good
syntax highlighting and other helpers...
Daniel
--
Daniel Bauer photographer Basel Barcelona
professional photography: http://www.daniel-bauer.com
erotic art photos: http://www.bauer-nudes.com
Madagascar special: http://www.fotograf-basel.ch/madagascar/
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> I have just learnt, to my dismay, that python syntax is sensitive to
> indentation, even if python is supposed to be a modern language ... I
> figured that out when I used Mac textEditor to copy some lines from a
> python script and paste them into the pdb text window for debugging.
>
> Since I will be using SuSE systems to debug such a script, my question is:
> do you know of an editor, running on SuSE, which does not cut off the
> precious indentation characters making a mess of a python script ? For
> instance, Emacs won't work for this particular problem.
>
> Some time ago I got an editor running on Windows (on campus I had to use a
> Windows box) named "UltraEdit" (I am not sure the spelling is right). It
> was a very flexible editor tta could be configured for performing very
> basic as well as very sophisticated editing functions. I wonder whether
> something similar is available on Linux platforms.
>
> Thank you so much,
> Maura
I love kwrite :-)
it doesn't do anything you don't tell it to do and leaves everything as you
typed/copied it, unless you set it up different. It also has a very good
syntax highlighting and other helpers...
Daniel
--
Daniel Bauer photographer Basel Barcelona
professional photography: http://www.daniel-bauer.com
erotic art photos: http://www.bauer-nudes.com
Madagascar special: http://www.fotograf-basel.ch/madagascar/
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Maura Monville wrote:
> I have just learnt, to my dismay, that python syntax is sensitive to indentation, even if python is supposed to be a modern language ...
> I figured that out when I used Mac textEditor to copy some lines from a python script and paste them into the pdb text window for debugging.
>
One of the reasons I never explored Python .... I believe Eclipse has
some Python addons which may be useful....(includes a debugger IIRC)....
Get Eclipse from the Eclipse site (the SuSE build works but you may run
into problems with installing some plugins with it)....
Eclipse should run on anything with a Java JRE/SDK installed...
> Since I will be using SuSE systems to debug such a script, my question is:
> do you know of an editor, running on SuSE, which does not cut off the precious indentation characters making a mess of a python script ?
> For instance, Emacs won't work for this particular problem.
>
> Some time ago I got an editor running on Windows (on campus I had to use a Windows box) named "UltraEdit" (I am not sure the spelling is right).
> It was a very flexible editor tta could be configured for performing very basic as well as very sophisticated editing functions.
> I wonder whether something similar is available on Linux platforms.
>
> Thank you so much,
> Maura
>
>
>
>
- --
==============================================================================
I have always wished that my computer would be as easy to use as my
telephone.
My wish has come true. I no longer know how to use my telephone.
Bjarne Stroustrup
==============================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAko2N70ACgkQasN0sSnLmgLISQCePMhDDw+vY3HSWGvAXccowUHU
/C0AnRf/a4fgIl1nxhCC4Q0EaSTHOix7
=etFL
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Hash: SHA1
Maura Monville wrote:
> I have just learnt, to my dismay, that python syntax is sensitive to indentation, even if python is supposed to be a modern language ...
> I figured that out when I used Mac textEditor to copy some lines from a python script and paste them into the pdb text window for debugging.
>
One of the reasons I never explored Python .... I believe Eclipse has
some Python addons which may be useful....(includes a debugger IIRC)....
Get Eclipse from the Eclipse site (the SuSE build works but you may run
into problems with installing some plugins with it)....
Eclipse should run on anything with a Java JRE/SDK installed...
> Since I will be using SuSE systems to debug such a script, my question is:
> do you know of an editor, running on SuSE, which does not cut off the precious indentation characters making a mess of a python script ?
> For instance, Emacs won't work for this particular problem.
>
> Some time ago I got an editor running on Windows (on campus I had to use a Windows box) named "UltraEdit" (I am not sure the spelling is right).
> It was a very flexible editor tta could be configured for performing very basic as well as very sophisticated editing functions.
> I wonder whether something similar is available on Linux platforms.
>
> Thank you so much,
> Maura
>
>
>
>
- --
==============================================================================
I have always wished that my computer would be as easy to use as my
telephone.
My wish has come true. I no longer know how to use my telephone.
Bjarne Stroustrup
==============================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAko2N70ACgkQasN0sSnLmgLISQCePMhDDw+vY3HSWGvAXccowUHU
/C0AnRf/a4fgIl1nxhCC4Q0EaSTHOix7
=etFL
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Maura Monville wrote:
>=20
> I have just learnt, to my dismay, that python syntax is sensitive to
> indentation, even if python is supposed to be a modern language=20
I thought the fact that python uses indentation to indicate blocks of
code was one of the distinguishing features of Python. =20
> Since I will be using SuSE systems to debug such a script, my questio=
n
> is: do you know of an editor, running on SuSE, which does not cut off=
> the precious indentation characters making a mess of a python script =
?
vi?
/Per =20
--=20
Per Jessen, Z=C3=BCrich (20.2=C2=B0C)
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
>=20
> I have just learnt, to my dismay, that python syntax is sensitive to
> indentation, even if python is supposed to be a modern language=20
I thought the fact that python uses indentation to indicate blocks of
code was one of the distinguishing features of Python. =20
> Since I will be using SuSE systems to debug such a script, my questio=
n
> is: do you know of an editor, running on SuSE, which does not cut off=
> the precious indentation characters making a mess of a python script =
?
vi?
/Per =20
--=20
Per Jessen, Z=C3=BCrich (20.2=C2=B0C)
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Daniel Bauer said the following on 06/15/2009 07:53 AM:
>
> I love kwrite :-)
> it doesn't do anything you don't tell it to do and leaves everything as you
> typed/copied it, unless you set it up different. It also has a very good
> syntax highlighting and other helpers...
Indeed, and so does VIM and a number of other editors.
How much complexity do you want to deal with?
--
Clear the battlefield and let me see
All the profit from our victory.
You talk of freedom, starving children poor.
Are you deaf when you hear the season's call?
Were you there to watch the earth be scorched?
Did you stand beside the spectral torch?
Know the leaves of sorrow turned their face,
Scattered on the ashes of disgrace.
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
>
> I love kwrite :-)
> it doesn't do anything you don't tell it to do and leaves everything as you
> typed/copied it, unless you set it up different. It also has a very good
> syntax highlighting and other helpers...
Indeed, and so does VIM and a number of other editors.
How much complexity do you want to deal with?
--
Clear the battlefield and let me see
All the profit from our victory.
You talk of freedom, starving children poor.
Are you deaf when you hear the season's call?
Were you there to watch the earth be scorched?
Did you stand beside the spectral torch?
Know the leaves of sorrow turned their face,
Scattered on the ashes of disgrace.
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Maura Monville said the following on 06/15/2009 07:28 AM:
> Since I will be using SuSE systems to debug such a script, my
> question is: do you know of an editor, running on SuSE, which does
> not cut off the precious indentation characters making a mess of a
> python script ? For instance, Emacs won't work for this particular
> problem.
VI - VIM.
There is(are) a switch(es) to control whether tabs get expanded an how
they get 'expanded' on screen - or not.
I'd expect emacs to have one too but I've never been tempted to use
that. VI/VIM has serve me well for 27 years.
--
He had occasional flashes of silence, that made his conversation
perfectly delightful.
Sydney Smith, referring to Macaulay
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> Since I will be using SuSE systems to debug such a script, my
> question is: do you know of an editor, running on SuSE, which does
> not cut off the precious indentation characters making a mess of a
> python script ? For instance, Emacs won't work for this particular
> problem.
VI - VIM.
There is(are) a switch(es) to control whether tabs get expanded an how
they get 'expanded' on screen - or not.
I'd expect emacs to have one too but I've never been tempted to use
that. VI/VIM has serve me well for 27 years.
--
He had occasional flashes of silence, that made his conversation
perfectly delightful.
Sydney Smith, referring to Macaulay
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Maura Monville wrote:
> For instance, Emacs won't work for this particular problem.
I don't use emacs or python but ...
'make' files depend on tabs being in exactly the right place and I'd be
astounded if emacs can't be used to edit make files!
It also seems rather strange that there are apparently two Python modes
for emacs if it can't be used to edit python :)
http://www.emacswiki.org/emacs/PythonMode
So my bet is that emacs can be used to edit python. How much do I win?
Cheers, Dave
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> For instance, Emacs won't work for this particular problem.
I don't use emacs or python but ...
'make' files depend on tabs being in exactly the right place and I'd be
astounded if emacs can't be used to edit make files!
It also seems rather strange that there are apparently two Python modes
for emacs if it can't be used to edit python :)
http://www.emacswiki.org/emacs/PythonMode
So my bet is that emacs can be used to edit python. How much do I win?
Cheers, Dave
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
G T Smith wrote:
> Eclipse should run on anything with a Java JRE/SDK installed...
Surely if eclipse was any good, it would have been written in C and GTK+
;-P
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> Eclipse should run on anything with a Java JRE/SDK installed...
Surely if eclipse was any good, it would have been written in C and GTK+
;-P
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
On 15.06.2009, Maura Monville wrote:
> For instance, Emacs won't work for this particular problem.
That's not true, you just have to autoload "python-mode" in your .emacs to
get it working.
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> For instance, Emacs won't work for this particular problem.
That's not true, you just have to autoload "python-mode" in your .emacs to
get it working.
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 15 June 2009 08:16:16 am Anton Aylward wrote:
> Daniel Bauer said the following on 06/15/2009 07:53 AM:
> > I love kwrite :-)
> > it doesn't do anything you don't tell it to do and leaves everything as
> > you typed/copied it, unless you set it up different. It also has a very
> > good syntax highlighting and other helpers...
>
> Indeed, and so does VIM and a number of other editors.
>
> How much complexity do you want to deal with?
>
>
Although I'm not a master at VIM I have been using it for years along with=
=20
kwirte for scripting and programming and they both have done their job and=
=20
done it well
=2D-=20
"We must plan for freedom, and not only for security, if for no other reaso=
n=20
than only freedom can make security more secure." Karl Popper
> Daniel Bauer said the following on 06/15/2009 07:53 AM:
> > I love kwrite :-)
> > it doesn't do anything you don't tell it to do and leaves everything as
> > you typed/copied it, unless you set it up different. It also has a very
> > good syntax highlighting and other helpers...
>
> Indeed, and so does VIM and a number of other editors.
>
> How much complexity do you want to deal with?
>
>
Although I'm not a master at VIM I have been using it for years along with=
=20
kwirte for scripting and programming and they both have done their job and=
=20
done it well
=2D-=20
"We must plan for freedom, and not only for security, if for no other reaso=
n=20
than only freedom can make security more secure." Karl Popper
whatever editor I use .. I have not found a way to see the unprintable char=
acters (Tab).=0AMaura=0A=0A=0A=0A----- Messaggio originale -----=0ADa: Dave=
Howorth =0AA: opensuse@opensuse.org=0AInviato:=
Luned=EC 15 giugno 2009, 14:46:21=0AOggetto: Re: [opensuse] editor that do=
es not eat out TAB characters=0A=0AMaura Monville wrote:=0A> For instance, =
Emacs won't work for this particular problem.=0A=0AI don't use emacs or pyt=
hon but ...=0A=0A'make' files depend on tabs being in exactly the right pla=
ce and I'd be=0Aastounded if emacs can't be used to edit make files!=0A=0AI=
t also seems rather strange that there are apparently two Python modes=0Afo=
r emacs if it can't be used to edit python :)=0A=0Ahttp://www.emacswiki.org=
/emacs/PythonMode=0A=0ASo my bet is that emacs can be used to edit python. =
How much do I win?=0A=0ACheers, Dave=0A-- =0ATo unsubscribe, e-mail: opensu=
se+unsubscribe@opensuse.org=0AFor additional commands, e-mail: opensuse+hel=
p@opensuse.org=0A=0A=0A
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Hi!
Am Montag 15 Juni 2009 17:39:47 schrieb Maura Monville:
> whatever editor I use .. I have not found a way to see the unprintable
> characters (Tab). Maura
In KWrite configuration: Editing -> First Tab -> Second checkbox.
Regards,
Matthias
Am Montag 15 Juni 2009 17:39:47 schrieb Maura Monville:
> whatever editor I use .. I have not found a way to see the unprintable
> characters (Tab). Maura
In KWrite configuration: Editing -> First Tab -> Second checkbox.
Regards,
Matthias
On Mon, 15 Jun 2009, 17:39:47 +0200, Maura Monville wrote:
>
> whatever editor I use .. I have not found a way to see the unprintable characters (Tab).
> Maura
hmm, that's pretty easy... Just use "vim" and type :set list; now
every Tab character will be shown as ^I ;-)
I don't actually like that editing mode, though; if you, however, insist
on changing the leading 8 blanks in a line into a tab, you can run
"unexpand" on any text file to do exactly that ...
Cheers.
l8er
manfred
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
>
> whatever editor I use .. I have not found a way to see the unprintable characters (Tab).
> Maura
hmm, that's pretty easy... Just use "vim" and type :set list; now
every Tab character will be shown as ^I ;-)
I don't actually like that editing mode, though; if you, however, insist
on changing the leading 8 blanks in a line into a tab, you can run
"unexpand" on any text file to do exactly that ...
Cheers.
l8er
manfred
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Hi!
Am Montag 15 Juni 2009 17:54:05 schrieb Manfred Hollstein:
> I don't actually like that editing mode, though; if you, however, insist
> on changing the leading 8 blanks in a line into a tab, you can run
> "unexpand" on any text file to do exactly that ...
You'll love it once you frequently change between systems with 1024 px or 2=
560=20
px wide displays. ;)
Regards,
Matthias
Am Montag 15 Juni 2009 17:54:05 schrieb Manfred Hollstein:
> I don't actually like that editing mode, though; if you, however, insist
> on changing the leading 8 blanks in a line into a tab, you can run
> "unexpand" on any text file to do exactly that ...
You'll love it once you frequently change between systems with 1024 px or 2=
560=20
px wide displays. ;)
Regards,
Matthias
Maura Monville said the following on 06/15/2009 11:39 AM:
> whatever editor I use .. I have not found a way to see the unprintable characters (Tab).
Help us here.
Why do you need to see the tab as a specific marker rather than as
expanded spaces? If I recall, python only needs the indenting, it
doesn't care what's shown on the screen for you so long as its
consistent, and VI (and I would presume Emacs) will expand tabs on
screen to how ever many display spaces your sweet heart desires.
So what really is your problem here?
Is it that you've grown up in Windows with an editor that shows tabs as
an arrow rather than expanding spaces so you can see the indenting being
aligned? Or what? If so, VI can be configured to show tabs as "^I",
but then you don't see the alignment of the indents. I thought you
wanted to work in Python, so why not use VI's Python mode. Perhaps I'm
an oddball, but I'd rather see the tabs expanded on screen.
Does Python care whether the indenting is via tabs or spaces so long as
its consistent?
What are you really asking here?
People have offered a number of solutions but you seem to be playing a
"Yes-but" game.
--
"Necessity is the mother of invention" is a silly proverb.
"Necessity is the mother of futile dodges" is much nearer the truth.
- Alfred North Whitehead
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> whatever editor I use .. I have not found a way to see the unprintable characters (Tab).
Help us here.
Why do you need to see the tab as a specific marker rather than as
expanded spaces? If I recall, python only needs the indenting, it
doesn't care what's shown on the screen for you so long as its
consistent, and VI (and I would presume Emacs) will expand tabs on
screen to how ever many display spaces your sweet heart desires.
So what really is your problem here?
Is it that you've grown up in Windows with an editor that shows tabs as
an arrow rather than expanding spaces so you can see the indenting being
aligned? Or what? If so, VI can be configured to show tabs as "^I",
but then you don't see the alignment of the indents. I thought you
wanted to work in Python, so why not use VI's Python mode. Perhaps I'm
an oddball, but I'd rather see the tabs expanded on screen.
Does Python care whether the indenting is via tabs or spaces so long as
its consistent?
What are you really asking here?
People have offered a number of solutions but you seem to be playing a
"Yes-but" game.
--
"Necessity is the mother of invention" is a silly proverb.
"Necessity is the mother of futile dodges" is much nearer the truth.
- Alfred North Whitehead
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 15 Jun 2009, 17:58:41 +0200, Matthias Bach wrote:
> Hi!
>
> Am Montag 15 Juni 2009 17:54:05 schrieb Manfred Hollstein:
> > I don't actually like that editing mode, though; if you, however, insist
> > on changing the leading 8 blanks in a line into a tab, you can run
> > "unexpand" on any text file to do exactly that ...
>
> You'll love it once you frequently change between systems with 1024 px or 2560
> px wide displays. ;)
yeah, but then the terminal description is wrong; normally a tab-stop is
every 8 characters. If you look at terminfo(5), the entry for "tab"
shows:
tab ht ta tab to next 8-space
hardware tab stop
and further down:
Tabs and Initialization
If the terminal has hardware tabs, the command to advance to the next
tab stop can be given as ht (usually control I). ...
Dunno if nowadays GUI programs still adhere to such "historical"
standards, though ;-)
> Regards,
> Matthias
Cheers.
l8er
manfred
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> Hi!
>
> Am Montag 15 Juni 2009 17:54:05 schrieb Manfred Hollstein:
> > I don't actually like that editing mode, though; if you, however, insist
> > on changing the leading 8 blanks in a line into a tab, you can run
> > "unexpand" on any text file to do exactly that ...
>
> You'll love it once you frequently change between systems with 1024 px or 2560
> px wide displays. ;)
yeah, but then the terminal description is wrong; normally a tab-stop is
every 8 characters. If you look at terminfo(5), the entry for "tab"
shows:
tab ht ta tab to next 8-space
hardware tab stop
and further down:
Tabs and Initialization
If the terminal has hardware tabs, the command to advance to the next
tab stop can be given as ht (usually control I). ...
Dunno if nowadays GUI programs still adhere to such "historical"
standards, though ;-)
> Regards,
> Matthias
Cheers.
l8er
manfred
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
> If I recall, python only needs the indenting, it
> doesn't care what's shown on the screen for you so long as its
> consistent
And this is where the trouble starts if you use tabs: Consistency.
Because as soon as you (or somebody else) use a different editor on a
different machine, chances are that tabs get expanded to the wrong
number of spaces (4 or 8 or whatever). This makes your Python code look
wrong, because many editors (or the authors) will mix tabs and spaces.
So there are two rules from PEP 8 [1] that you should _really_ obey:
- Never mix tabs and spaces.
- For new projects, spaces-only are strongly recommended over tabs.
Everything else is just a major PITA! Also, always start python with the
"-tt" option, this will raise an error if tabs and spaces are mixed in a
way that is ambiguous.
Regards
nordi
[1]
http://www.python.org/dev/peps/pep-0008/
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> If I recall, python only needs the indenting, it
> doesn't care what's shown on the screen for you so long as its
> consistent
And this is where the trouble starts if you use tabs: Consistency.
Because as soon as you (or somebody else) use a different editor on a
different machine, chances are that tabs get expanded to the wrong
number of spaces (4 or 8 or whatever). This makes your Python code look
wrong, because many editors (or the authors) will mix tabs and spaces.
So there are two rules from PEP 8 [1] that you should _really_ obey:
- Never mix tabs and spaces.
- For new projects, spaces-only are strongly recommended over tabs.
Everything else is just a major PITA! Also, always start python with the
"-tt" option, this will raise an error if tabs and spaces are mixed in a
way that is ambiguous.
Regards
nordi
[1]
http://www.python.org/dev/peps/pep-0008/
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Personally I do hate Windows. Although, in certain environments the develop=
ment platform, and even the tools, are imposed ... take irt or leave it. =
=0A=0AMy current problem stems from my ignorance about python. On top of th=
at I have to use the undocumented python code written by an Ms. student who=
decided to leave the Computer Science program when he was just a couple of=
weeks from defending his thesis. A crazy behaviour that nobody expected. =
=0ABy trial and error I succeeded in getting the python script run to compl=
etion without any error. But the oputut it generates is not what was expect=
ed. Basically the python script is supposed to extract automatically some d=
ata from the miRecords data base which is public and available in form of s=
tructurated HTML web pages.=0AI understand where the python script gets the=
raw data (miRecords). But I cannot understand where it stores the informat=
ion it is supposed to extract. It looks like the script is trying to store =
the info into a local database that might be =0AMySql or SQLight. Since I =
cannot see any call or link to either databases, I tried to run the python =
script step-by-step. =0ASince python is a scripting language I would expect=
to be able to accomplish that just copying llines from the script and past=
ing them onto a python terminal shell. But, regardless of which editor I us=
e, python interpreter prints out plenty of "indentation error " messages. =
=0AI tried an interactive graphic debug session by typing #ddd pbd ... whi=
ch brought up a nice GUI expecting an executable to be uploaded (sigh !). =
=0AI did not install pydbg as no rpm file is provided (as far as I know) an=
d its installation procedure from source code is not clear to me. I do not=
know whether the standard steps (configure, make, make install) can be app=
lyed to a scripting language.=0AI am appalled at a modern object-oriented l=
anguage that is built on a suyntax which is sensistive to indentation !=0A=
=0AI hope I won't irritate anyone if I post some excerpts of my pdb debuggi=
ng attempts ... maybe they will be meaningful for =0Apythons experienced us=
ers.=0A=0A=0AThank you very much for your patience.=0AMaura=0A=0A=0A=0A----=
- Messaggio originale -----=0ADa: Anton Aylward =
=0AA: OS-EN =0AInviato: Luned=EC 15 giugno 2009, 18:=
10:13=0AOggetto: Re: [opensuse] editor that does not eat out TAB characters=
=0A=0AMaura Monville said the following on 06/15/2009 11:39 AM:=0A> whateve=
r editor I use .. I have not found a way to see the unprintable characters =
(Tab).=0A=0AHelp us here.=0AWhy do you need to see the tab as a specific ma=
rker rather than as=0Aexpanded spaces? If I recall, python only needs the =
indenting, it=0Adoesn't care what's shown on the screen for you so long as =
its=0Aconsistent, and VI (and I would presume Emacs) will expand tabs on=0A=
screen to how ever many display spaces your sweet heart desires.=0A=0ASo wh=
at really is your problem here?=0A=0AIs it that you've grown up in Windows =
with an editor that shows tabs as=0Aan arrow rather than expanding spaces s=
o you can see the indenting being=0Aaligned? Or what? If so, VI can be co=
nfigured to show tabs as "^I",=0Abut then you don't see the alignment of th=
e indents. I thought you=0Awanted to work in Python, so why not use VI's P=
ython mode. Perhaps I'm=0Aan oddball, but I'd rather see the tabs expanded=
on screen.=0A=0ADoes Python care whether the indenting is via tabs or spac=
es so long as=0Aits consistent?=0A=0AWhat are you really asking here?=0APeo=
ple have offered a number of solutions but you seem to be playing a=0A"Yes-=
but" game.=0A=0A=0A=0A-- =0A"Necessity is the mother of invention" is a sil=
ly proverb.=0A"Necessity is the mother of futile dodges" is much nearer the=
truth.=0A - Alfred North Whitehead=0A-- =0ATo unsubscribe, e-mail: opensu=
se+unsubscribe@opensuse.org=0AFor additional commands, e-mail: opensuse+hel=
p@opensuse.org=0A=0A=0A
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
In , Maura Monville wrote:
>Personally I do hate Windows. Although, in certain environments the
> development platform, and even the tools, are imposed ... take irt or
> leave it.
I always tell them I'll leave it. There is fallout, but there's fallout th=
e=20
other way too.
> Since python is
> a scripting language I would expect to be able to accomplish that just
> copying llines from the script and pasting them onto a python terminal
> shell. But, regardless of which editor I use, python interpreter prints
> out plenty of "indentation error " messages.
Your editor, editor toolkit, clipboard, or terminal toolkit may be munging=
=20
this[1]. It's often not easy to copy/paste tabs. You might try using a=20
python debugger, if such a thing exists, and have it read the file, but=20
step/next/continue between lines based on your input.
=2D-=20
Boyd Stephen Smith Jr. ,=3D ,-_-. =3D.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
[1] For example, best I can tell, konsole never provides tabs to the=20
selection. I know cat, vim, etc. are printing them to the terminal, but=20
taking that output and pasting it anywhere else results in the tabs being=20
turned into spaces.
>Personally I do hate Windows. Although, in certain environments the
> development platform, and even the tools, are imposed ... take irt or
> leave it.
I always tell them I'll leave it. There is fallout, but there's fallout th=
e=20
other way too.
> Since python is
> a scripting language I would expect to be able to accomplish that just
> copying llines from the script and pasting them onto a python terminal
> shell. But, regardless of which editor I use, python interpreter prints
> out plenty of "indentation error " messages.
Your editor, editor toolkit, clipboard, or terminal toolkit may be munging=
=20
this[1]. It's often not easy to copy/paste tabs. You might try using a=20
python debugger, if such a thing exists, and have it read the file, but=20
step/next/continue between lines based on your input.
=2D-=20
Boyd Stephen Smith Jr. ,=3D ,-_-. =3D.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
[1] For example, best I can tell, konsole never provides tabs to the=20
selection. I know cat, vim, etc. are printing them to the terminal, but=20
taking that output and pasting it anywhere else results in the tabs being=20
turned into spaces.
On Mon June 15 2009 5:01 pm, Maura Monville wrote:
> I hope I won't irritate anyone if I post some excerpts of
> my pdb debugging attempts ... maybe they will be
> meaningful for pythons experienced users.
Maura, there is a very helpful python mailing list that
deals with exactly your situation. Go to python.com and
find it. It will be a big help.
--
Bob Rea
mailto:gapetard@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery
Where is Bill Stringfellow
now that we really need him?
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> I hope I won't irritate anyone if I post some excerpts of
> my pdb debugging attempts ... maybe they will be
> meaningful for pythons experienced users.
Maura, there is a very helpful python mailing list that
deals with exactly your situation. Go to python.com and
find it. It will be a big help.
--
Bob Rea
mailto:gapetard@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery
Where is Bill Stringfellow
now that we really need him?
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Maura Monville wrote:
> I tried to run the python script step-by-step.
Have you tried pdb for that? A very nice introduction can be found at
[1], plus some links. That is probably better than copy and paste
anyway, because you would always have to copy and paste all "import"
statements before code snippets can work.
> I am appalled at a modern object-oriented language that is built on a suyntax which is sensistive to indentation !
This is not a bug, it is a feature. It forces programmers to use
indentation, and to use it consistently. That means all Python programs
are indented the same way (=easy to read).
Also, you don't have to explicitly mark blocks with {..} or do...done or
whatever as in other languages. This explicit marking and the
indentation have redundant info about the program structure: One is for
the compiler/interpreter, one for the human. But redundancy can lead to
inconsistency, e.g. a programmer writing
if (foo == 1)
bar();
foobar();
For the human eye, foobar() belongs to the if statement. For the
compiler it does not, because there is no {...}. This kind of mistake
cannot happen in Python, because syntactically, what you see is what you
get. Removing the redundant info also makes it easier to read the code,
because there is simply less to read.
So using indentation as part of the syntax makes programs easier to read
and eliminates an entire class of programming errors.
Regards
nordi
[1] http://www.ferg.org/papers/debugging_in_python.html
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> I tried to run the python script step-by-step.
Have you tried pdb for that? A very nice introduction can be found at
[1], plus some links. That is probably better than copy and paste
anyway, because you would always have to copy and paste all "import"
statements before code snippets can work.
> I am appalled at a modern object-oriented language that is built on a suyntax which is sensistive to indentation !
This is not a bug, it is a feature. It forces programmers to use
indentation, and to use it consistently. That means all Python programs
are indented the same way (=easy to read).
Also, you don't have to explicitly mark blocks with {..} or do...done or
whatever as in other languages. This explicit marking and the
indentation have redundant info about the program structure: One is for
the compiler/interpreter, one for the human. But redundancy can lead to
inconsistency, e.g. a programmer writing
if (foo == 1)
bar();
foobar();
For the human eye, foobar() belongs to the if statement. For the
compiler it does not, because there is no {...}. This kind of mistake
cannot happen in Python, because syntactically, what you see is what you
get. Removing the redundant info also makes it easier to read the code,
because there is simply less to read.
So using indentation as part of the syntax makes programs easier to read
and eliminates an entire class of programming errors.
Regards
nordi
[1] http://www.ferg.org/papers/debugging_in_python.html
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 15 June 2009 04:01:16 pm Maura Monville wrote:
>
> Personally I do hate Windows. Although, in certain environments the development platform, and even the tools, are imposed ... take irt or leave it.
>
> My current problem stems from my ignorance about python. On top of that I have to use the undocumented python code written by an Ms. student who decided to leave the Computer Science program when he was just a couple of weeks from defending his thesis. A crazy behaviour that nobody expected.
> By trial and error I succeeded in getting the python script run to completion without any error. But the oputut it generates is not what was expected. Basically the python script is supposed to extract automatically some data from the miRecords data base which is public and available in form of structurated HTML web pages.
> I understand where the python script gets the raw data (miRecords). But I cannot understand where it stores the information it is supposed to extract. It looks like the script is trying to store the info into a local database that might be
> MySql or SQLight. Since I cannot see any call or link to either databases, I tried to run the python script step-by-step.
> Since python is a scripting language I would expect to be able to accomplish that just copying llines from the script and pasting them onto a python terminal shell. But, regardless of which editor I use, python interpreter prints out plenty of "indentation error " messages.
> I tried an interactive graphic debug session by typing #ddd pbd ... which brought up a nice GUI expecting an executable to be uploaded (sigh !).
> I did not install pydbg as no rpm file is provided (as far as I know) and its installation procedure from source code is not clear to me. I do not know whether the standard steps (configure, make, make install) can be applyed to a scripting language.
> I am appalled at a modern object-oriented language that is built on a suyntax which is sensistive to indentation !
>
> I hope I won't irritate anyone if I post some excerpts of my pdb debugging attempts ... maybe they will be meaningful for
> pythons experienced users.
I suggest using IDLE (zypper install python-idle). This program was written in Python using the Tkinter GUI toolkit. It provides an interpreter interface as well as an editor. The editor allows you to write Python scripts easily with auto-indentation and syntax highlighting. It uses a lot of conventions that a lot of Python programmers use when writing their code. It even has help on the syntax of functions at the interpreter. Worth a try.
--
Thank you,
Anthony
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
>
> Personally I do hate Windows. Although, in certain environments the development platform, and even the tools, are imposed ... take irt or leave it.
>
> My current problem stems from my ignorance about python. On top of that I have to use the undocumented python code written by an Ms. student who decided to leave the Computer Science program when he was just a couple of weeks from defending his thesis. A crazy behaviour that nobody expected.
> By trial and error I succeeded in getting the python script run to completion without any error. But the oputut it generates is not what was expected. Basically the python script is supposed to extract automatically some data from the miRecords data base which is public and available in form of structurated HTML web pages.
> I understand where the python script gets the raw data (miRecords). But I cannot understand where it stores the information it is supposed to extract. It looks like the script is trying to store the info into a local database that might be
> MySql or SQLight. Since I cannot see any call or link to either databases, I tried to run the python script step-by-step.
> Since python is a scripting language I would expect to be able to accomplish that just copying llines from the script and pasting them onto a python terminal shell. But, regardless of which editor I use, python interpreter prints out plenty of "indentation error " messages.
> I tried an interactive graphic debug session by typing #ddd pbd ... which brought up a nice GUI expecting an executable to be uploaded (sigh !).
> I did not install pydbg as no rpm file is provided (as far as I know) and its installation procedure from source code is not clear to me. I do not know whether the standard steps (configure, make, make install) can be applyed to a scripting language.
> I am appalled at a modern object-oriented language that is built on a suyntax which is sensistive to indentation !
>
> I hope I won't irritate anyone if I post some excerpts of my pdb debugging attempts ... maybe they will be meaningful for
> pythons experienced users.
I suggest using IDLE (zypper install python-idle). This program was written in Python using the Tkinter GUI toolkit. It provides an interpreter interface as well as an editor. The editor allows you to write Python scripts easily with auto-indentation and syntax highlighting. It uses a lot of conventions that a lot of Python programmers use when writing their code. It even has help on the syntax of functions at the interpreter. Worth a try.
--
Thank you,
Anthony
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
I did installed python-idle from Yast which requested SuSE 11.1 DVD ... I =
hope it is the same as the one that zypper would have installed.=0A=0AAnywa=
y, no new applet or icon has been added to the Application menu. =0AI tried=
to launch it from terminal command line but I do not know where Yast place=
d it.=0A=0Amauede@linux-326k:~> which python-idle=0Awhich: no python-idle i=
n (/home/bin/Spectra:/home/mauede/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin=
/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib64/jvm/jre/bin:/usr/li=
b/mit/bin:/usr/lib/mit/sbin)=0A=0Amauede@linux-326k:~> which idle=0A/usr/bi=
n/idle=0A=0ASo I launched as above:=0Amauede@linux-326k:~> /usr/bin/idle=0A=
IDLE Subprocess: socket error: Connection refused, retrying....=0A=0AIt ope=
ned up a window. I assume I have to use such a window to debug the python s=
cript.=0AI have always used debugger with compiled code ... so I feel at a =
loss.=0AI need to run the python script passing a parameter and do not know=
how to do.=0AIs there an IDLE demo ?=0A=0AThank you very much,=0AMaura=0A=
=0A=0A=0A=0A=0A=0A----- Messaggio originale -----=0ADa: Anthony Simonelli =0AA: opensuse@opensuse.org=0AInviato: Marted=EC 16 =
giugno 2009, 7:59:45=0AOggetto: Re: [opensuse] editor that does not eat out=
TAB characters=0A=0AOn Monday 15 June 2009 04:01:16 pm Maura Monville wrot=
e:=0A> =0A> Personally I do hate Windows. Although, in certain environments=
the development platform, and even the tools, are imposed ... take irt or =
leave it. =0A> =0A> My current problem stems from my ignorance about python=
. On top of that I have to use the undocumented python code written by an M=
s. student who decided to leave the Computer Science program when he was ju=
st a couple of weeks from defending his thesis. A crazy behaviour that nobo=
dy expected. =0A> By trial and error I succeeded in getting the python scri=
pt run to completion without any error. But the oputut it generates is not =
what was expected. Basically the python script is supposed to extract autom=
atically some data from the miRecords data base which is public and availab=
le in form of structurated HTML web pages.=0A> I understand where the pytho=
n script gets the raw data (miRecords). But I cannot understand where it st=
ores the information it is supposed to extract. It looks like the script is=
trying to store the info into a local database that might be =0A> MySql or=
SQLight. Since I cannot see any call or link to either databases, I tried=
to run the python script step-by-step. =0A> Since python is a scripting la=
nguage I would expect to be able to accomplish that just copying llines fro=
m the script and pasting them onto a python terminal shell. But, regardless=
of which editor I use, python interpreter prints out plenty of "indentatio=
n error " messages. =0A> I tried an interactive graphic debug session by ty=
ping #ddd pbd ... which brought up a nice GUI expecting an executable to b=
e uploaded (sigh !). =0A> I did not install pydbg as no rpm file is provide=
d (as far as I know) and its installation procedure from source code is not=
clear to me. I do not know whether the standard steps (configure, make, m=
ake install) can be applyed to a scripting language.=0A> I am appalled at a=
modern object-oriented language that is built on a suyntax which is sensis=
tive to indentation !=0A> =0A> I hope I won't irritate anyone if I post som=
e excerpts of my pdb debugging attempts ... maybe they will be meaningful f=
or =0A> pythons experienced users.=0A=0AI suggest using IDLE (zypper instal=
l python-idle). This program was written in Python using the Tkinter GUI t=
oolkit. It provides an interpreter interface as well as an editor. The ed=
itor allows you to write Python scripts easily with auto-indentation and sy=
ntax highlighting. It uses a lot of conventions that a lot of Python progr=
ammers use when writing their code. It even has help on the syntax of func=
tions at the interpreter. Worth a try.=0A-- =0AThank you,=0A=0AAnthony=0A-=
- =0ATo unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org=0AFor additi=
onal commands, e-mail: opensuse+help@opensuse.org=0A=0A=0A
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
G T Smith wrote:
> Indentation based block definition has some limitations.
I would like to know about those limitations. You can use blocks for
scoping variables even when those blocks are 'only' defined with
indentation. Python does not do that, but that does not mean it cannot
be done. Anything else?
> A minor issue. Which for any half way decent IDE would be reformatted as ..
You are assuming that you have an IDE ready when you do the development.
This only holds true until you have to work on a customers server over
ssh to fix a bug. And it assumes you always write your programs with an
IDE. I, at least, do not edit my shell scripts with Eclipse. Neither
would I write Python or Perl programs of just 50 lines with a big IDE.
> BTW Some consider it good practice in C/C++ and similar to use the form...
>
> if (1 == foo) bar();
>
> to avoid accidents like
>
> if (foo = 1) bar();
Yes, that is certainly good practice. But the second example will get
you a syntax error in Python, another kind of mistake you cannot make in
that language. Probably a lesson learned from C.
A note to the TO: When you try to get the program to work, make sure you
use the same version of Python that was used to program it. Some other
distributions ship rather old Python versions (their package management
uses Python, so they are much more conservative with new Python
versions). If your program was written for one of the old versions it
may give you trouble with Python version 2.6 that ships with current
openSuse distributions.
Regards
nordi
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
> Indentation based block definition has some limitations.
I would like to know about those limitations. You can use blocks for
scoping variables even when those blocks are 'only' defined with
indentation. Python does not do that, but that does not mean it cannot
be done. Anything else?
> A minor issue. Which for any half way decent IDE would be reformatted as ..
You are assuming that you have an IDE ready when you do the development.
This only holds true until you have to work on a customers server over
ssh to fix a bug. And it assumes you always write your programs with an
IDE. I, at least, do not edit my shell scripts with Eclipse. Neither
would I write Python or Perl programs of just 50 lines with a big IDE.
> BTW Some consider it good practice in C/C++ and similar to use the form...
>
> if (1 == foo) bar();
>
> to avoid accidents like
>
> if (foo = 1) bar();
Yes, that is certainly good practice. But the second example will get
you a syntax error in Python, another kind of mistake you cannot make in
that language. Probably a lesson learned from C.
A note to the TO: When you try to get the program to work, make sure you
use the same version of Python that was used to program it. Some other
distributions ship rather old Python versions (their package management
uses Python, so they are much more conservative with new Python
versions). If your program was written for one of the old versions it
may give you trouble with Python version 2.6 that ships with current
openSuse distributions.
Regards
nordi
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org
Related Threads
- tomcat and ssl - tomcat
- [users] How do you merge to a "directory" - openoffice
- #python IRC help - my internet provider is banned! - python
- r24822 - docs/Perl6/Spec - perl
- Invitation rencontre-dédicace - debian
- python resource management - python
- [Patch, Fortran] PR fortran/38887: Fix MVBITS with runtime zero-length array - gcc
- [users@httpd] pratapkm - httpd
- Plugin system, RuntimeWarning: Parent module 'ext_abc' not found while handling absolute import - python
- Variable returning context name - tomcat
- [Bug c/39037] New: FLOAT_CONST_DECIMAL64 pragma not supported - gcc
- SFTP max connection script help - redhat