Re: Simple question

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 3:55 PM, John Ladasky wrote: > Shush! That's one of Python's most closely-guarded secrets! Every > politician on Earth will want to learn to program in Python after seeing that! > Not really, the legal profession has known about this for centuries. (Princess Zara, pres

Re: socket issue with recv()

2014-08-23 Thread dieter
Arthur Clarck writes: > ... > The problem I have now is the following. > I have a script to connect to some telecom service. > The script is forking (parent/child) > The child is only reading what comes from the remote server. > Here the problematic code: > > total = '' > while True: >data = s

Re: Simple question

2014-08-23 Thread John Ladasky
On Saturday, August 23, 2014 6:10:29 AM UTC-7, explode...@gmail.com wrote: > Can some one explain why this happens: > > True, False = False, True > > print True, False > > False True Shush! That's one of Python's most closely-guarded secrets! Every politician on Earth will want to learn to p

Re: the output in reference of descriptor.

2014-08-23 Thread luofeiyu
let me paste it again to make my question more clear: >>>c2.d __get__() is called <__main__.C2 object at 0x0297BE10> <__main__.C object at 0x0297BBA8> >>> c2.d.a __get__() is called <__main__.C2 object at 0x0297BE10> __getattribute__() is cal

Re: ANN: binario - simple work with binary files

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 9:54:05 PM UTC+5:30, Алексей Саскевич wrote: > binario is the Python package that lets an application read/write primitive > data types from an underlying input/output file as binary data. > Package on PyPI: https://pypi.python.org/pypi/binario > Package on GitHub: ht

Re: Why can not initialize the class?

2014-08-23 Thread Michael Torrie
On 08/23/2014 11:25 AM, CHIN Dihedral wrote: > Well, an object in python can add > properties in the run-time to evolve > steadily and stealthly. > > Those unnessary set-get-C++ methods > are not very important in PYTHON. That's the most coherent thing I've seen from Dihedral in years! -- htt

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread Ned Batchelder
On 8/23/14 7:44 PM, luofeiyu wrote: Think for your remark " You didn't delete the name property, which is part of the class, not the instance." I fix my codes to get the target done. class Person(object): def addProperty(self, attribute): getter = lambda self: self._getPr

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread luofeiyu
Think for your remark " You didn't delete the name property, which is part of the class, not the instance." I fix my codes to get the target done. class Person(object): def addProperty(self, attribute): getter = lambda self: self._getProperty(attribute) setter

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 9:35 AM, luofeiyu wrote: > dear ChrisA ,dynamic is python feature, it is to create descriptor in run > time , > that is the meaning in the codes,and maybe it is a bug: > > the attribute can be displayed in dir(man) after be deleted. Then you don't need descriptors at al

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread luofeiyu
dear ChrisA ,dynamic is python feature, it is to create descriptor in run time , that is the meaning in the codes,and maybe it is a bug: the attribute can be displayed in dir(man) after be deleted. On 8/24/2014 6:56 AM, Chris Angelico wrote: On Sun, Aug 24, 2014 at 8:49 AM, luofeiyu wro

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread Ian Kelly
On Sat, Aug 23, 2014 at 4:49 PM, luofeiyu wrote: > > class Person(object): >def addProperty(self, attribute): > getter = lambda self: self._getProperty(attribute) > setter = lambda self, value: self._setProperty(attribute, value) > deletter = lambd

Re: Working with decimals

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 8:47 AM, Joshua Landau wrote: > On 23 August 2014 23:31, Chris Angelico wrote: >> On Sun, Aug 24, 2014 at 7:47 AM, Joshua Landau wrote: >>> So for one "import math" should never go inside a function; you should >>> hoist it to the top of the file with all the other import

Re: why the attribute be deleted still in dir(man)?

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 8:49 AM, luofeiyu wrote: > class Person(object): >def addProperty(self, attribute): > getter = lambda self: self._getProperty(attribute) > setter = lambda self, value: self._setProperty(attribute, > value) > deletter = lambd

Re: Global indent

2014-08-23 Thread Marko Rauhamaa
Anders Wegge Keller : > Curiously enough, even today the same lousy kind of connections > prevail. We still have a sizeable modem bank at my job. We still do > our remote support over a telnet/ssh session. And we still are unable > to reliable get the connection speeds[2], that would make anythin

why the attribute be deleted still in dir(man)?

2014-08-23 Thread luofeiyu
class Person(object): def addProperty(self, attribute): getter = lambda self: self._getProperty(attribute) setter = lambda self, value: self._setProperty(attribute, value) deletter = lambda self:self.delProperty(attribute) setattr(se

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 23:31, Chris Angelico wrote: > On Sun, Aug 24, 2014 at 7:47 AM, Joshua Landau wrote: >> So for one "import math" should never go inside a function; you should >> hoist it to the top of the file with all the other imports. > > I'd say "never" is too strong (there are times when i

Re: Working with decimals

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 7:47 AM, Joshua Landau wrote: > So for one "import math" should never go inside a function; you should > hoist it to the top of the file with all the other imports. I'd say "never" is too strong (there are times when it's right to put an import inside a function), but yes,

Re: Working with decimals

2014-08-23 Thread Seymore4Head
On Sat, 23 Aug 2014 22:52:09 +0100, Joshua Landau wrote: >On 23 August 2014 18:47, Seymore4Head wrote: >> Anyone care to suggest what method to use to fix the decimal format? > >It sounds like you want a primer on floating point. The documentation >of the decimal module is actually a good read,

Re: Global indent

2014-08-23 Thread Anders Wegge Keller
On Sun, 24 Aug 2014 00:56:11 +1000 Steven D'Aprano wrote: > Despite my comments, I don't actually have any objection to people who > choose to use Emacs, or Vim, or edit their text files by poking the hard > drive platter with a magnetised needle if they prefer :-) But I do think > it's silly of

