Re: 'string.join' is wrong in my Python console

2015-12-02 Thread dieter
Robert writes: > I read the tutorial on "Why is join() a string method instead of a list > or tuple method?" > at link: > https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls > > I have a problem on running the last line: > --- >

Re: regarding download issues from sharepoint site

2015-12-02 Thread dieter
Arpit Arya writes: > i am facing problem downloading files from sharepoint site and to display > it on my web portal. Your sentence above mentions to processes "downloading" and "displaying". Which of the two gives you problems? For the one with the problems, you must describe it in detail: how

'string.join' is wrong in my Python console

2015-12-02 Thread Robert
Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link: https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls I have a problem on running the last line: --- If none of these arguments

storing test logs under /var/log/

2015-12-02 Thread Ganesh Pal
Hi Team , I would need few tips from your past experiences on how to store the test logs My requirement is to capture log under /var/log/ directory every time the test is run . The test will create one small log files which are around 1KB in size . Here is how I plan to approach this ,

Re: filter a list of strings

2015-12-02 Thread Jussi Piitulainen
writes: > I would like to know how this could be done more elegant/pythonic. > > I have a big list (over 10.000 items) with strings (each 100 to 300 > chars long) and want to filter them. > > list = . > > for item in list[:]: > if 'Banana' in item: > list.remove(item) > if 'Car' in i

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Chris in Makati
On Wed, 2 Dec 2015 08:57:44 + (UTC), Juha Nieminen wrote: >In comp.lang.c++ Steve Hayes wrote: >> You download things FROM a computer, you upload them TO a computer. > >It's a matter of perspective. If a hacker breaks into your computer and >starts a download from somewhere else into your co

Re: how to make the below code look better

2015-12-02 Thread Chris Angelico
On Thu, Dec 3, 2015 at 5:20 PM, Ganesh Pal wrote: >> The first suggestion I'd make is to avoid the comma syntax for >> exception handling. Replace "except Exception, e:" with "except >> Exception as e:". That's a trivial change of syntax that shouldn't >> affect your code at all; consider it low-h

Re: how to make the below code look better

2015-12-02 Thread Ganesh Pal
On Wed, Dec 2, 2015 at 6:00 PM, Chris Angelico wrote: > If both the functions return true values, yes. You have an indentation > error there, but I'm assuming you meant to have the try/except > indented further. > Correct I had meant to have try/except indented further. >> 2. Can I have a if sta

filter a list of strings

2015-12-02 Thread c.buhtz
I would like to know how this could be done more elegant/pythonic. I have a big list (over 10.000 items) with strings (each 100 to 300 chars long) and want to filter them. list = . for item in list[:]: if 'Banana' in item: list.remove(item) if 'Car' in item: list.remove(item)

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Steve Hayes
On Thu, 03 Dec 2015 06:21:45 +0200, Steve Hayes wrote: >On Wed, 2 Dec 2015 15:20:13 + (UTC), Grant Edwards > wrote: > >>On 2015-12-02, Richard Heathfield wrote: >>> On 02/12/15 08:57, Juha Nieminen wrote: In comp.lang.c++ Steve Hayes wrote: > You download things FROM a computer, yo

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Steve Hayes
On Wed, 2 Dec 2015 15:20:13 + (UTC), Grant Edwards wrote: >On 2015-12-02, Richard Heathfield wrote: >> On 02/12/15 08:57, Juha Nieminen wrote: >>> In comp.lang.c++ Steve Hayes wrote: You download things FROM a computer, you upload them TO a computer. >>> >>> It's a matter of perspectiv

Re: stuff and nonsense

2015-12-02 Thread Denis McMahon
On Thu, 03 Dec 2015 01:46:44 +0100, Laura Creighton wrote: > In a message of Wed, 02 Dec 2015 22:51:13 +, Denis McMahon writes: >>On Wed, 02 Dec 2015 11:32:25 -0600, Ian Kelly wrote: >> >>> In what way is discussion of a tangential topic feeding the troll? >>> Said troll is not even participat

