Reading a random element from a set

2017-07-26 Thread ast
Hello random.choice on a set doesn't work because sets are not indexable so I found nothing better than taking an element and puting it back a = {5, 7, 8, 3, 0, 8, 1, 15, 16, 34, 765443} elt = a.pop() a.add(elt) any better idea, in a single instruction ? -- https://mail.python.org/mailm

Re: Recent Spam problem

2017-07-26 Thread Tim Golden
On 25/07/2017 06:13, Rustom Mody wrote: Of late there has been an explosion of spam Thought it was only a google-groups (USENET?) issue and would be barred from the mailing list. But then find its there in the mailing list archives as well Typical example: https://mail.python.org/pipermail/pyt

Re: Reading a random element from a set

2017-07-26 Thread Steven D'Aprano
On Wed, 26 Jul 2017 08:58:03 +0200, ast wrote: > Hello > > random.choice on a set doesn't work because sets are not indexable > > so I found nothing better than taking an element and puting it back > > a = {5, 7, 8, 3, 0, 8, 1, 15, 16, 34, 765443} > elt = a.pop() > a.add(elt) That's not *rand

Re: Reading a random element from a set

2017-07-26 Thread ast
"Steven D'Aprano" a écrit dans le message de news:597841eb$0$2878$c3e8da3$76491...@news.astraweb.com... On Wed, 26 Jul 2017 08:58:03 +0200, ast wrote: Hello random.choice on a set doesn't work because sets are not indexable so I found nothing better than taking an element and puting it bac

Re: Reading a random element from a set

2017-07-26 Thread Peter Otten
ast wrote: > Hello > > random.choice on a set doesn't work because sets are > not indexable > > so I found nothing better than taking an element and > puting it back > > a = {5, 7, 8, 3, 0, 8, 1, 15, 16, 34, 765443} > elt = a.pop() > a.add(elt) > > any better idea, in a single instruction ? >

Regular expression

2017-07-26 Thread Kunal Jamdade
There is a filename say:- 'first-324-True-rms-kjhg-Meterc639.html' . I want to extract the last 4 characters. I tried different regex. but i am not getting it right. Can anyone suggest me how should i proceed.? Regards, Kunal -- https://mail.python.org/mailman/listinfo/python-list

Re: Regular expression

2017-07-26 Thread Johann Spies
On 26 July 2017 at 13:52, Kunal Jamdade wrote: > There is a filename say:- 'first-324-True-rms-kjhg-Meterc639.html' . > > I want to extract the last 4 characters. I tried different regex. but i am > not getting it right. > > Can anyone suggest me how should i proceed.? What have you tried? Why d

Re: Regular expression

2017-07-26 Thread Paul Barry
Is this what you are after? *>>> *data = 'first-324-True-rms-kjhg-Meterc639.html' *>>> *extension = data.find('.html') *>>> *extension 33 *>>> *data[extension-4:extension] 'c639' On 26 July 2017 at 13:00, Johann Spies wrote: > On 26 July 2017 at 13:52, Kunal Jamdade wrote: > > There is a

Re: Regular expression

2017-07-26 Thread Peter Otten
Kunal Jamdade wrote: > There is a filename say:- 'first-324-True-rms-kjhg-Meterc639.html' . > > I want to extract the last 4 characters. I tried different regex. but i am > not getting it right. > > Can anyone suggest me how should i proceed.? You don't need a regular expression: >>> import os

Re: Regular expression

2017-07-26 Thread Andre Müller
fname = 'first-324-True-rms-kjhg-Meterc639.html' # with string manipulation stem, suffix = fname.rsplit('.', 1) print(stem[-4:]) # oo-style with str manipulation import pathlib path = pathlib.Path(fname) print(path.stem[-4:]) -- https://mail.python.org/mailman/listinfo/python-list

Re: Regular expression

2017-07-26 Thread Jussi Piitulainen
Kunal Jamdade writes: > There is a filename say:- 'first-324-True-rms-kjhg-Meterc639.html' . > > I want to extract the last 4 characters. I tried different regex. but > i am not getting it right. > > Can anyone suggest me how should i proceed.? os.path.splitext(name) # most likely; also: os.path

Basic python understanding

2017-07-26 Thread monica . snow1
Hi I am in need some understanding on how to become more knowledgeable while interviewing a candidate that requires Python and other (see below) experience for a position with Mass Mutual as Developer, Systems Design Engineer, Web Engineer Director, Web Engineer Consultant, and Full Stack Devel

Re: Basic python understanding

2017-07-26 Thread Peter Otten
monica.sn...@gmail.com wrote: > Hi I am in need some understanding on how to become more knowledgeable > while interviewing a candidate that requires Python and other (see below) > experience for a position with Mass Mutual as Developer, Systems Design > Engineer, Web Engineer Director, Web Engin

zipapp should not include temporary files?

2017-07-26 Thread Irmen de Jong
Hi, when creating an executable zip file using the zipapp module, it's a little sad to see that no effort is done to filter out obvious temporary files: the resulting zipfile contains any *.pyc/pyo files and other things such as .git, .tox, .tmp folders. The documentation says "zip is created f

Will my project be accepted in pypi?

2017-07-26 Thread Kryptxy via Python-list
Hello, I have built a command-line torrent fetching tool. The tool fetches torrents from thepiratebay proxy sites, and display results in console. Its written in python3, and is completely open-source. Project link - https://github.com/kryptxy/torrench (You may give it a try :p) Question: (a) C