Re: Global indent

2014-08-23 Thread Rustom Mody
On Sunday, August 24, 2014 2:27:56 AM UTC+5:30, Joshua Landau wrote: > Ay, so is any editor with an API. I use Sublime mostly because it's > pretty, fast and has a Python-based API. The only actual feature it > has that some others don't is multiple selections, and even then a lot > do. You mean

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 22:13, Seymore4Head wrote: > def make_it_money(number): > import math > return ' > + str(format(math.floor(number * 100) / 100, ',.2f')) So for one "import math" should never go inside a function; you should hoist it to the top of the file with all the other imports. Yo

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 18:47, Seymore4Head wrote: > Anyone care to suggest what method to use to fix the decimal format? It sounds like you want a primer on floating point. The documentation of the decimal module is actually a good read, although I don't doubt there are even better resources somewhere

Re: Working with decimals

2014-08-23 Thread Seymore4Head
On Sat, 23 Aug 2014 13:47:20 -0400, Seymore4Head wrote: >I am trying to do this example: >http://openbookproject.net/pybiblio/practice/wilson/loan.php >The instructions warn that floating point math can get messy so I >cheated a little bit to get me going. > >I made my program work by using numbe

Re: string encoding regex problem

2014-08-23 Thread Peter Otten
Philipp Kraus wrote: > I have create a short script: > > - > #!/usr/bin/env python > > import re, urllib2 > > > def URLReader(url) : > f = urllib2.urlopen(url) > data = f.read() > f.close() > return data > > > print re.match( "\.*\<\/small\>", > URLReader("http://sour

Re: Global indent

2014-08-23 Thread Joshua Landau
On 23 August 2014 17:17, Christian Gollwitzer wrote: > Am 23.08.14 16:19, schrieb Joshua Landau: >> >> On 23 August 2014 10:41, Christian Gollwitzer wrote: >>> >>> Sometimes I impress my colleagues with what they call "magic", i.e. >>> creating >>> special repeated lists of numbers by a few keyst

Re: Python vs C++

2014-08-23 Thread Terry Reedy
On 8/23/2014 10:21 AM, Rustom Mody wrote: Wordperfect was one of the best wysiwyg editors Ive used. One could use it in normal (1-screen) mode Or one could split the screen and see the formattings in the lower window along withe the formatted in the upper. I wrote at least two books with Wordp

Re: string encoding regex problem

2014-08-23 Thread Philipp Kraus
Hi, On 2014-08-16 09:01:57 +, Peter Otten said: Philipp Kraus wrote: The code works till last week correctly, I don't change the pattern. Websites' contents and structure change sometimes. My question is, can it be a problem with string encoding? Your regex is all-ascii. So an encod

Re: Working with decimals