Re: Does Python 2.7 do Open Office

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 18:50:34 -0500, Seymore4Head writes: >I have a text file I would like to search through but I have tried it >before. I don't remember why they are not compatible together, but I >wanted to ask to make sure. > >I know I can convert the file to plain text but it woul

Re: Does Python 2.7 do Open Office

2015-12-02 Thread MRAB
On 2015-12-02 23:50, Seymore4Head wrote: I have a text file I would like to search through but I have tried it before. I don't remember why they are not compatible together, but I wanted to ask to make sure. I know I can convert the file to plain text but it would be nice not to have to do that

Re: stuff and nonsense

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 22:51:13 +, Denis McMahon writes: >On Wed, 02 Dec 2015 11:32:25 -0600, Ian Kelly wrote: > >> In what way is discussion of a tangential topic feeding the troll? Said >> troll is not even participating in the discussion. > >Reposting / responding / following up wi

Re: HELP PLEASE printing single characters!

2015-12-02 Thread John Strick
On Wednesday, December 2, 2015 at 12:58:30 PM UTC-6, Dylan Riley wrote: > hi all, > I have been trying to figure out all day why my code is printing single > characters from my list when i print random elements using random.choice the > elements in the list are not single characters for example w

Re: Subclassing tuple and introspection

2015-12-02 Thread Joseph L. Casale
> If you're not already familiar with collections.namedtuple, have a > look at it, as it sounds like just naming the fields may be all that > you need. You can also subclass it further to add methods if desired. Yeah, all the types in these collections are named tuples... The collection itself isn

Does Python 2.7 do Open Office

2015-12-02 Thread Seymore4Head
I have a text file I would like to search through but I have tried it before. I don't remember why they are not compatible together, but I wanted to ask to make sure. I know I can convert the file to plain text but it would be nice not to have to do that. -- https://mail.python.org/mailman/list

Re: Subclassing tuple and introspection

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 4:32 PM, Joseph L. Casale wrote: > I need to return a collection of various types, since python doesn't > have the terse facility of extension methods like C#, subclassing tuple > and adding a method seems like a terse way to accommodate this. If you're not already familiar

Re: Python 3.5.0: python.exe is not a valid Windows 32 application

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 4:09 PM, wrote: > Hi. > > https://mail.python.org/pipermail/python-dev/2015-July/140823.html > Python 3.5 was dropped the support Windows XP and 2003. > > > > It's just an aside, but Python 3.5.1 works on my customized Windows 2000 :P > http://blog.livedoor.jp/blackwingcat/

Subclassing tuple and introspection

2015-12-02 Thread Joseph L. Casale
I need to return a collection of various types, since python doesn't have the terse facility of extension methods like C#, subclassing tuple and adding a method seems like a terse way to accommodate this. However, if the method returns one element of the collection, how can one enable introspectio

Re: Python 3.5.0: python.exe is not a valid Windows 32 application

2015-12-02 Thread blackwingcat2000
Hi. https://mail.python.org/pipermail/python-dev/2015-July/140823.html Python 3.5 was dropped the support Windows XP and 2003. It's just an aside, but Python 3.5.1 works on my customized Windows 2000 :P http://blog.livedoor.jp/blackwingcat/archives/1917281.html -- https://mail.python.org/mailm

Re: stuff and nonsense

2015-12-02 Thread Denis McMahon
On Wed, 02 Dec 2015 11:32:25 -0600, Ian Kelly wrote: > In what way is discussion of a tangential topic feeding the troll? Said > troll is not even participating in the discussion. Reposting / responding / following up with the original subject boosts the visibility of the subject to internet sea

Re: Question about split method

2015-12-02 Thread Robert
On Wednesday, December 2, 2015 at 3:45:34 PM UTC-5, Ian wrote: > On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: > > Hi, > > > > I learn split method online. When I try to run the line with ss1 beginning, > > I don't understand why its output of ss1 and ss2. I have check the help > > about split. It

