Re: RE: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Bob Martin
in 770457 20170131 011814 "Joseph L. Casale" wrote: >> C# hardly seems any better than Java to me as far as a language goes. > >Which sounds pretty good to me, they are both high performance, mature >and rich languages. > >> Being forced into working with classes even when they are not >> appropri

Re: Overriding True and False ?

2017-01-30 Thread Christian Gollwitzer
Am 31.01.17 um 04:27 schrieb Ian Kelly: On Jan 30, 2017 6:07 PM, "Steve D'Aprano" wrote: Hey Ian, Your news reader or mail client has stopped quoting the text you are quoting, so it appears as if you have written it. See: https://mail.python.org/pipermail/python-list/2017-January/719015.html

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Gregory Ewing
Michael Torrie wrote: He was saying that you can use the explicit self paradigm in C#. Simply prefix each member variable with "this." One can do that in one's own code, but it doesn't help you to read the code of someone else who hasn't done that. Since it's not part of the C# culture, the vas

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Gregory Ewing
Nathan Ernst wrote: There is no reason you cannot introduce a static class with pure static members (i.e. the Math class in System). A static class effectively becomes another namespace in C++ parlance. I'll admit the syntax is a bit odd, and enforces you, at a minimum to use the outer name a as

Re: Overriding True and False ?

2017-01-30 Thread Ben Finney
Ian Kelly writes: > Well, nuts. It looks fine in my client (the Gmail Android app) so I > guess this must be an issue of HTML versus text content. Unfortunately > the mobile client doesn't have any option for text-only that I can > find, so my options appear to be to laboriously replace the quoti

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 6:07 PM, "Steve D'Aprano" wrote: > Hey Ian, > > Your news reader or mail client has stopped quoting the text you are > quoting, so it appears as if you have written it. > > See: > > https://mail.python.org/pipermail/python-list/2017-January/719015.html Well, nuts. It looks fine in

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Michael Torrie
On 01/30/2017 06:52 PM, Nathan Ernst wrote: > self vs this, and you might start a language holy war. Actually no, you misread his point. He was speaking of C#, not Python. In C#, the only word you can use is "this." He was saying that you can use the explicit self paradigm in C#. Simply prefix ea

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Chris Angelico
On Tue, Jan 31, 2017 at 12:57 PM, Michael Torrie wrote: >> Sorry, sounds like you need to learn SOLID, none of my classes >> have ever taken this form. > > Never said they were my classes, or even my programs. What is this > "SOLID" thing? https://en.wikipedia.org/wiki/SOLID_(object-oriented_des

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Michael Torrie
On 01/30/2017 06:18 PM, Joseph L. Casale wrote: > Which sounds pretty good to me, they are both high performance, mature > and rich languages. Sure it's a matter of personal preference and need. I happen to find the expressivity and flexibility of Python (warts and all) to be rather liberating co

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Nathan Ernst
I mostly agree with this On Mon, Jan 30, 2017 at 7:18 PM, Joseph L. Casale wrote: > > C# hardly seems any better than Java to me as far as a language goes. > > Which sounds pretty good to me, they are both high performance, mature > and rich languages. > > > Being forced into working with classe

RE: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Joseph L. Casale
> C# hardly seems any better than Java to me as far as a language goes. Which sounds pretty good to me, they are both high performance, mature and rich languages. > Being forced into working with classes even when they are not > appropriate is jarring. And 100% irrelevant, it doesn't prevent you

What are your opinions on .NET Core vs Python?

2017-01-30 Thread Gerald Britton
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. https://mail.python.org/mailman/listinfo/python-list>> wrote: > > > > >* As you guys might know, .NET Core is up and running, promising a > >"cross-platform, unified, fast, lightweight, modern and open source > >experience" (source: .NET Core official site

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Michael Torrie
On 01/30/2017 11:44 AM, Juan C. wrote: > On Sun, Jan 29, 2017 at 1:06 AM, Juan C. wrote: >> >> As you guys might know, .NET Core is up and running, promising a >> "cross-platform, unified, fast, lightweight, modern and open source >> experience" (source: .NET Core official site). What do you guy

Re: Rename file without overwriting existing files

2017-01-30 Thread Ben Finney
Peter Otten <__pete...@web.de> writes: > http://stackoverflow.com/questions/3222341/how-to-rename-without-race-conditions > > and from a quick test it appears to work on Linux: By “works on Linux”, I assume you mean “works on filesystems that use inodes and hard links”. That is not true for all f

Re: Overriding True and False ?