2014-08-23 Thread Mark Lawrence
On 23/08/2014 20:48, Seymore4Head wrote: Thanks for the links. The python-course looks like a beginner start. It raises one more question. Some have suggested using strings. I understand that strings and numbers are not the same thing. I know that converting numbers to strings can be useful

Re: Global indent

2014-08-23 Thread Tim Chase
On 2014-08-23 15:19, Joshua Landau wrote: > I have yet to be truly impressed by Vim, in that Sublime Text with a > few extensions seems to do the same things just as easily Can it be run remotely in a tmux session which can be accessed via SSH from multiple machines? ;-) Using the command-line:

Re: Python code to distinguish between data having, 2 different formats, in a given cell(MS Excel).

2014-08-23 Thread Denis McMahon
On Sat, 23 Aug 2014 11:56:29 -0700, Ed Joz wrote: > Please suggest a sample python code. while program result not correct: fix program Note - we are not here to write your code for you, but we will try and help you develop your own code to do what you want. -- Denis McMahon, denismfmc

Re: Global indent

2014-08-23 Thread Tim Chase
On 2014-08-23 19:31, Steven D'Aprano wrote: > Sorry, but I have no idea what you mean by "orthogonal set of verbs > and nouns in an editing language". Can you explain? In the context of vi/vim, an "orthogonal set of verbs and nouns in an editing language" mean that you have a collection of verbs (

Re: Working with decimals

2014-08-23 Thread Seymore4Head
On Sat, 23 Aug 2014 20:24:41 +0100, Mark Lawrence wrote: >On 23/08/2014 20:07, Seymore4Head wrote: >> >> Funny, I though using the web would be better than a book. I don't >> think so anymore. Using the web, it is hard to find square one >> tutorial text. >> > >Try typing something like "python

Re: Working with decimals

2014-08-23 Thread Mark Lawrence
On 23/08/2014 20:07, Seymore4Head wrote: Funny, I though using the web would be better than a book. I don't think so anymore. Using the web, it is hard to find square one tutorial text. Try typing something like "python string formatting tutorial" into your favourite search engine and you'

Re: Working with decimals

2014-08-23 Thread Joel Goldstick
On Sat, Aug 23, 2014 at 3:07 PM, Seymore4Head wrote: > On Sat, 23 Aug 2014 14:21:03 -0400, Joel Goldstick > wrote: > >>On Sat, Aug 23, 2014 at 1:47 PM, Seymore4Head >> wrote: >>> I am trying to do this example: >>> http://openbookproject.net/pybiblio/practice/wilson/loan.php >>> The instructions

Re: Python code to distinguish between data having, 2 different formats, in a given cell(MS Excel).

2014-08-23 Thread Mark Lawrence
On 23/08/2014 19:56, Ed Joz wrote: I got an excel sheet having,2 blocks of data in 2 different formats, in any given cell. Lets take cell A1 for example, 1st block has font = Arial, character size =10 2nd block has font = Times New Roman, character size = 16 OR **no data** sample: "abcd123 P

Re: Working with decimals

2014-08-23 Thread Seymore4Head
On Sat, 23 Aug 2014 14:21:03 -0400, Joel Goldstick wrote: >On Sat, Aug 23, 2014 at 1:47 PM, Seymore4Head > wrote: >> I am trying to do this example: >> http://openbookproject.net/pybiblio/practice/wilson/loan.php >> The instructions warn that floating point math can get messy so I >> cheated a li

Re: Python vs C++

2014-08-23 Thread Terry Reedy
On 8/23/2014 8:38 AM, Rustom Mody wrote: WYSIWYG editors allow that -- can make a huge difference to beginners who find music hard to read. Here's an example I typed out in the wysiwig editor nted https://vimeo.com/16894001 ¹ "Awww, snap! This video can’t be played with your current setup" H

Python code to distinguish between data having, 2 different formats, in a given cell(MS Excel).

2014-08-23 Thread Ed Joz
I got an excel sheet having,2 blocks of data in 2 different formats, in any given cell. Lets take cell A1 for example, 1st block has font = Arial, character size =10 2nd block has font = Times New Roman, character size = 16 OR **no data** sample: "abcd123 PQRS456" A python code need to be dev

Re: Working with decimals

2014-08-23 Thread Joel Goldstick
On Sat, Aug 23, 2014 at 1:47 PM, Seymore4Head wrote: > I am trying to do this example: > http://openbookproject.net/pybiblio/practice/wilson/loan.php > The instructions warn that floating point math can get messy so I > cheated a little bit to get me going. > > I made my program work by using numb