Re: Question about split method

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: > Hi, > > I learn split method online. When I try to run the line with ss1 beginning, > I don't understand why its output of ss1 and ss2. I have check the help > about split. It looks like that it is a numpy method. > What is the split method parameter

Question about split method

2015-12-02 Thread Robert
Hi, I learn split method online. When I try to run the line with ss1 beginning, I don't understand why its output of ss1 and ss2. I have check the help about split. It looks like that it is a numpy method. What is the split method parameter (within " ") for? Thanks, ... ss0="1, 2

Re: static variables

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 9:30 AM, Antoon Pardon wrote: > Op 02-12-15 om 15:15 schreef Ian Kelly: >> On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon >> wrote: >>> Op 02-12-15 om 14:11 schreef Steven D'Aprano: On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: > If you want your arguments

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 1:44 PM, Dylan Riley wrote: > hi ian what would be the correct code to use in this situation then because > as far as i am aware the elements of my list should be printed as whole > elements and not just characters of the elements. order.append(choice) -- https://mail.py

Re: "Downloading"

2015-12-02 Thread Emile van Sebille
On 12/2/2015 8:37 AM, Marko Rauhamaa wrote: Grant Edwards : On 2015-12-01, Chris Angelico wrote: download is initiated by the recipient; an upload is initiated by the sender. Nope. It doesn't depend on who initiated the transfer, up/down is a direction. I upload things to the Host on the I

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Dylan Riley
On Wednesday, December 2, 2015 at 7:09:23 PM UTC, Ian wrote: > On Wed, Dec 2, 2015 at 12:58 PM, Dylan Riley wrote: > > hi all, > > I have been trying to figure out all day why my code is printing single > > characters from my list when i print random elements using random.choice > > the elements

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 12:58 PM, Dylan Riley wrote: > hi all, > I have been trying to figure out all day why my code is printing single > characters from my list when i print random elements using random.choice the > elements in the list are not single characters for example when i print, > pri

HELP PLEASE printing single characters!

