From dougal at dougalmatthews.com Fri Apr 4 12:17:00 2014 From: dougal at dougalmatthews.com (Dougal Matthews) Date: Fri, 4 Apr 2014 11:17:00 +0100 Subject: [Python Glasgow] Pub Meetup on Tuesday 8th of April in Babbity Bowster Message-ID: Hi All, The next Python Glasgow event will be a Pub Meetup in 7 days on the Tuesday 8th of April at Babbity Bowster. There will be a printed Python logo on the table so everyone can find us. Look forward to seeing you all there! Cheers, Dougal -------------- next part -------------- An HTML attachment was scrubbed... URL: From dougal at dougalmatthews.com Mon Apr 7 13:54:00 2014 From: dougal at dougalmatthews.com (Dougal Matthews) Date: Mon, 7 Apr 2014 12:54:00 +0100 Subject: [Python Glasgow] Pub Meetup tomorrow in Babbity Bowster Message-ID: Hey All, The next event is a pub meetup tomorrow from 6:30pm in Babbity Bowster[1]. We usually have a table to the left as you go into the bar area. Look for the printed Python logo which should be sitting on the table. The pub meetups are open to all that want to come along. It's a friendly gathering of Pythonistas of all skill levels and background. The evening is a very relaxed affair and involves lots of geeky chat. Look forward to seeing you there! Dougal [1]: http://www.babbitybowster.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dougal at dougalmatthews.com Mon Apr 14 20:46:16 2014 From: dougal at dougalmatthews.com (Dougal Matthews) Date: Mon, 14 Apr 2014 11:46:16 -0700 (PDT) Subject: [Python Glasgow] =?utf-8?q?Fwd=3A_=5Bpyconuk=5D_PyCon_UK_2014?= =?utf-8?b?4oCL?= In-Reply-To: References: Message-ID: <1397501176173.5c8752dd@Nodemailer> ---------- Forwarded message ---------- From: "John Pinner" Date: Mon, Apr 14, 2014 at 7:08 PM Subject: [pyconuk] PyCon UK 2014 To: "Mailing list for the PyCon UK conference" , "UK Python Users" , "Birmingham Linux User Group" > Hello All, > Hoping that not too many of you get multiple copies... > This is a reminder that PyCon UK takes place in Coventry from > 19th-22nd September. > Early Bird registration is open, but finishes on 1st May. > There is a cap on the number of Early Bird tickets, and they are half > sold at the moment, so don't make it too late ! > Best wishes, > John > -- > _______________________________________________ > pyconuk mailing list > pyconuk at python.org > https://mail.python.org/mailman/listinfo/pyconuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From dougal at dougalmatthews.com Wed Apr 23 15:16:10 2014 From: dougal at dougalmatthews.com (Dougal Matthews) Date: Wed, 23 Apr 2014 14:16:10 +0100 Subject: [Python Glasgow] Dojo next month 13th May Message-ID: Hey all, tl;dr - tickets: http://pythonglasgow-dojo-may-2014.eventbrite.co.uk/ Next month we are running another Dojo! Twig are graciously hosting us again and will be providing pizza and beer to fuel your coding. You will want to press buzzer 32 (4th floor) at the following address: 4th Floor 14 North Claremont Street G3 7LE Glasgow Twig are looking for people again: Server side dev: https://gist.github.com/aaronbassett/b51835d7ff6cefb5d7fa DevOps: https://gist.github.com/aaronbassett/fee751df115d62ff9e65 Junior server side dev: https://gist.github.com/aaronbassett/ecc09f043fdbe2b55b52 For those of you that don't know, a dojo is a fun coding event where we split into teams and hack on a problem for about 90-120 minutes. The focus is to create something in that time - you can either hack around, follow strict test driven development or any other process you like. It's great fun and ideal for learning too. *All* levels of Python ability are welcome as you can contribute to your team with ideas and discussion. This is a great way to start learning Python. Last month we all created ?Dojo idea generators? so at this Dojo I expect to see all sorts of interesting ideas on the wall! Most of the code written is on GitHub[1]: To find out more about the Dojo, we follow the format of the London Python Dojo[2] and I also created notes for running the Dojo as I forget things: http://dougalmatthews.com/notes/running-a-code-dojo/ The dojo's are usually really well attended so make sure to get your ticket now at: http://pythonglasgow-dojo-03-2014.eventbrite.co.uk/ Looking forward to seeing as many of you as possible there! Dougal [1]: https://github.com/python-glasgow/dojo-dojogenerator [2]: http://ntoll.org/article/how-to-run-an-awesome-code-dojo -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.st-jean at ecometrica.com Wed Apr 23 22:03:18 2014 From: eric.st-jean at ecometrica.com (=?UTF-8?B?w4lyaWM=?= St-Jean) Date: Wed, 23 Apr 2014 16:03:18 -0400 Subject: [Python Glasgow] Job posting - python developer in Edinburgh Message-ID: <20140423160318.1bf1cad8@ecometrica.com> Hi! I know, this is a Glasgow mailing list, and i'm posting about a job in Edinburgh, but maybe someone here has been wanting to move to Edinburgh? Here's your chance! ?Python Developer ? Edinburgh, UK. We are presently on the lookout for a Python Developer, based in our Edinburgh (Scotland) UK office. This is an immediate opening as a result of receiving a SMART: SCOTLAND Innovation Award and is for 1 year in the first instance. You will be reporting directly to our Chief Technical Officer, ?ric St-Jean in Montreal but working as part of our UK based GIS/Land Use Team. Ideally, you are very-well versed in at least some of: * Python (e.g., you know how metaclasses work, or how a large list will allocate memory upon the next append) * Backend Django development (e.g., you know querysets inside out - how and when they query the database, how their internal caches work) * Linux infrastructure (deployment, security, etc.) * Frontend development (you can do magic with Javascript, HTML and CSS) * Testing, both frontend (using e.g. windmill) and backend (python unittests) * Frontend design (usability, visual design) * Geographical information systems (we created our own screaming-fast storage and querying system, but knowing the basics of how GIS works would be handy) We're not expecting you to be an expert in all of this, but if you have a few of those points and are very smart, please apply! You must: * have a good sense of humour * work well in geographically dispersed teams * have good communications skills in English * deal well with receiving a vague problem description, and take matters in your own hands to make sure it gets solved to everybody's satisfaction with limited resources The challenges are numerous and great, in all areas - infrastructure, backend, algorithms, frontend design and implementation, etc. We really need you! In terms of perks, Ecometrica is a great place to work. Schedules are completely flexible, how you work and solve problems is also flexible, and you'll get a Mac or Linux laptop, your choice (or Windows if you really want that). It's like working for a startup, but a startup which is already doing well, with lots of blue chip clients, so there's much less stress. We're here for the long run, but you get to join while the company is still relatively young. We are shortly moving to a new West End Edinburgh office with unlimited coffee, tea and, a smart new working environment You may get to visit our other offices from time to time, and you need to be able/allowed to travel sparingly to Canada if necessary. We have a good benefits package and 27 days of paid holiday. Salary will depend on your experience, but will be competitive - we are open to receiving applications from very junior up to senior levels. The team is great, too. You won't be simply working in a dev team, you'll also be working with amazing, fun, very bright scientists both in Montr?al and in Edinburgh. You can send your CV to jobs at ecometrica.com. But please include links to sites you've built, projects you've completed, repos on github or bitbucket where you've contributed or are the lead developer, your twitter stream, or anything else that makes sense. -- ?ric St-Jean, MEng, ing. CTO, Ecometrica eric at ecometrica.com http://ecometrica.com Skype/MSN/Google Talk:wiswaud +1-514-585-9939 From hedieh.ebrahimi at amphos21.com Wed Apr 30 11:53:20 2014 From: hedieh.ebrahimi at amphos21.com (Hedieh Ebrahimi) Date: Wed, 30 Apr 2014 11:53:20 +0200 Subject: [Python Glasgow] consecuetive members of a list Message-ID: Hi all, Imagine I have a list like this: myList= [1, 7, 19, 1110] from this list I like to create a list of tuple of ranges like this. [(1,7),(7,19),(19,1110)] How can I do this in an efficient way ? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hedieh.ebrahimi at amphos21.com Wed Apr 30 12:19:39 2014 From: hedieh.ebrahimi at amphos21.com (Hedieh Ebrahimi) Date: Wed, 30 Apr 2014 12:19:39 +0200 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: Thanks Marc Ill try that out, but hopefully I just found this that works for me def createRangeOfIndices(self,myArray,d): ranges=[] for index in range(len(myArray)): if index < len(myArray)-1: myTuple=(myArray[index],myArray[index+1]) ranges.append(myTuple) return ranges Thanks :) On 30 April 2014 12:09, Marc Cameron wrote: > Hi Hedieh, > > myList = [1,7,19,1110] > newList = [] > for x in range(0, len(myList)-1): > newStr = "(,)" > newList.append("("+str(myList[x])+","+str(myList[x+1])+")") > > Not sure if it meets your requirements, although this should work for all > intents and purposes. I am still relatively new to python so there may be a > better way. > > Output = ['(1,7)', '(7,19)', '(19,1110)'] > > Cheers, > > Marc C > ------------------ > > Hi all, > > Imagine I have a list like this: > > myList= [1, 7, 19, 1110] > > from this list I like to create a list of tuple of ranges like this. > > [(1,7),(7,19),(19,1110)] > > How can I do this in an efficient way ? > > Thanks in advance. > > > On 30 April 2014 10:53, Hedieh Ebrahimi wrote: > >> Hi all, >> >> Imagine I have a list like this: >> >> myList= [1, 7, 19, 1110] >> >> from this list I like to create a list of tuple of ranges like this. >> >> [(1,7),(7,19),(19,1110)] >> >> How can I do this in an efficient way ? >> >> Thanks in advance. >> >> _______________________________________________ >> Glasgow mailing list >> Glasgow at python.org >> https://mail.python.org/mailman/listinfo/glasgow >> >> > > > -- > Marc Cameron > > *Contract Technical Artist and AR Generalist* > t: *+447595491710* > e: marccameron3D at gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marccameron3d at gmail.com Wed Apr 30 12:09:54 2014 From: marccameron3d at gmail.com (Marc Cameron) Date: Wed, 30 Apr 2014 11:09:54 +0100 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: Hi Hedieh, myList = [1,7,19,1110] newList = [] for x in range(0, len(myList)-1): newStr = "(,)" newList.append("("+str(myList[x])+","+str(myList[x+1])+")") Not sure if it meets your requirements, although this should work for all intents and purposes. I am still relatively new to python so there may be a better way. Output = ['(1,7)', '(7,19)', '(19,1110)'] Cheers, Marc C ------------------ Hi all, Imagine I have a list like this: myList= [1, 7, 19, 1110] from this list I like to create a list of tuple of ranges like this. [(1,7),(7,19),(19,1110)] How can I do this in an efficient way ? Thanks in advance. On 30 April 2014 10:53, Hedieh Ebrahimi wrote: > Hi all, > > Imagine I have a list like this: > > myList= [1, 7, 19, 1110] > > from this list I like to create a list of tuple of ranges like this. > > [(1,7),(7,19),(19,1110)] > > How can I do this in an efficient way ? > > Thanks in advance. > > _______________________________________________ > Glasgow mailing list > Glasgow at python.org > https://mail.python.org/mailman/listinfo/glasgow > > -- Marc Cameron *Contract Technical Artist and AR Generalist* t: *+447595491710* e: marccameron3D at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From marccameron3d at gmail.com Wed Apr 30 12:26:33 2014 From: marccameron3d at gmail.com (Marc Cameron) Date: Wed, 30 Apr 2014 11:26:33 +0100 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: Ah nice! You are welcome, it would seem that is more usable straight out the box. Also makes a Vector2 list rather than a nasty string list I was building! Thanks for sharing :) good luck with your project! M On 30 April 2014 11:19, Hedieh Ebrahimi wrote: > Thanks Marc > > Ill try that out, but hopefully I just found this that works for me > > def createRangeOfIndices(self,myArray,d): > ranges=[] > for index in range(len(myArray)): > if index < len(myArray)-1: > myTuple=(myArray[index],myArray[index+1]) > ranges.append(myTuple) > return ranges > > > Thanks :) > > > On 30 April 2014 12:09, Marc Cameron wrote: > >> Hi Hedieh, >> >> myList = [1,7,19,1110] >> newList = [] >> for x in range(0, len(myList)-1): >> newStr = "(,)" >> newList.append("("+str(myList[x])+","+str(myList[x+1])+")") >> >> Not sure if it meets your requirements, although this should work for all >> intents and purposes. I am still relatively new to python so there may be a >> better way. >> >> Output = ['(1,7)', '(7,19)', '(19,1110)'] >> >> Cheers, >> >> Marc C >> ------------------ >> >> Hi all, >> >> Imagine I have a list like this: >> >> myList= [1, 7, 19, 1110] >> >> from this list I like to create a list of tuple of ranges like this. >> >> [(1,7),(7,19),(19,1110)] >> >> How can I do this in an efficient way ? >> >> Thanks in advance. >> >> >> On 30 April 2014 10:53, Hedieh Ebrahimi wrote: >> >>> Hi all, >>> >>> Imagine I have a list like this: >>> >>> myList= [1, 7, 19, 1110] >>> >>> from this list I like to create a list of tuple of ranges like this. >>> >>> [(1,7),(7,19),(19,1110)] >>> >>> How can I do this in an efficient way ? >>> >>> Thanks in advance. >>> >>> _______________________________________________ >>> Glasgow mailing list >>> Glasgow at python.org >>> https://mail.python.org/mailman/listinfo/glasgow >>> >>> >> >> >> -- >> Marc Cameron >> >> *Contract Technical Artist and AR Generalist* >> t: *+447595491710* >> e: marccameron3D at gmail.com >> > > -- Marc Cameron *Contract Technical Artist and AR Generalist* t: *+447595491710* e: marccameron3D at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.smith at practicalpoetry.co.uk Wed Apr 30 12:31:45 2014 From: mark.smith at practicalpoetry.co.uk (Mark Smith) Date: Wed, 30 Apr 2014 11:31:45 +0100 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: You're going to love this - it's a trick I learned relatively recently . Firstly, what you're talking about is n-grams (in this case you want to generate 2-grams from a list). Secondly, the code is fiddly but short (it's the one-liner in the n-gram function below): a = [1, 7, 19, 1110] def ngram(seq, n): return zip(*[seq[n:] for n in range(n)]) print list(ngram(a, 2)) Hope this helps! --Mark On 30 April 2014 10:53, Hedieh Ebrahimi wrote: > Hi all, > > Imagine I have a list like this: > > myList= [1, 7, 19, 1110] > > from this list I like to create a list of tuple of ranges like this. > > [(1,7),(7,19),(19,1110)] > > How can I do this in an efficient way ? > > Thanks in advance. > > _______________________________________________ > Glasgow mailing list > Glasgow at python.org > https://mail.python.org/mailman/listinfo/glasgow > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jollynony at yahoo.com Wed Apr 30 12:33:12 2014 From: jollynony at yahoo.com (Nonso Ibenegbu) Date: Wed, 30 Apr 2014 11:33:12 +0100 Subject: [Python Glasgow] Consecutive members of a list (Hedieh Ebrahimi)-Glasgow Digest, Vol 16, Issue 5 In-Reply-To: References: Message-ID: <786ED884-33CF-44AC-AB41-556405DAA3AF@yahoo.com> Hi Hedieh, See if you like this: myList= [1, 7, 19, 1110] newList = [(myList[x-1], myList[x]) for x in range(1, len(myList))] Cheers. Nonso On 30 Apr 2014, at 11:00, glasgow-request at python.org wrote: > Send Glasgow mailing list submissions to > glasgow at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/glasgow > or, via email, send a message with subject or body 'help' to > glasgow-request at python.org > > You can reach the person managing the list at > glasgow-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Glasgow digest..." > > > Today's Topics: > > 1. consecuetive members of a list (Hedieh Ebrahimi) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 30 Apr 2014 11:53:20 +0200 > From: Hedieh Ebrahimi > To: Python Edinburgh > Subject: [Python Glasgow] consecuetive members of a list > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all, > > Imagine I have a list like this: > > myList= [1, 7, 19, 1110] > > from this list I like to create a list of tuple of ranges like this. > > [(1,7),(7,19),(19,1110)] > > How can I do this in an efficient way ? > > Thanks in advance. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Glasgow mailing list > Glasgow at python.org > https://mail.python.org/mailman/listinfo/glasgow > > > ------------------------------ > > End of Glasgow Digest, Vol 16, Issue 5 > ************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.smith at practicalpoetry.co.uk Wed Apr 30 12:40:04 2014 From: mark.smith at practicalpoetry.co.uk (Mark Smith) Date: Wed, 30 Apr 2014 11:40:04 +0100 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: Sorry - I rushed that, and the code is a bit horrible (even though it works). A better answer is: def ngram(seq, n): return zip(*[seq[i:] for i in range(n)]) (Note the extra variable 'i' instead of re-using 'n' - which was an accident) :-) Also, the result is already a list, so there's no need to wrap the function call with list() in the print statement. On 30 April 2014 11:26, Marc Cameron wrote: > Ah nice! You are welcome, it would seem that is more usable straight out > the box. Also makes a Vector2 list rather than a nasty string list I was > building! > > Thanks for sharing :) good luck with your project! > > M > > > On 30 April 2014 11:19, Hedieh Ebrahimi wrote: > >> Thanks Marc >> >> Ill try that out, but hopefully I just found this that works for me >> >> def createRangeOfIndices(self,myArray,d): >> ranges=[] >> for index in range(len(myArray)): >> if index < len(myArray)-1: >> myTuple=(myArray[index],myArray[index+1]) >> ranges.append(myTuple) >> return ranges >> >> >> Thanks :) >> >> >> On 30 April 2014 12:09, Marc Cameron wrote: >> >>> Hi Hedieh, >>> >>> myList = [1,7,19,1110] >>> newList = [] >>> for x in range(0, len(myList)-1): >>> newStr = "(,)" >>> newList.append("("+str(myList[x])+","+str(myList[x+1])+")") >>> >>> Not sure if it meets your requirements, although this should work for >>> all intents and purposes. I am still relatively new to python so there may >>> be a better way. >>> >>> Output = ['(1,7)', '(7,19)', '(19,1110)'] >>> >>> Cheers, >>> >>> Marc C >>> ------------------ >>> >>> Hi all, >>> >>> Imagine I have a list like this: >>> >>> myList= [1, 7, 19, 1110] >>> >>> from this list I like to create a list of tuple of ranges like this. >>> >>> [(1,7),(7,19),(19,1110)] >>> >>> How can I do this in an efficient way ? >>> >>> Thanks in advance. >>> >>> >>> On 30 April 2014 10:53, Hedieh Ebrahimi wrote: >>> >>>> Hi all, >>>> >>>> Imagine I have a list like this: >>>> >>>> myList= [1, 7, 19, 1110] >>>> >>>> from this list I like to create a list of tuple of ranges like this. >>>> >>>> [(1,7),(7,19),(19,1110)] >>>> >>>> How can I do this in an efficient way ? >>>> >>>> Thanks in advance. >>>> >>>> _______________________________________________ >>>> Glasgow mailing list >>>> Glasgow at python.org >>>> https://mail.python.org/mailman/listinfo/glasgow >>>> >>>> >>> >>> >>> -- >>> Marc Cameron >>> >>> *Contract Technical Artist and AR Generalist* >>> t: *+447595491710* >>> e: marccameron3D at gmail.com >>> >> >> > > > -- > Marc Cameron > > *Contract Technical Artist and AR Generalist* > t: *+447595491710* > e: marccameron3D at gmail.com > > _______________________________________________ > Glasgow mailing list > Glasgow at python.org > https://mail.python.org/mailman/listinfo/glasgow > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin.mcdermott at canonical.com Wed Apr 30 12:42:31 2014 From: kevin.mcdermott at canonical.com (Kevin McDermott) Date: Wed, 30 Apr 2014 11:42:31 +0100 Subject: [Python Glasgow] consecuetive members of a list In-Reply-To: References: Message-ID: <5360D397.9000908@canonical.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 30/04/14 10:53, Hedieh Ebrahimi wrote: > Hi all, > > Imagine I have a list like this: > > myList= [1, 7, 19, 1110] > > from this list I like to create a list of tuple of ranges like this. > > [(1,7),(7,19),(19,1110)] > > How can I do this in an efficient way ? > > This is so commonly done, that it's even documented in the Python standard library... https://docs.python.org/2/library/itertools.html see "pairwise" HTH, Kevin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlNg05cACgkQeXQZLS7Rd7JKogCeJq90QSwtDO+Xr5ab2jNSzQIC SRYAoMAM7GHf2/S1aTJFj6MvtjIVlSXL =HSzh -----END PGP SIGNATURE-----