Working with decimals

2014-08-23 Thread Seymore4Head
I am trying to do this example: http://openbookproject.net/pybiblio/practice/wilson/loan.php The instructions warn that floating point math can get messy so I cheated a little bit to get me going. I made my program work by using numbers that wouldn't get messy. Instead of using 6% interest I used

Re: Why can not initialize the class?

2014-08-23 Thread CHIN Dihedral
On Saturday, August 23, 2014 7:29:44 AM UTC+8, luofeiyu wrote: > One final version: > > > > class Contact(object): > > def __init__(self, email="haha@haha"): > > self.email = email > > def _get_email(self): > > return self._the_secret_private_email > > def _

Re: Global indent [levity]

2014-08-23 Thread Peter Pearson
On Sat, 23 Aug 2014 19:08:10 +1000, Steven D'Aprano wrote: > Marko Rauhamaa wrote: >> Rob Gaddi : >> >>> Emacs and vim both have huge learning curves >> >> Really now? >> >> When you start emacs, it advises you to start the builtin tutorial. > > You need a tutorial for a text editor??? Did you

Re: Python vs C++

2014-08-23 Thread Marko Rauhamaa
mm0fmf : > On 22/08/2014 18:16, Marko Rauhamaa wrote: >> SCons gives you the power of Python. Don't use that >> power except in utmost need. > > Ah, you've seen our build system at work! Where I've used SCons, I've striven to make the SConscript files obvious to a casual visitor, who might not ev

Re: Python vs C++

2014-08-23 Thread mm0fmf
On 22/08/2014 18:16, Marko Rauhamaa wrote: SCons gives you the power of Python. Don't use that power except in utmost need. Ah, you've seen our build system at work! Andy -- https://mail.python.org/mailman/listinfo/python-list

ANN: binario - simple work with binary files

2014-08-23 Thread bwatas
binario is the Python package that lets an application read/write primitive data types from an underlying input/output file as binary data. Package on PyPI: https://pypi.python.org/pypi/binario Package on GitHub: https://github.com/asaskevich/binario Docs: http://binarios-docs.readthedocs.org/en/

Re: Global indent

2014-08-23 Thread Christian Gollwitzer
Am 23.08.14 16:19, schrieb Joshua Landau: (Since this is already an editor war...) On 23 August 2014 10:41, Christian Gollwitzer wrote: Sometimes I impress my colleagues with what they call "magic", i.e. creating special repeated lists of numbers by a few keystrokes in gvim, and that has trigg

Re: Global indent

2014-08-23 Thread Christian Gollwitzer
Hi Steven, I agree with all you said. Am 23.08.14 16:56, schrieb Steven D'Aprano: Christian Gollwitzer wrote: There are ways to put these editors into Beginner's mode, for vim there is "evim", and for sure emacs has something similar, where the editor behaves more like you expect. In evim, thi

Re: Global indent

2014-08-23 Thread Seymore4Head
On Fri, 22 Aug 2014 14:19:29 -0400, Seymore4Head wrote: >Is there a way to indent everything again? > >Say I have a while statement with several lines of code and I want to >add a while outside that. That means indenting everything. Is there >a global way to do that? I did two things. I decid

Re: Global indent

2014-08-23 Thread Steven D'Aprano
Christian Gollwitzer wrote: > Am 23.08.14 11:08, schrieb Steven D'Aprano: >> This is the moment that I decide to give up on Emacs and take up >> something trivial in comparison, like being a Soyuz pilot, если вы >> знаете, что я имею в виду. > > Well done, Steve! This is the exact reason that I d

Re: Global indent

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 2:38:10 PM UTC+5:30, Steven D'Aprano wrote: > Marko Rauhamaa wrote: > > Rob Gaddi : > >> Emacs and vim both have huge learning curves > > Really now? > > When you start emacs, it advises you to start the builtin tutorial. > You need a tutorial for a text editor??? >

Re: Global indent

2014-08-23 Thread Gene Heskett
On Saturday 23 August 2014 06:17:24 alister did opine And Gene did reply: > On Sat, 23 Aug 2014 18:19:21 +1000, Steven D'Aprano wrote: > > Rob Gaddi wrote: > >> Emacs and vim both have huge learning curves that I've decided > >> aren't worth climbing. > > > > In my opinion, they are designed for p