2015-12-02 Thread Dylan Riley
hi all, I have been trying to figure out all day why my code is printing single characters from my list when i print random elements using random.choice the elements in the list are not single characters for example when i print, print(LIST[random.choice]) i get: ["e", "x", "a", "m", "p", "l", "

Re: python message

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 15:53:08 -0200, jorge.conr...@cptec.inpe.br wr ites: > > > >Hi, > > >I'm a new user of Pyhton and I run my code lenetcdf1.py and I plot the >figure but I had this message: > > >/usr/lib64/python2.7/site-packages/matplotlib/collections.py:590: >FutureWarning: eleme

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Albert Visser
On Tue, 01 Dec 2015 22:15:08 +0100, Rick Johnson wrote: On Tuesday, December 1, 2015 at 10:56:27 AM UTC-6, John Gordon wrote: Rick Johnson writes: > Your lament does remind me of a pet peeve i have concerning Python, and > that is, the lie about: "THERE SHOULD BE ONE (AND PREFERABLY ONLY

python message

2015-12-02 Thread jorge . conrado
Hi, I'm a new user of Pyhton and I run my code lenetcdf1.py and I plot the figure but I had this message: /usr/lib64/python2.7/site-packages/matplotlib/collections.py:590: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise c

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 10:36 AM, Keith Thompson wrote: > Juha Nieminen writes: >> In comp.lang.c++ Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> It's a matter of perspective. If a hacker breaks into your computer and >> starts a download from so

Q4 Quant Coding Competition in Python

2015-12-02 Thread quantiacsllc
$2.25M for the best three trading algos. You pocket 10% of the profits with no downside risk. The winner of one of our last competitions made $4,000 in the past five weeks with an initial investment of $1M. We provide a free and open-source toolbox in Python. It comes with 25 years of financial

Re: Is secretly downloading to your computer ?!

2015-12-02 Thread Rob Hills
On 03/12/15 00:53, Laura Creighton wrote: > This is one of my favourite quotes of all time. Unfortunately, you > have it slightly wrong. The quote is: > Something must be done. This is something. Therefore we must do it. I wish people would check their email subjects before replying to this t

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 08:36:24 -0800, Keith Thompson writes: >"We must do something. This is something. Therefore, we must do this." >-- Antony Jay and Jonathan Lynn, "Yes Minister" This is one of my favourite quotes of all time. Unfortunately, you have it slightly wrong. The q

Re: "Downloading"

2015-12-02 Thread Marko Rauhamaa
Grant Edwards : > On 2015-12-01, Chris Angelico wrote: >> download is initiated by the recipient; an upload is initiated by the >> sender. > > Nope. It doesn't depend on who initiated the transfer, up/down is a > direction. I upload things to the Host on the Internet, and I download > things to

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Keith Thompson
Juha Nieminen writes: > In comp.lang.c++ Steve Hayes wrote: >> You download things FROM a computer, you upload them TO a computer. > > It's a matter of perspective. If a hacker breaks into your computer and > starts a download from somewhere else into your computer, isn't the hacker > "downloadin

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 15:15 schreef Ian Kelly: > On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon > wrote: >> Op 02-12-15 om 14:11 schreef Steven D'Aprano: >>> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: >>> If you want your arguments to be taken seriously, then you better should. If you use

Re: regarding download issues from sharepoint site

2015-12-02 Thread me
On 2015-12-02, Arpit Arya wrote: > please help me out http://catb.org/~esr/faqs/smart-questions.html#beprecise -- https://mail.python.org/mailman/listinfo/python-list

Re: how to make the below code look better

2015-12-02 Thread me
On 2015-12-02, Ganesh Pal wrote: > if not os.path.ismount("/tmp"): >sys.exit("/tmp not mounted.") > else: > if create_dataset() and check_permission(): > try: > run_full_back_up() > run_partial_back_up() > except Exception, e: > logging.er

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Grant Edwards
On 2015-12-02, Richard Heathfield wrote: > On 02/12/15 08:57, Juha Nieminen wrote: >> In comp.lang.c++ Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> It's a matter of perspective. If a hacker breaks into your computer and >> starts a download from

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Grant Edwards
On 2015-12-02, Les Cargill wrote: > Juha Nieminen wrote: >> In comp.lang.c++ Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> It's a matter of perspective. If a hacker breaks into your computer and >> starts a download from somewhere else into your

Re: "Downloading"

2015-12-02 Thread Grant Edwards
On 2015-12-01, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 6:05 AM, Random832 wrote: >> On 2015-12-01, Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> I'm a little bit confused as to what kinds of file transfers >> you think don't have at least

Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 14:42:48 +, Mark Lawrence writes: >On 02/12/2015 13:59, Laura Creighton wrote: >> In a message of Wed, 02 Dec 2015 13:30:38 +, Mark Lawrence writes: >>> 0) before asking search for "python installation problem" just in case >>> you're not the first person to

Re: Installation Problem

2015-12-02 Thread Mark Lawrence
On 02/12/2015 13:59, Laura Creighton wrote: In a message of Wed, 02 Dec 2015 13:30:38 +, Mark Lawrence writes: 0) before asking search for "python installation problem" just in case you're not the first person to have this issue. That is not a good idea, there are so many different hits fo

Re: static variables

2015-12-02 Thread Mark Lawrence
On 02/12/2015 14:07, Antoon Pardon wrote: Op 02-12-15 om 14:48 schreef Mark Lawrence: Would the pair of you, Antoon and Steven, be kind enough to take your bickering offline, thanks. Mark, you are in no position to make such a request of others. I am, I'm sat perfectly comfortably thank yo

Re: static variables

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon wrote: > Op 02-12-15 om 14:11 schreef Steven D'Aprano: >> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: >> >>> If you want your arguments to be taken seriously, then you better should. >>> If you use an argument when it suits you and ignore it when

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 14:48 schreef Mark Lawrence: > > Would the pair of you, Antoon and Steven, be kind enough to take your > bickering offline, thanks. > Mark, you are in no position to make such a request of others. -- Antoon. -- https://mail.python.org/mailman/listinfo/python-list

Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 13:30:38 +, Mark Lawrence writes: >0) before asking search for "python installation problem" just in case >you're not the first person to have this issue. That is not a good idea, there are so many different hits for that. The first one I get is this: http://s