2017-01-30 Thread Steve D'Aprano
On Tue, 31 Jan 2017 03:12 am, Ian Kelly wrote: > On Jan 30, 2017 1:32 AM, "Irv Kalb" wrote: > > I teach intro to programming using Python. In my first assignment, > students are asked to assign variables of different types and print out > the values. [...] Hey Ian, Your news reader or mail cl

How to write libreoffice python macros in venv?

2017-01-30 Thread Jim
I have all the necessary libreoffice modules installed in my Mint 18.1 system to allow me to write libreoffice calc macros in python. I now have venv installed. If I try to import uno for a calc macro in it I get an error that there is no uno module. How can I get my venv to find uno and the

Re: What library/package to use for parsing XML?

2017-01-30 Thread Rob Gaddi
On 01/30/2017 02:14 PM, Juan C. wrote: On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote: I want to parse some XML data, it's the address book data from the linux program osmo. The file I want to parse is like this:- Just like Irmen said, use the default xml.etree.ElementTree, it's amazing

Re: What library/package to use for parsing XML?

2017-01-30 Thread Juan C.
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- Just like Irmen said, use the default xml.etree.ElementTree, it's amazing and very simple to use. -- https://mai

Re: What library/package to use for parsing XML?

2017-01-30 Thread Irmen de Jong
On 30-1-2017 18:58, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- > [snip] > > I basically want to be able to extract the data and output in other > formats - e.g. write to a Sqlite3 databas

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Irmen de Jong
On 30-1-2017 21:33, Joseph L. Casale wrote: >> Python still has my heart, but .NET Core tempts me. One great thing of >> coding in C# would be no GIL. > > Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks. Results vary quite a bit there. For instance take the json serial

RE: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Joseph L. Casale
> Python still has my heart, but .NET Core tempts me. One great thing of > coding in C# would be no GIL. Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks. I think aside from the obvious, you'll find the Razor engine and the overall library to be a pleasure to work with

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Juan C.
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. wrote: > > As you guys might know, .NET Core is up and running, promising a > "cross-platform, unified, fast, lightweight, modern and open source > experience" (source: .NET Core official site). What do you guys think about > it? Do you think it will be

What library/package to use for parsing XML?

2017-01-30 Thread Chris Green
I want to parse some XML data, it's the address book data from the linux program osmo. The file I want to parse is like this:- None Peter and Denise Smith 0 0 Some address AAA BBB Oxfo

Re: Rename file without overwriting existing files

2017-01-30 Thread Marko Rauhamaa
Grant Edwards : > IMO, beginners shouldn't be using the os module. Hard to know. Depends on what the beginner wants to accomplish. > I always found the first sentence to be a bit funny: > > This module provides a portable way of using operating system > dependent functionality. > > I u

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 1:32 AM, "Irv Kalb" wrote: I teach intro to programming using Python. In my first assignment, students are asked to assign variables of different types and print out the values. One student (who really did not understand Booleans) turned in the following for his/her interpretati

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 2:00 AM, "Chris Angelico" wrote: (Interestingly, Ellipsis is not included in that.) Perhaps because it's rather unusual for a program to depend upon the value of Ellipsis. -- https://mail.python.org/mailman/listinfo/python-list

Re: count points where is within the polygons using shapely and fiona

2017-01-30 Thread Xristos Xristoou
tell your proposal to count -- https://mail.python.org/mailman/listinfo/python-list

Re: Rename file without overwriting existing files

2017-01-30 Thread Grant Edwards
On 2017-01-30, Terry Reedy wrote: > On 1/30/2017 8:58 AM, Peter Otten wrote: >> Jussi Piitulainen wrote: > >>> It doesn't seem to be documented. >> >> For functions with a C equivalent a look into the man page is usually >> helpful. > > Man pages do not exist on Windows. I suspect that there are

Re: Rename file without overwriting existing files

2017-01-30 Thread Grant Edwards
On 2017-01-30, Jussi Piitulainen wrote: > It doesn't seem to be documented. I looked at help(os.link) on Python > 3.4 and the corresponding current library documentation on the web. I > saw no mention of what happens when dst exists already. The functions in the os module are thin-as-possible wr

Re: Rename file without overwriting existing files

2017-01-30 Thread Jon Ribbens
On 2017-01-30, Peter Otten <__pete...@web.de> wrote: > Jon Ribbens wrote: >> On 2017-01-30, Peter Otten <__pete...@web.de> wrote: >>> However, the current Python version of link() is sufficiently different >>> from >>>, say, to warrant its own documentation. >> >>

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Peter Otten
Meeran Rizvi wrote: > I just want to save it as a xls file and also from xls file i need to get > the data and display in a text box. > > Or either i just display the output in my text widget and also save it as > an xls file What exactly you want to do is up to you; just try your hands at it