Re: Python vs C++

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 7:32:12 PM UTC+5:30, Ian wrote: > On Sat, Aug 23, 2014 at 6:38 AM, Rustom Mody wrote: > > Here is an example (not identical but analogous to) where markup+compile is > > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 12:02 AM, Ian Kelly wrote: > I don't know how fast lilypond is, but perhaps one could write an editor > that wraps lilypond and invokes it in realtime to show the output in an > adjacent panel, perhaps with a brief delay when the user stops typing. You theoretically could,

Re: Global indent

2014-08-23 Thread Joshua Landau
(Since this is already an editor war...) On 23 August 2014 10:41, Christian Gollwitzer wrote: > Sometimes I impress my colleagues with what they call "magic", i.e. creating > special repeated lists of numbers by a few keystrokes in gvim, and that has > triggered the request from them to learn a b

Re: Python vs C++

2014-08-23 Thread Ian Kelly
On Sat, Aug 23, 2014 at 6:38 AM, Rustom Mody wrote: > Here is an example (not identical but analogous to) where markup+compile is > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to play it > But lilypond does not allow playing and seeing-in-realti

Re: Simple question

2014-08-23 Thread ElChino
wrote: Can some one explain why this happens: True, False = False, True print True, False False True I assume the value of True and False can be falsified. Like the 'None' object can be. So swapping their values and printing them is similar to: a = 0 b = 1 a, b = b, a print a, b Except t

Re: Simple question

2014-08-23 Thread Peter Otten
explodeandr...@gmail.com wrote: > Can some one explain why this happens: > True, False = False, True > print True, False > False True You are using Python 2 where True/False are names that can be rebound. This is for backwards compatibility as Python didn't always have booleans and people made

Re: Simple question

2014-08-23 Thread Chris Angelico
On Sat, Aug 23, 2014 at 11:10 PM, wrote: > Can some one explain why this happens: > True, False = False, True > print True, False > False True Well, the first line changes the meanings of the names "True" and "False", but doesn't change the things they point to. Those things describe themselves

Simple question

2014-08-23 Thread explodeandroid
Can some one explain why this happens: True, False = False, True print True, False False True -- https://mail.python.org/mailman/listinfo/python-list

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sat, Aug 23, 2014 at 10:38 PM, Rustom Mody wrote: > Here is an example (not identical but analogous to) where markup+compile is > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to play it > But lilypond does not allow playing and seeing-in-realt

Re: Python vs C++

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 3:19:37 AM UTC+5:30, Chris Angelico wrote: > On Sat, Aug 23, 2014 at 7:38 AM, Michael Torrie wrote: > > On 08/22/2014 02:06 PM, Marko Rauhamaa wrote: > >> I tend to think the opposite: C++ barely has a niche left. I definitely > >> wouldn't want to use C++ very far fro

Re: Global indent

2014-08-23 Thread mm0fmf
On 22/08/2014 20:46, Seymore4Head wrote: http://gvim.en.softonic.com/ Has a snazzy look, but I think it is not compatible with Windows so it looks like I might have to try Emacs. Others will disagree but I find keeping Windows and *nix separate helps me a lot. So I'll use emacs on Linux fo

Re: Global indent

2014-08-23 Thread alister
On Sat, 23 Aug 2014 18:19:21 +1000, Steven D'Aprano wrote: > Rob Gaddi wrote: > >> Emacs and vim both have huge learning curves that I've decided aren't >> worth climbing. > > In my opinion, they are designed for people willing and able to commit > to memory dozens, even hundreds, of obscure key

Re: Global indent

2014-08-23 Thread Christian Gollwitzer
Am 23.08.14 11:08, schrieb Steven D'Aprano: I just started up emacs, and got a GUI window with an abstract picture of a gnu and a bunch of instructions which I didn't get a chance to read. I clicked on the text, and the instructions disappeared. I don't know how to get them back. They were replac

Re: Global indent

2014-08-23 Thread Steven D'Aprano
Dan Stromberg wrote: > The first time I saw vi, I hated it.  I thought "Why would anyone > actually choose such a terrible editor?" > > But then I was forced to use vi for a while,  and I'm glad I was.  I > choose it over other editors now.  vi/vim give you a pretty much > orthogonal set of verbs