Re: how to make the below code look better

2015-12-02 Thread Chris Angelico
On Thu, Dec 3, 2015 at 12:28 AM, Steven D'Aprano wrote: >> if not os.path.ismount("/tmp"): >>sys.exit("/tmp not mounted.") > > This is good enough for quick and dirty scripts, but this is vulnerable to a > race condition. It may be that /tmp is mounted *now*, but a millisecond > later

Re: static variables

2015-12-02 Thread Mark Lawrence
On 02/12/2015 13:41, Antoon Pardon wrote: Op 02-12-15 om 14:11 schreef Steven D'Aprano: On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: If you want your arguments to be taken seriously, then you better should. If you use an argument when it suits you and ignore it when it doesn't you are sho

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 14:11 schreef Steven D'Aprano: > On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: > >> If you want your arguments to be taken seriously, then you better should. >> If you use an argument when it suits you and ignore it when it doesn't >> you are showing you don't really have an argu

Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 12:08:02 +, Packie Kelly writes: >Hi my name is Patrick, > >I have a problem regarding the installation of the latest version of >python, everytime I install the program I keep getting the message modify, >repair, uninstall. I've tried different versions but wit

Re: Installation Problem

2015-12-02 Thread Mark Lawrence
On 02/12/2015 13:12, Chris Angelico wrote: On Wed, Dec 2, 2015 at 11:08 PM, Packie Kelly wrote: Hi my name is Patrick, I have a problem regarding the installation of the latest version of python, everytime I install the program I keep getting the message modify, repair, uninstall. I've tried d

Re: how to make the below code look better

2015-12-02 Thread Steven D'Aprano
On Wed, 2 Dec 2015 11:11 pm, Ganesh Pal wrote: > Hello team, > > I need suggestion to improve the below code , Iam on Linux and python 2.7 > > if not os.path.ismount("/tmp"): >sys.exit("/tmp not mounted.") This is good enough for quick and dirty scripts, but this is vulnerable to a

Re: static variables

2015-12-02 Thread Steven D'Aprano
On Wed, 2 Dec 2015 10:30 pm, Marko Rauhamaa wrote: > Antoon Pardon : > >> Op 02-12-15 om 11:18 schreef Marko Rauhamaa: >>> I don't know why global accessibility is such a problem. >> >> Some people seem to have a problem with global variables. > > Well, *I* don't go around defining global variab

Re: static variables

2015-12-02 Thread Steven D'Aprano
On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: > If you want your arguments to be taken seriously, then you better should. > If you use an argument when it suits you and ignore it when it doesn't > you are showing you don't really have an argument. You are just showing > your preference and mak

Re: Installation Problem

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 11:08 PM, Packie Kelly wrote: > Hi my name is Patrick, > > I have a problem regarding the installation of the latest version of > python, everytime I install the program I keep getting the message modify, > repair, uninstall. I've tried different versions but with no luck. B

RE: Installation Problem

2015-12-02 Thread Packie Kelly
Hi my name is Patrick, I have a problem regarding the installation of the latest version of python, everytime I install the program I keep getting the message modify, repair, uninstall. I've tried different versions but with no luck. Before you ask I have already completely removed the program. L

Re: how to make the below code look better

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 11:20 PM, BartC wrote: > You could make the indentation more consistent. Example: You fixed one indentation error... > if create_dataset() and check_permission(): > try: > run_full_back_up() > run_partial_back_up() > except Excep

Re: how to make the below code look better

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 11:11 PM, Ganesh Pal wrote: > I need suggestion to improve the below code , Iam on Linux and python 2.7 > > if not os.path.ismount("/tmp"): >sys.exit("/tmp not mounted.") > else: > if create_dataset() and check_permission(): > try: > run_full

Re: how to make the below code look better