Re: Rename file without overwriting existing files

2017-01-30 Thread Peter Otten
Chris Angelico wrote: > On Tue, Jan 31, 2017 at 12:58 AM, Peter Otten <__pete...@web.de> wrote: >>> I looked at help(os.link) on Python >>> 3.4 and the corresponding current library documentation on the web. I >>> saw no mention of what happens when dst exists already. >>> >>> Also, creating a har

RE: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Joseph L. Casale
> What do you mean by "both platforms"? Python scripts already run on > three major operating systems (Win/Lin/Mac) and a good number of > less-popular OSes; a well-written Python script will run in four major > Pythons (CPython, PyPy, Jython, IronPython) and a number of others; > and all manner of

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Meeran Rizvi
On Monday, January 30, 2017 at 8:26:07 PM UTC+5:30, Meeran Rizvi wrote: > On Monday, January 30, 2017 at 8:19:47 PM UTC+5:30, Peter Otten wrote: > > Meeran Rizvi wrote: > > > > > On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: > > >> Hello Guys, > > >> Here i am creating a

Re: Rename file without overwriting existing files

2017-01-30 Thread Terry Reedy
On 1/30/2017 8:58 AM, Peter Otten wrote: Jussi Piitulainen wrote: It doesn't seem to be documented. For functions with a C equivalent a look into the man page is usually helpful. Man pages do not exist on Windows. I suspect that there are more individual Python programs on Windows than *

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Meeran Rizvi
On Monday, January 30, 2017 at 8:19:47 PM UTC+5:30, Peter Otten wrote: > Meeran Rizvi wrote: > > > On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: > >> Hello Guys, > >> Here i am creating a GUI which will act as a search engine that will find > >> the results from the brow

Re: Rename file without overwriting existing files

2017-01-30 Thread Jussi Piitulainen
Peter Otten writes: > Jussi Piitulainen wrote: > >> Peter Otten writes: >> >>> Steve D'Aprano wrote: > The wider context is that I'm taking from 1 to path names to existing files as arguments, and for each path name I transfer the file name part (but not the directory part) and th

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Peter Otten
Meeran Rizvi wrote: > On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: >> Hello Guys, >> Here i am creating a GUI which will act as a search engine that will find >> the results from the browser and save the results as a xls file. When i >> typed something in my search box

Re: Rename file without overwriting existing files

2017-01-30 Thread Peter Otten
Jon Ribbens wrote: > On 2017-01-30, Peter Otten <__pete...@web.de> wrote: >> Jon Ribbens wrote: >>> A lot of the functions of the 'os' module do nothing but call the >>> underlying OS system call with the same name. It would not only be >>> redundant to copy the OS documentation into the Python do

Re: Rename file without overwriting existing files

2017-01-30 Thread Chris Angelico
On Tue, Jan 31, 2017 at 12:58 AM, Peter Otten <__pete...@web.de> wrote: >> I looked at help(os.link) on Python >> 3.4 and the corresponding current library documentation on the web. I >> saw no mention of what happens when dst exists already. >> >> Also, creating a hard link doesn't seem to work be

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Meeran Rizvi
On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: > Hello Guys, > Here i am creating a GUI which will act as a search engine that will find the > results from the browser and save the results as a xls file. > When i typed something in my search box and click the (GO)button.I

Re: Rename file without overwriting existing files

2017-01-30 Thread Jon Ribbens
On 2017-01-30, Peter Otten <__pete...@web.de> wrote: > Jon Ribbens wrote: >> A lot of the functions of the 'os' module do nothing but call the >> underlying OS system call with the same name. It would not only be >> redundant to copy the OS documentation into the Python documentation, >> it would b

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Meeran Rizvi
On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: > Hello Guys, > Here i am creating a GUI which will act as a search engine that will find the > results from the browser and save the results as a xls file. > When i typed something in my search box and click the (GO)button.I

Re: Rename file without overwriting existing files

2017-01-30 Thread Peter Otten
Jussi Piitulainen wrote: > Peter Otten writes: > >> Steve D'Aprano wrote: >>> The wider context is that I'm taking from 1 to >>> path names to existing files as arguments, and for each path name I >>> transfer the file name part (but not the directory part) and then rename >>> the file. For exa

Re: Rename file without overwriting existing files

2017-01-30 Thread Peter Otten
Jon Ribbens wrote: > On 2017-01-30, Jussi Piitulainen wrote: >> It doesn't seem to be documented. I looked at help(os.link) on Python >> 3.4 and the corresponding current library documentation on the web. I >> saw no mention of what happens when dst exists already. >> >> Also, creating a hard lin

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Peter Otten
Peter Otten wrote: > PS: You can verify that you understood this by answering the question: > what happens if the user hits the go-button while the second thread is > still running. Hint: as written the script does not handle this correctly. On second thought it's probably not as bad as I thought

