command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Dear all, I am having trouble with argparse. I am trying to translate the following line to a sleek python script: lpr -o media=legal -o sides=two-sided-long-edge filename Now where I am. import argparse parser = argparse.ArgumentParser(description='Print stuff with cups') parser.add_argument(

Re: syntax difference

2018-06-20 Thread bart4858
(Sorry no idea how to do quoting on this mobile app I have to use.) Those examples of using network features are merely examples of function calls. This is what I'm talking about with basic language features. Pointers are merely an extra level of indirection; they can be made to fit. A few thin

Re: syntax difference

2018-06-20 Thread Chris Angelico
On Wed, Jun 20, 2018 at 7:35 PM, wrote: > (Sorry no idea how to do quoting on this mobile app I have to use.) > > Those examples of using network features are merely examples of function > calls. This is what I'm talking about with basic language features. > > Pointers are merely an extra level

Re: command line utility for cups

2018-06-20 Thread Peter Otten
Brian Oney via Python-list wrote: > Dear all, > > I am having trouble with argparse. I am trying to translate the following > line to a sleek python script: > > lpr -o media=legal -o sides=two-sided-long-edge filename > > Now where I am. > > import argparse > parser = argparse.ArgumentParser(d

Re: command line utility for cups

2018-06-20 Thread George Fischhof
Peter Otten <__pete...@web.de> ezt írta (időpont: 2018. jún. 20., Sze 12:22): > Brian Oney via Python-list wrote: > > > Dear all, > > > > I am having trouble with argparse. I am trying to translate the following > > line to a sleek python script: > > > > lpr -o media=legal -o sides=two-sided-long-

Re: syntax difference

2018-06-20 Thread bart4858
Yeah, people keep bringing that up when they run out of arguments. So, every programmer must always use the most advanced, most esoteric features possible at every opportunity? Coding should only be for the elite? There is a place for various levels of programming language. I'm saying that Pyth

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Thanks Peter! That's pretty slick. I will get it working for sure now. Regards, Brian -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-20 Thread Chris Angelico
On Wed, Jun 20, 2018 at 8:43 PM, wrote: > Yeah, people keep bringing that up when they run out of arguments. > > So, every programmer must always use the most advanced, most esoteric > features possible at every opportunity? Coding should only be for the elite? > > There is a place for various l

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
On Wed, 2018-06-20 at 12:36 +0200, George Fischhof wrote: > Hi, > You can also try click library from pypi, that is a very good command line > stuff. > > George Thank you for the tip. I am away of click and it's awesomeness, but am hesitant because it's not apart of stdlib. I have gotten bitten

Re: syntax difference

2018-06-20 Thread bart4858
Pointers are perhaps a more technical feature. Switch and case, the latter a more general version of switch, are universal. Repeat n times is universal. While it is trivial to implement with other constructs, it as an annoyance and distraction that is easily fixed. Now you will probably say it

Re: syntax difference

2018-06-20 Thread Chris Angelico
On Wed, Jun 20, 2018 at 9:53 PM, wrote: > Pointers are perhaps a more technical feature. Switch and case, the latter a > more general version of switch, are universal. > > > Repeat n times is universal. While it is trivial to implement with other > constructs, it as an annoyance and distraction

Re: syntax difference

2018-06-20 Thread Steven D'Aprano
On Wed, 20 Jun 2018 03:43:17 -0700, bart4858 wrote: > I'm saying > that Python which is always touted as a 'simple' language suitable for > beginners, is missing a surprising number of basics. You call them "basics". Must of us call most of them "unnecessary bloat". What we call "the basics", li

Re: syntax difference

2018-06-20 Thread Tim Golden
[... snip discussions about Bart's language ...] Wearing my moderator hat Can we take the "Bart's language vs Python Show" to some other forum, please? We've already gone over this ground again and again and it isn't helping the signal-to-noise ratio here on the Python list / comp.lang.python

Re: syntax difference

2018-06-20 Thread bart4858
It isn't about my language versus Python. It is about the surprising number of simple features that are missing and that people are claiming don't matter, despite the considerable efforts made to provide them via add-ons. But I'm glad you stepped because making these posts via a smartphone AND g

Feeding the trolls

2018-06-20 Thread D'Arcy Cain
On 2018-06-20 08:10 AM, Tim Golden wrote: > [... snip discussions about Bart's language ...] > > Wearing my moderator hat > > Can we take the "Bart's language vs Python Show" to some other forum, > please? We've already gone over this ground again and again and it isn't > helping the signal-to-no

Re: syntax difference

2018-06-20 Thread Alister via Python-list
On Wed, 20 Jun 2018 03:13:09 +, Steven D'Aprano wrote: > On Tue, 19 Jun 2018 12:13:40 -0700, Jim Lee wrote: > >> On 06/19/2018 04:13 AM, Ed Kellett wrote: >>> I think we're all--still--missing the larger point that "easy to >>> remove" is a completely stupid metric for judging language featur

Re: syntax difference

2018-06-20 Thread Grant Edwards
On 2018-06-20, Alister via Python-list wrote: > Annotations were invented by the Nazi's on the explicit instruction > of Hitler. there, can someone now invoke Godwins law & call this > discussion closed :-) I'm pretty sure I read somewhere that Godwin's law doesn't apply when one invokes Hitler

Re: syntax difference

2018-06-20 Thread bart4858
If you're genuinely interested in how pointers might work I'll try and write that up when I get back to a real machine, and will do it in the form of a link. Since people are clearly unhappy with discussing features that ought to be in Python in a Python forum. -- https://mail.python.org/mailma

Re: syntax difference

2018-06-20 Thread Alister via Python-list
On Wed, 20 Jun 2018 13:59:40 +, Grant Edwards wrote: > On 2018-06-20, Alister via Python-list wrote: > >> Annotations were invented by the Nazi's on the explicit instruction of >> Hitler. there, can someone now invoke Godwins law & call this >> discussion closed :-) > > I'm pretty sure I r

Re: syntax difference

2018-06-20 Thread Alister via Python-list
On Tue, 19 Jun 2018 16:25:50 -0700, bart4858 wrote: > Some of that can be done. It may not need specific support. > > But my intention is to have an ordinary language for everyday coding not > one that can only be understood by CS professors. > > Mine is unusual in that I can drop features I rar

Re: syntax difference

2018-06-20 Thread Michael Torrie
On 06/20/2018 05:53 AM, bart4...@gmail.com wrote: > I suggest that such features just make life a little simpler. (And > make writing an efficient interpreter a little bit easier.) And I posit that most efficient interpreters don't use switch/case at all, but rather jump tables. -- https://mail.p

Re: syntax difference

2018-06-20 Thread Michael Torrie
On 06/20/2018 03:35 AM, bart4...@gmail.com wrote: > Pointers are merely an extra level of indirection; they can be made to fit. I'm hard pressed to think of any way in which pointers could fit into Python given the way python variables work and given the virtual machien architecture and abstractio

Re: syntax difference

2018-06-20 Thread bart4858
The actual interpreter code is irrelevant. Switch would be a feature of the language being interpreted, not of the interpreter. If the task is to match an expression X against a variety of values, then expressing that as a switch means the interpreter /could/ use a jump table (of labels within

Re: syntax difference

2018-06-20 Thread bart4858
You're right. While pointers can be made to fit, it would be an awkward fit into Python and could introduce overheads even when not used. My use of them is frequently when straddling boundaries between languages (a pointer in one environment points to the data of another), or when working just

Re: syntax difference

2018-06-20 Thread Gregory Ewing
Michael Torrie wrote: And I posit that most efficient interpreters don't use switch/case at all, but rather jump tables. Not always true. If the number of cases is small enough, a tree of branches could be faster due to cacheing and pipelining issues. -- Greg -- https://mail.python.org/mailman

Re: syntax difference

2018-06-20 Thread Gregory Ewing
Michael Torrie wrote: Pointers are for a different conceptual model, a different (virtual) machine architecture. And even in many lower-level languages that do have pointers, they're not much like the wild, undisciplined version that you get in C and C++. In Pascal, for example (and derivatives

nltk related issue

2018-06-20 Thread Sharan Basappa
Folks, I am trying to run a simple example associated with nltk. I get some error and I don't know what the issue is. I need some guidance please. I am using python canopy distribution The following is the code: inputstring = ' This is an example sent. The sentence splitter will split on sent

Re: Feeding the trolls

2018-06-20 Thread Abdur-Rahmaan Janhangeer
by building a custom py-based mail client maybe ^^_ Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ On Wed, 20 Jun 2018, 17:18 D'Arcy Cain, wrote: > On 2018-06-20 08:10 AM, Tim Golden wrote: > > [... snip discussions about Bart's language ...] > > > > Wearing my moderator hat > > > >