2015-12-02 Thread BartC
On 02/12/2015 12:11, Ganesh Pal wrote: if not os.path.ismount("/tmp"): sys.exit("/tmp not mounted.") else: if create_dataset() and check_permission(): try: run_full_back_up() run_partial_back_up() except Exception, e: logging.error

how to make the below code look better

2015-12-02 Thread Ganesh Pal
Hello team, I need suggestion to improve the below code , Iam on Linux and python 2.7 if not os.path.ismount("/tmp"): sys.exit("/tmp not mounted.") else: if create_dataset() and check_permission(): try: run_full_back_up() run_partial_back_up() except

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread eryk sun
On Wed, Dec 2, 2015 at 3:28 AM, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 7:22 PM, Serhiy Storchaka wrote: >> >> I use vars() exclusively for introspection in interactive environment. As >> well as dir() and help(). Sad that it doesn't work with __slots__. > > Maybe the upshot of all this is

Re: static variables

2015-12-02 Thread Marko Rauhamaa
Antoon Pardon : > Op 02-12-15 om 11:18 schreef Marko Rauhamaa: >> I don't know why global accessibility is such a problem. > > Some people seem to have a problem with global variables. Well, *I* don't go around defining global variables, but there are times when they are the way to go. For exampl

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 11:22 schreef Steven D'Aprano: > On Wed, 2 Dec 2015 07:34 pm, Antoon Pardon wrote: > >> Op 02-12-15 om 02:24 schreef Steven D'Aprano: >>> Heh, I agree, and as I suggested, it might be good to have an actual >>> mechanism for static locals. But using a class is no better: your "static

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 9:48 PM, Peter Otten <__pete...@web.de> wrote: >> I try to do as much as I can with standard library tools. As a user, I >> find it somewhat off-putting when a tiny project asks you to install any >> number of seemingly unrelated libraries. But clize does look like a good >>

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 11:18 schreef Marko Rauhamaa: > Antoon Pardon : > >> def foo() >>foo.attr >> >> changes nothing about foo.attr being globally accessible. > I don't know why global accessibility is such a problem. Some people seem to have a problem with global variables. -- Antoon. -- https:

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Peter Otten
Manolo Martínez wrote: > On 12/02/15 at 08:33pm, Chris Angelico wrote: >> On Wed, Dec 2, 2015 at 8:09 PM, Manolo Martínez >> > This... is true. I could have sworn that's not the way argparse behaved >> > when I wrote that snippet, but I've been very wrong before about >> > similar things. Anyway m

Re: static variables

2015-12-02 Thread Steven D'Aprano
On Wed, 2 Dec 2015 07:34 pm, Antoon Pardon wrote: > Op 02-12-15 om 02:24 schreef Steven D'Aprano: >> Heh, I agree, and as I suggested, it might be good to have an actual >> mechanism for static locals. But using a class is no better: your "static >> storage" is exposed as an instance attribute, an

Re: static variables

2015-12-02 Thread Marko Rauhamaa
Antoon Pardon : > def foo() >foo.attr > > changes nothing about foo.attr being globally accessible. I don't know why global accessibility is such a problem. Anyway, in practice I handle such "static" variables as module globals. If you want a more puristic solution, you could do: def _ma

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Les Cargill
Juha Nieminen wrote: In comp.lang.c++ Steve Hayes wrote: You download things FROM a computer, you upload them TO a computer. It's a matter of perspective. If a hacker breaks into your computer and starts a download from somewhere else into your computer, isn't the hacker "downloading" things

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Manolo Martínez
On 12/02/15 at 08:33pm, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 8:09 PM, Manolo Martínez > > This... is true. I could have sworn that's not the way argparse behaved > > when I wrote that snippet, but I've been very wrong before about similar > > things. Anyway my main() function looks much b

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 10:23 schreef Chris Angelico: > On Wed, Dec 2, 2015 at 7:21 PM, Antoon Pardon > wrote: >> I think python is unsuited for an obvious solution for static locals. >> Because you need to initialise your static variable somewhere. If you >> initialise whithin the body of your function, y

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Richard Heathfield
On 02/12/15 08:57, Juha Nieminen wrote: In comp.lang.c++ Steve Hayes wrote: You download things FROM a computer, you upload them TO a computer. It's a matter of perspective. If a hacker breaks into your computer and starts a download from somewhere else into your computer, isn't the hacker "d

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 8:09 PM, Manolo Martínez wrote: > Peter Otten wrote: >> As far as I can see in a correctly written script the AttributeError cannot >> be triggered by the user as argparse handles this case automatically by >> showing the help. > > This... is true. I could have sworn that's