Re: Rename file without overwriting existing files

2017-01-30 Thread Jon Ribbens
On 2017-01-30, Jussi Piitulainen wrote: > It doesn't seem to be documented. I looked at help(os.link) on Python > 3.4 and the corresponding current library documentation on the web. I > saw no mention of what happens when dst exists already. > > Also, creating a hard link doesn't seem to work betw

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Peter Otten
Meeran Rizvi wrote: > On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: >> Hello Guys, >> Here i am creating a GUI which will act as a search engine that will find >> the results from the browser and save the results as a xls file. When i >> typed something in my search box

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Meeran Rizvi
On Monday, January 30, 2017 at 12:02:40 PM UTC+5:30, Meeran Rizvi wrote: > Hello Guys, > Here i am creating a GUI which will act as a search engine that will find the > results from the browser and save the results as a xls file. > When i typed something in my search box and click the (GO)button.I

Re: Rename file without overwriting existing files

2017-01-30 Thread Wolfgang Maier
On 01/30/2017 03:49 AM, Steve D'Aprano wrote: This code contains a Time Of Check to Time Of Use bug: if os.path.exists(destination) raise ValueError('destination already exists') os.rename(oldname, destination) In the microsecond between checking for the existence of the destin

Re: Rename file without overwriting existing files

2017-01-30 Thread Jussi Piitulainen
Peter Otten writes: > Steve D'Aprano wrote: > >> On Mon, 30 Jan 2017 03:33 pm, Cameron Simpson wrote: >> >>> On 30Jan2017 13:49, Steve D'Aprano wrote: This code contains a Time Of Check to Time Of Use bug: if os.path.exists(destination) raise ValueError('destination

Re: Rename file without overwriting existing files

2017-01-30 Thread Peter Otten
Steve D'Aprano wrote: > On Mon, 30 Jan 2017 03:33 pm, Cameron Simpson wrote: > >> On 30Jan2017 13:49, Steve D'Aprano wrote: >>>This code contains a Time Of Check to Time Of Use bug: >>> >>>if os.path.exists(destination) >>>raise ValueError('destination already exists') >>>os.rena

Re: Is shutil.get_terminal_size useless?

2017-01-30 Thread Paul Moore
On Monday, 30 January 2017 05:37:32 UTC, Steven D'Aprano wrote: > On Monday 30 January 2017 08:12, Serhiy Storchaka wrote: > > > On 28.01.17 10:03, Steve D'Aprano wrote: > >> Is shutil.get_terminal_size useless? When, if ever, should I use it in > >> preference to the os version? If the shutil ve

Re: Rename file without overwriting existing files

2017-01-30 Thread Steve D'Aprano
On Mon, 30 Jan 2017 03:33 pm, Cameron Simpson wrote: > On 30Jan2017 13:49, Steve D'Aprano wrote: >>This code contains a Time Of Check to Time Of Use bug: >> >>if os.path.exists(destination) >>raise ValueError('destination already exists') >>os.rename(oldname, destination) >> >> >>

Re: Display a label while pressing the button in my GUI

2017-01-30 Thread Peter Otten
hmmeeranrizv...@gmail.com wrote: > Hello Guys, > Here i am creating a GUI which will act as a search engine that will find > the results from the browser and save the results as a xls file. When i > typed something in my search box and click the (GO)button.It should > display search in progress.wh

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Chris Angelico
On Mon, Jan 30, 2017 at 6:25 PM, Joseph L. Casale wrote: > .Net Core is fundamentally different and much like Python in the way that > a compiler and runtime for a common language syntax specification has been > written for multiple platforms. So in general, the same Python script could > run on b

Re: Overriding True and False ?

2017-01-30 Thread Chris Angelico
On Mon, Jan 30, 2017 at 4:03 PM, Irv Kalb wrote: > It seems very odd that Python allows you to override the values of True and > False. In the code, True and False were clearly recognized as keywords as > they were colored purple. But there was no error message. > > You cannot assign new value

Re: Overriding True and False ?

2017-01-30 Thread Chris Angelico
On Mon, Jan 30, 2017 at 6:50 PM, Deborah Swanson wrote: > Looks like the moral of the story is that in Python 2.7 you can redefine > keywords, so long as you don't get any syntax errors after (or during) > redefinition. The moral is actually that "True" and "False" aren't keywords in Py2. They're