Re: Global indent

2014-08-23 Thread Marko Rauhamaa
Steven D'Aprano : > Marko Rauhamaa wrote: >> When you start emacs, it advises you to start the builtin tutorial. > > You need a tutorial for a text editor??? > > If that's supposed to prove how easy Emacs is, you have failed > miserably. You see, I tend to read even the assembly instructions of I

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-23 Thread Steven D'Aprano
Travis Griggs wrote: > I do not like the python lambda. For two reasons. > > One: In a language that sought to be approachable by simple people (i.e. > non computer science graduates who would use it in addition to their > scientific/education background), I can’t believe they threw in a 6 > char

Re: Global indent

2014-08-23 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Rob Gaddi : > >> Emacs and vim both have huge learning curves > > Really now? > > When you start emacs, it advises you to start the builtin tutorial. You need a tutorial for a text editor??? If that's supposed to prove how easy Emacs is, you have failed miserably. Any

Re: socket issue with recv()

2014-08-23 Thread Marko Rauhamaa
Arthur Clarck : > What is happening is that I got some datas from the remote site, > Something like 'Contacting BH: ...' > But directly followed by 'remote site is closed. This works: #!/usr/bin/env python3 import sys, soc

Re: socket issue with recv()

2014-08-23 Thread Arthur Clarck
I forgot to mention that with this code: total = '' while True: data = s.recv(1024) total += data if (total != ''): print total total = '' Everything is fine. I am still looping but I get the complete data flow sent by the remote server. The data flow is not corrupted

socket issue with recv()

2014-08-23 Thread Arthur Clarck
Hello, I am starting socket scripting with python. I do understand from the doc that a socket is bmocking by default. I wrote 2 basics script to verify this behaviour. my "tcp_server.py": import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) HOST = '192.168.0.103' PORT = 106

Re: Global indent

2014-08-23 Thread Steven D'Aprano
Rob Gaddi wrote: > Emacs and vim both have huge learning curves that I've decided aren't > worth climbing. In my opinion, they are designed for people willing and able to commit to memory dozens, even hundreds, of obscure key sequences to get the simplest thing done. They are not designed for e

Re: Global indent

2014-08-23 Thread Steven D'Aprano
Seymore4Head wrote: > Is there a way to indent everything again? > > Say I have a while statement with several lines of code and I want to > add a while outside that. That means indenting everything. Is there > a global way to do that? In kwrite, kate, geany, and any other sensible editor, you

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sat, Aug 23, 2014 at 5:36 PM, Paul Rudin wrote: > I'm unconvinced is that e.g. LaTeX is inherently more "expert" that Word > for simple document preparation. It's mostly a question of familiarity. I think LaTeX probably is, in the same way that PhotoShop or Gimp is more expert than a simple pa

Re: Why can not initialize the class?

2014-08-23 Thread luofeiyu
You can copy it into vim,and input :%< ,the codes will be changed into well formatted. -- https://mail.python.org/mailman/listinfo/python-list

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-23 Thread Marko Rauhamaa
Dan Stromberg : > Please don't add multiline lambdas to Python. Agree. > Multiline lambdas give rise (in a big way) to the > computer-language-equivalent of run-on sentences. Lambdas are perfect in Scheme because they are idiomatic in it. They carry a visual meaning and flow nicely with the par

Re: Why can not initialize the class?

2014-08-23 Thread luofeiyu
I edit it in the vim in well formatted form,when copied into email ,the format changed ,i don't know why. My email editor is thunderbird, you can try it as i say. I didn't mean to . By posting code with an extra indent, you make it imposible to run by just cutting and pasting. You should alre

Re: Python vs C++

2014-08-23 Thread Paul Rudin
Chris Angelico writes: > On Sat, Aug 23, 2014 at 3:56 PM, dieter wrote: >> Chris Angelico writes: >>> Frankly, I wouldn't write OO in anything, because I think the entire >>> concept of a WYSIWYG editor is flawed. >> >> That would limit (so called) office applications to experts only. >> But th

Re: Python vs C++

2014-08-23 Thread Marko Rauhamaa
Chris Angelico : > I'm just saying that callbacks are inherently restrictive in a > language without first-class functions. You don't have to go that far to have great callback support. C# (and Delphi) show a great model that I wish C++ had adopted from the beginning. C++ could have declared that