Re: I am new here and i need your help please

2017-07-25 Thread Rustom Mody
On Wednesday, July 26, 2017 at 12:11:27 PM UTC+5:30, dieter wrote: > yasirrbadamasi: > > > I have never execute any program before using python and a task was given > > to me by my teacher > > I suggest to start by reading the Python tutorial: > "https://docs.python.org/3/tutorial/index.html";.

Re: python file downloader not working

2017-07-25 Thread dieter
Rahul Sircar writes: > So I recently tried to write a script using urllib2 module. > Here is the code below: > import urllib2 > file = 'metasploitable-linux-2.0.0.zip' > url='https://downloads.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip' > response = urll

Re: I am new here and i need your help please

2017-07-25 Thread dieter
yasirrbadam...@gmail.com writes: > I have never execute any program before using python and a task was given to > me by my teacher I suggest to start by reading the Python tutorial: "https://docs.python.org/3/tutorial/index.html";. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to group by function if one of the group has relationship with another one in the group?

2017-07-25 Thread ast
"Ho Yeung Lee" a écrit dans le message de news:ef0bd11a-bf55-42a2-b016-d93f3b831...@googlegroups.com... from itertools import groupby testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)] def isneighborlocation(lo1, lo2): if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]: return 1 eli

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Steve D'Aprano
On Wed, 26 Jul 2017 06:06 am, Chris Angelico wrote: > Hmm. Aside from messing around with exec, is there any way to have a > local and a global with the same name, and use the global? Use globals['name']. There's no way to do it with regular name look ups. This doesn't work: spam = 'outside'

Re: Recent Spam problem

2017-07-25 Thread Michael F. Stemper
On 2017-07-25 10:03, alister wrote: On Tue, 25 Jul 2017 17:29:56 +1000, Chris Angelico wrote: On Tue, Jul 25, 2017 at 4:50 PM, wrote: I see two solutions: 1. We build new architecture or adept current one so it's more like a blockchain, have to calculate some hash before being able to post a

Re: Recent Spam problem

2017-07-25 Thread Grant Edwards
On 2017-07-25, Wildman via Python-list wrote: > The posts are being made through Google Groups. Forwarding > the posts with headers to groups-ab...@google.com might help. I never has in the past. I (and many others) have for years and years been plonking all posts made through Google Groups.

Re: I am new here and i need your help please

2017-07-25 Thread Wildman via Python-list
On Tue, 25 Jul 2017 00:48:25 -0700, yasirrbadamasi wrote: > I have never execute any program before using python and a task was given to > me by my teacher > ~ to write a python program to print my details and store in a third party > variables. > ~ the details include name, age, height, status

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Chris Angelico
On Wed, Jul 26, 2017 at 4:36 AM, eryk sun wrote: > On Tue, Jul 25, 2017 at 8:43 AM, Chris Angelico wrote: >> >> I'm not actually sure what happens if you use a global declaration at >> top level. Is it ignored? Is it an error? > > It isn't ignored, but it shouldn't make a difference since normall

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Ian Kelly
On Tue, Jul 25, 2017 at 5:38 AM, Thomas Jollans wrote: > On 2017-07-25 09:28, Chris Angelico wrote: >> It actually does the equivalent of: >> >> finally: >> e = None > > I wonder why it would bother to load None... (as someone not very > familiar with Python at the bytecode level) If I may ha

Re: Recent Spam problem

2017-07-25 Thread Wildman via Python-list
On Mon, 24 Jul 2017 23:01:43 -0700, Paul Rubin wrote: > Rustom Mody writes: >> Since spammers are unlikely to be choosy about whom they spam: >> Tentative conclusion: Something about the USENET-ML gateway is more leaky >> out here than elsewhere > > It could be a sort-of DOS attack by some disgr

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread eryk sun
On Tue, Jul 25, 2017 at 8:43 AM, Chris Angelico wrote: > > I'm not actually sure what happens if you use a global declaration at > top level. Is it ignored? Is it an error? It isn't ignored, but it shouldn't make a difference since normally at module level locals and globals are the same. It make

Python BeautifulSoup extract html table cells that contains images and text

2017-07-25 Thread Umar Yusuf
Hi all, I need help extracting the table from this url...? from bs4 import BeautifulSoup url = "https://www.marinetraffic.com/en/ais/index/ports/all/per_page:50"; headers = {'User-agent': 'Mozilla/5.0'} raw_html = requests.get(url, headers=headers) raw_data = raw_html.text soup_data = Beautiful

python file downloader not working

2017-07-25 Thread Rahul Sircar
So I recently tried to write a script using urllib2 module. Here is the code below: import urllib2 file = 'metasploitable-linux-2.0.0.zip' url='https://downloads.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip' response = urllib2.urlopen(url) fh=open(file,'w')

Re: Recent Spam problem

2017-07-25 Thread alister via Python-list
On Tue, 25 Jul 2017 17:29:56 +1000, Chris Angelico wrote: > On Tue, Jul 25, 2017 at 4:50 PM, wrote: >> I see two solutions: >> >> 1. We build new architecture or adept current one so it's more like a >> blockchain, have to calculate some hash before being able to post and >> upload and such. >>

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Thomas Jollans
On 2017-07-25 09:28, Chris Angelico wrote: > On Tue, Jul 25, 2017 at 4:47 PM, Rustom Mody wrote: >> +1 >> You can call it bug or bug-promoted-to-feature :D >> >> I call it surprising because I dont know of any other case in python where >> a delete is user-detectable >> ie python's delete of objec