Re: Installation of Python troubles

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 2:11 PM, bezan deme via Python-list wrote: > I tried several times to install the Python 3.5.0 (windows x86 executable > installer) in my PC then in my LT and in both cases I failed. Last time, few > hours ago, I tried it again, then it opened a window with a sole "cancel"

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 7:22 PM, Serhiy Storchaka wrote: > On 01.12.15 03:00, Steven D'Aprano wrote: >> >> I'm trying to understand why vars() exists. Does anyone use it? > > > I use vars() exclusively for introspection in interactive environment. As > well as dir() and help(). Sad that it doesn't

Re: static variables

2015-12-02 Thread Chris Angelico
On Wed, Dec 2, 2015 at 7:21 PM, Antoon Pardon wrote: > I think python is unsuited for an obvious solution for static locals. > Because you need to initialise your static variable somewhere. If you > initialise whithin the body of your function, you will have a statement > that is essentialy a decl

regarding download issues from sharepoint site

2015-12-02 Thread Arpit Arya
hi, i am facing problem downloading files from sharepoint site and to display it on my web portal. i have used requests_ntlm module which gives successful authorisation but i am stuck in next step i.e. to download data from sharepoint site and dispaly on portal. please help me out Regards Arpit -

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Manolo Martínez
Dear Peter, and Steven, thanks again for engaging with my script. I'm fully aware that this is not the tutor mailing list :) Peter Otten wrote: > As far as I can see in a correctly written script the AttributeError cannot > be triggered by the user as argparse handles this case automatically by

Installation of Python troubles

2015-12-02 Thread bezan deme via Python-list
Dear supporters, I tried several times to install the Python 3.5.0 (windows x86 executable installer) in my PC then in my LT and in both cases I failed. Last time, few hours ago, I tried it again, then it opened a window with a sole "cancel" button on it. I waited for 10-15 min without anything

Re: 4D arrays

2015-12-02 Thread Manolo Martínez
On 12/01/15 at 06:47pm, Peter Otten wrote: > Extract 2D arrays: > > >>> a[:,2,3] > array([[ 55, 56, 57, 58, 59], >[115, 116, 117, 118, 119]]) > >>> a[1,:,2] > array([[ 70, 71, 72, 73, 74], >[ 90, 91, 92, 93, 94], >[110, 111, 112, 113, 114]]) The first one is eq

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Juha Nieminen
In comp.lang.c++ Steve Hayes wrote: > You download things FROM a computer, you upload them TO a computer. It's a matter of perspective. If a hacker breaks into your computer and starts a download from somewhere else into your computer, isn't the hacker "downloading" things to your computer? ---

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 02:24 schreef Steven D'Aprano: > Heh, I agree, and as I suggested, it might be good to have an actual > mechanism for static locals. But using a class is no better: your "static > storage" is exposed as an instance attribute, and even if you flag it > private, *somebody* is going to

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Serhiy Storchaka
On 01.12.15 03:00, Steven D'Aprano wrote: I'm trying to understand why vars() exists. Does anyone use it? I use vars() exclusively for introspection in interactive environment. As well as dir() and help(). Sad that it doesn't work with __slots__. -- https://mail.python.org/mailman/listinfo/

Re: static variables

2015-12-02 Thread Antoon Pardon
Op 02-12-15 om 02:24 schreef Steven D'Aprano: > Python has three not-entirely-awful solutions to the problem of static > locals, but no really great or obvious one. I think python is unsuited for an obvious solution for static locals. Because you need to initialise your static variable somewhere.