Re: Basic python understanding

2017-07-26 Thread jladasky
On Wednesday, July 26, 2017 at 8:06:19 AM UTC-7, Monica Snow wrote: > Hi I am in need some understanding on how to become more knowledgeable while > interviewing a candidate that requires Python and other (see below) > experience... I just want to jump in to say thank you, Ms. Snow, for making

Re: Basic python understanding

2017-07-26 Thread Adam M
On Wednesday, July 26, 2017 at 11:06:19 AM UTC-4, Monica Snow wrote: > Hi I am in need some understanding on how to become more knowledgeable while > interviewing a candidate that requires Python and other (see below) > experience for a position with Mass Mutual as Developer, Systems Design > E

Re: Basic python understanding

2017-07-26 Thread MRAB
On 2017-07-26 20:04, Stefan Ram wrote: monica.sn...@gmail.com writes: Hi I am in need some understanding on how to become more knowledgeable while interviewing a candidate that requires Python The only noun preceding "that" is "candidate". So, are you using "that" to refer to the candid

Re: zipapp should not include temporary files?

2017-07-26 Thread Paul Moore
On Wednesday, 26 July 2017 18:37:15 UTC+1, Irmen de Jong wrote: > when creating an executable zip file using the zipapp module, it's a little > sad to see > that no effort is done to filter out obvious temporary files: the resulting > zipfile > contains any *.pyc/pyo files and other things such

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

2017-07-26 Thread yasirrbadamasi
Thank you for your responses, i really appreciate -- https://mail.python.org/mailman/listinfo/python-list

Re: Basic python understanding

2017-07-26 Thread Rick Johnson
On Wednesday, July 26, 2017 at 3:45:35 PM UTC-5, MRAB wrote: > On 2017-07-26 20:04, Stefan Ram wrote: > > monica.sn...@gmail.com writes: > > > Hi I am in need some understanding on how to become more > > > knowledgeable while interviewing a candidate that > > > requires Python > > > > The only no

Re: Will my project be accepted in pypi?

2017-07-26 Thread Chris Angelico
On Thu, Jul 27, 2017 at 4:06 AM, Kryptxy via Python-list wrote: > Hello, > I have built a command-line torrent fetching tool. The tool fetches torrents > from thepiratebay proxy sites, and display results in console. Its written in > python3, and is completely open-source. > > Project link - htt

Re: Basic python understanding

2017-07-26 Thread Jeremiah Dodds
monica.sn...@gmail.com writes: > What would be some questions and answers so I gain a strong > understanding of my candidate that has Python experience? In addition to the resources others have pointed you at, it's worth mentioning that it can be very hard to gauge experience past the basics if y

python install in chromebook

2017-07-26 Thread Byung-Hee HWANG (황병희, 黃炳熙)
firstly i did fail to send message via mailing list so i try again with usenet here comp.lang.python. i want to install python in chromebook because i have chromebook and i want to make code of python. somebody could help me, i believe. thanks in advance... -- ^고맙습니다 _地平天成_ 감사합니다_^))// -- https:

python in chromebook

2017-07-26 Thread Byung-Hee HWANG (황병희, 黃炳熙)
my computer is chromebook. how can i install python in chromebook? barely i did meet develop mode of chromebook. also i'm new to python. INDEED, i want to make python code on my chromebook. thanks in avance!!! -- ^고맙습니다 _布德天下_ 감사합니다_^))// -- https://mail.python.org/mailman/listinfo/python

Re: python in chromebook

2017-07-26 Thread boB Stepp
On Wed, Jul 26, 2017 at 8:03 PM, Byung-Hee HWANG (황병희, 黃炳熙) wrote: > my computer is chromebook. how can i install python in chromebook? > barely i did meet develop mode of chromebook. also i'm new to > python. > > INDEED, i want to make python code on my chromebook. > Googling for "python on chro

Re: python in chromebook

2017-07-26 Thread Byung-Hee HWANG (황병희, 黃炳熙)
boB Stepp 께서 쓰시길, 《記事 全文 에서》: > Googling for "python on chromebook" tends to bring up Python 2-slanted > info; searching for "python 3 on chromebook" for Python 3-slanted > results should give you useful info. A quick scan suggests there are > two approaches: (1) Going into developer mode o

Re: Recent Spam problem

2017-07-26 Thread breamoreboy
On Wednesday, July 26, 2017 at 8:29:07 AM UTC+1, Tim Golden wrote: > On 25/07/2017 06:13, Rustom Mody wrote: > > Of late there has been an explosion of spam > > Thought it was only a google-groups (USENET?) issue and would be barred > > from the mailing list. > > > > But then find its there in the

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

2017-07-26 Thread Paul Rubin
Chris Angelico writes: >>> 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 on reading that. Good job Steven! https://en.wikipedia.org/wiki/BDS_C -- https://mail.python.org/mailman

Re: Basic python understanding

2017-07-26 Thread Gregory Ewing
I'd like to add that what you should really be looking for is not a Python programmer as such, but simply a good, competent programmer. Any decent programmer will be able to quickly pick up what they need to know about Python on the job. If they can't, then they're not good enough, and you should

Re: Recent Spam problem

2017-07-26 Thread Gregory Ewing
breamore...@gmail.com wrote: Hence why I asked a couple of weeks back why we don't just bin the existing group and start afresh with a new, properly moderated group. Someone would need to volunteer to be the moderator. Also, moderation is something of a consenting-adults thing on usenet. It's