Re: how to group by function if one of the group has relationship with another one in the group?

2017-07-25 Thread Peter Otten
Ho Yeung Lee wrote: > from itertools import groupby > > testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)] > def isneighborlocation(lo1, lo2): > if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]: > return 1 > elif abs(lo1[1] - lo2[1]) == 1 or lo1[0] == lo2[0]: > return 1 >

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Chris Angelico
On Tue, Jul 25, 2017 at 6:10 PM, Ben Finney wrote: > I think those are not the only two options (the “except clause has its > own scope” behaviour is an option that could have been chosen, for > example). > > At this point the behaviour and motivation are clear, having been > revealed; I disagree

Re: OT was Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Chris Angelico
On Tue, Jul 25, 2017 at 6:33 PM, Steven D'Aprano wrote: > On Mon, 24 Jul 2017 23:47:17 -0700, Rustom Mody wrote: > > > [...] >> Bipartisan-US-Bill-Moves-to-Criminalize-BDS-Support-20170720-0001.html > > > Heh, at first I read that as a bill to criminalise BSD support :-) > I spluttered my drink o

RELEASED] Python 3.4.7rc1 and Python 3.5.4rc1 are now available

2017-07-25 Thread Larry Hastings
On behalf of the Python development community and the Python 3.4 and Python 3.5 release teams, I'm relieved to announce the availability of Python 3.4.7rc1 and Python 3.5.4rc1. Python 3.4 is now in "security fixes only" mode. This is the final stage of support for Python 3.4. Python 3.4 no

OT was Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Steven D'Aprano
On Mon, 24 Jul 2017 23:47:17 -0700, Rustom Mody wrote: [...] > Bipartisan-US-Bill-Moves-to-Criminalize-BDS-Support-20170720-0001.html Heh, at first I read that as a bill to criminalise BSD support :-) -- “You are deluded if you think software engineers who can't write operating systems or

Re: I am new here and i need your help please

2017-07-25 Thread Steven D'Aprano
On Tue, 25 Jul 2017 00:48:25 -0700, yasirrbadamasi wrote: > I have never execute any program before using python and a task was > given to me by my teacher ~ to write a python program to print my > details and store in a third party variables. > ~ the details include name, age, height, status. so

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 25 Jul 2017 17:02:48 +1000, Ben Finney wrote: > > > I suppose my objection is rooted in the fact this behaviour is > > implicit; my code has not issued a ‘del’ statement, and so I don't > > expect one; yet it occurs implicitly. This violates the Zen of > > Python

I am new here and i need your help please

2017-07-25 Thread yasirrbadamasi
I have never execute any program before using python and a task was given to me by my teacher ~ to write a python program to print my details and store in a third party variables. ~ the details include name, age, height, status. so please your help is highly needed, thanks -- https://mail.pyth

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Steven D'Aprano
On Tue, 25 Jul 2017 17:02:48 +1000, Ben Finney wrote: > Ben Finney writes: > >> Having to make another name for the same object, merely to avoid some >> surprising behaviour, is IMO un-Pythonic. > > I suppose my objection is rooted in the fact this behaviour is implicit; > my code has not issue

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Steven D'Aprano
On Tue, 25 Jul 2017 00:01:11 -0700, Ethan Furman wrote: > On 07/24/2017 11:47 PM, Rustom Mody wrote: > >> Interesting to see this adjacent to news that non-participation is >> about to be criminalized double of [snip] > > Rustom, All, > > This is a Python mailing list. Please keep the topics m

Re: Recent Spam problem

2017-07-25 Thread Chris Angelico
On Tue, Jul 25, 2017 at 4:50 PM, wrote: > I see two solutions: > > 1. We build new architecture or adept current one so it's more like a > blockchain, have to calculate some hash before being able to post and upload > and such. > > or > > 2. We counter-attack by installing a special tool, so we

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Chris Angelico
On Tue, Jul 25, 2017 at 4:47 PM, Rustom Mody wrote: > +1 > You can call it bug or bug-promoted-to-feature :D > > I call it surprising because I dont know of any other case in python where > a delete is user-detectable > ie python's delete of objects always works quietly behind the scenes whereas >

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Steven D'Aprano
On Mon, 24 Jul 2017 21:48:56 -0700, Rustom Mody wrote: > On Tuesday, July 25, 2017 at 7:12:44 AM UTC+5:30, Ben Finney quoted > Thomas Jefferson's : > >> The cost of education is trivial compared to the cost of ignorance. > > > An interesting standard of “trivial”… given… You're reading the qu

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Ben Finney
Ben Finney writes: > Having to make another name for the same object, merely to avoid some > surprising behaviour, is IMO un-Pythonic. I suppose my objection is rooted in the fact this behaviour is implicit; my code has not issued a ‘del’ statement, and so I don't expect one; yet it occurs impli

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Stefan Behnel
Ben Finney schrieb am 25.07.2017 um 08:34: > Ethan Furman writes: > >> Something like: >> >> try: >> >> except ZeroDivisionError as dead_exc: >> exc = dead_exc >> >> >> print(text_template.format(exc=exc) > > That strikes me as busy-work; the

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Ethan Furman
On 07/24/2017 11:47 PM, Rustom Mody wrote: Interesting to see this adjacent to news that non-participation is about to be criminalized double of [snip] Rustom, All, This is a Python mailing list. Please keep the topics marginally on-topic. Thanks. -- ~Ethan~ -- https://mail.python.org/ma