From tom at viner.tv Thu Jun 2 04:26:28 2016 From: tom at viner.tv (Tom Viner) Date: Thu, 2 Jun 2016 09:26:28 +0100 Subject: [python-uk] London Dojo Tickets Up Message-ID: Morning all, As I mentioned last week, the dojo is on the 2nd Thursday of the month this time, due to PyCon. We're back at Bank of America and as usual we'll have our blend of food, drink, chatting and coding. As well as the give away book from O'Reilly and pub afterwards. That's the London Python Dojo, 6:30pm Thursday 9th June at Bank Of America. Come along, especially if you've never been before, it'll be fun: https://www.eventbrite.co.uk/e/london-python-code-dojo-season-7-episode-10-tickets-25827889914 Cheers, Tom https://twitter.com/ldnpydojo -------------- next part -------------- An HTML attachment was scrubbed... URL: From tibs at tibsnjoan.co.uk Thu Jun 2 15:29:50 2016 From: tibs at tibsnjoan.co.uk (Tibs) Date: Thu, 2 Jun 2016 20:29:50 +0100 Subject: [python-uk] Next CamPUG meeting: Tue 7th June 2016 Message-ID: <100FD711-5B50-44A2-ABD1-25382967A290@tibsnjoan.co.uk> The next Cambridge Python User Group meeting will be on Tuesday 7th June at 7pm, at the Raspberry Pi Foundation offices, 30 Station Road, Cambridge. Alex Chan will talk on Property based testing in Python. Alex says: ??"Property-based testing is a very powerful way to find bugs in your code. I?ll explain the basic principles of this style of testing, and demonstrate Hypothesis (http://hypothesis.works/), a property-based testing library for Python. I?ll start from first principles, and work up to real-world examples of Hypothesis in use. Plus some practical advice for using Hypothesis in production. I?ll also briefly touch upon American Fuzzy Lop, another randomised testing tool that?s similarly powerful. ??" Please note that we are now on meetup.com, at http://www.meetup.com/CamPUG/. If possible, please RSVP there for meetings so we have an idea of numbers. As an incentive, there's normally more detail about each meeting there, and you can also find out about future meetings. Tweeting may occur at https://twitter.com/campython Tibs From a.grandi at gmail.com Sun Jun 5 17:15:07 2016 From: a.grandi at gmail.com (a.grandi at gmail.com) Date: Sun, 5 Jun 2016 22:15:07 +0100 Subject: [python-uk] Xon Python shell Message-ID: Hi everyone, a friend of mine just made me discover this http://xon.sh/ I didn't even know it existed.... am I too late :P ? Cheers -- Andrea Grandi - Software Engineer Website: https://www.andreagrandi.it Twitter: https://twitter.com/andreagrandi GitHub: https://github.com/andreagrandi PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC From alex at moreati.org.uk Sun Jun 5 17:33:29 2016 From: alex at moreati.org.uk (Alex Willmer) Date: Sun, 5 Jun 2016 22:33:29 +0100 Subject: [python-uk] Xon Python shell In-Reply-To: References: Message-ID: > On 5 Jun 2016, at 22:15, "a.grandi at gmail.com" wrote: > > Hi everyone, > > a friend of mine just made me discover this http://xon.sh/ > > I didn't even know it existed.... am I too late :P ? It was news to me too. There was a talk about it at PyCon US last week, hence the wider interest. https://www.youtube.com/watch?v=uaje5I22kgE -------------- next part -------------- An HTML attachment was scrubbed... URL: From alistair.broomhead at gmail.com Wed Jun 8 08:10:08 2016 From: alistair.broomhead at gmail.com (Alistair Broomhead) Date: Wed, 08 Jun 2016 12:10:08 +0000 Subject: [python-uk] London Python Project Nights, Wed 15th Message-ID: It's that time again - Build Something (nee London Python Project Nights) is on again next Wednesday. Looking forward to seeing some/all of you there! http://www.meetup.com/London-Python-Project-Nights/events/226695748 This may be the last one at Skimlinks for a while, while I've worked there they've very kindly given us the space, but the security policy is such that a current employee must be there until the end to supervise and lock up. I'm over on to my next venture at the end of the month, and as far as I'm currently aware nobody else is able to commit to the timeslot. It is because of this that I'd like to put out a call for sponsors - if your company is based in central London and would be interested in hosting a small event (12-25 attendees) please get in contact! Thanks, Al -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.cook30 at ntlworld.com Thu Jun 9 08:11:39 2016 From: george.cook30 at ntlworld.com (george.cook30 at ntlworld.com) Date: Thu, 9 Jun 2016 15:11:39 +0300 Subject: [python-uk] easy stuff Message-ID: <0000aa6c2d2f$525a999f$45c2824e$@ntlworld.com> Hey, I've found a very easy tutorial on the stuff we were talking about, look here All best, george.cook30 at ntlworld.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at stevesimmons.com Mon Jun 13 19:56:24 2016 From: mail at stevesimmons.com (Stephen Simmons) Date: Tue, 14 Jun 2016 00:56:24 +0100 Subject: [python-uk] Microbit motion sensors at PyCon UK Teachers' Day Message-ID: <575F4828.8040505@stevesimmons.com> Hi everyone, Would anyone like to help me put together a microbit session for the PyCon UK teachers' day using motion sensors? My plan is to use python on the microbit to illustrate some motion-related maths/physics principles from accelerometer/gyroscope data. Ideally we would prepare some exercises with direct relevance to classwork that teachers could take back to their students and use right away. So if you know microbits and are keen to help, get in touch! If you are a teacher with ideas you'd to implement, or you know teachers with ideas, then get in touch too. The deadline for proposals is in 2 weeks... Cheers Stephen P.S. I have also submitted a proposal on sensor fusion algorithms for the main PyCon UK conference, using MetaWear PRO wearables. They can transmit 9-axis accelerometer/gyroscope/magnetometer data over Bluetooth in real time. The microbit, as I understand it (mine will arrive in 2 weeks...) doesn't have enough memory to load Python and Bluetooth together. So we will have to be more creative about logging/retrieving results. Plenty of time to work through this in July/August. First step is the proposal.... From leonaso43 at googlemail.com Mon Jun 20 04:41:16 2016 From: leonaso43 at googlemail.com (Leona So) Date: Mon, 20 Jun 2016 09:41:16 +0100 Subject: [python-uk] Microbit motion sensors at PyCon UK Teachers' Day In-Reply-To: <575F4828.8040505@stevesimmons.com> References: <575F4828.8040505@stevesimmons.com> Message-ID: Hi Stephen, I teach Maths at a FE college, have general interest in programming especially Python and would be more than happy to help. The only downside is I don't have access to a microbit, it's hard to get hold of one. I used it briefly during microbit training sessions with STEMNET, so I may be able to provide some ideas! Thanks. Regards, Leona On Tue, Jun 14, 2016 at 12:56 AM, Stephen Simmons wrote: > Hi everyone, > > > Would anyone like to help me put together a microbit session for the PyCon > UK teachers' day using motion sensors? My plan is to use python on the > microbit to illustrate some motion-related maths/physics principles from > accelerometer/gyroscope data. > > Ideally we would prepare some exercises with direct relevance to classwork > that teachers could take back to their students and use right away. > > So if you know microbits and are keen to help, get in touch! > > If you are a teacher with ideas you'd to implement, or you know teachers > with ideas, then get in touch too. > > The deadline for proposals is in 2 weeks... > > Cheers > Stephen > > P.S. I have also submitted a proposal on sensor fusion algorithms for the > main PyCon UK conference, using MetaWear PRO wearables. They can transmit > 9-axis accelerometer/gyroscope/magnetometer data over Bluetooth in real > time. The microbit, as I understand it (mine will arrive in 2 weeks...) > doesn't have enough memory to load Python and Bluetooth together. So we > will have to be more creative about logging/retrieving results. Plenty of > time to work through this in July/August. First step is the proposal.... > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stestagg at gmail.com Tue Jun 21 16:42:38 2016 From: stestagg at gmail.com (Stestagg) Date: Tue, 21 Jun 2016 20:42:38 +0000 Subject: [python-uk] Microbit motion sensors at PyCon UK Teachers' Day In-Reply-To: References: <575F4828.8040505@stevesimmons.com> Message-ID: Hi! I have a micro:bit and would love to help in any way possible. Feel free to get in touch if you would like to discuss Thanks Steve On Mon, 20 Jun 2016 at 09:42, Leona So via python-uk wrote: > Hi Stephen, > > I teach Maths at a FE college, have general interest in programming > especially Python and would be more than happy to help. The only downside > is I don't have access to a microbit, it's hard to get hold of one. I used > it briefly during microbit training sessions with STEMNET, so I may be able > to provide some ideas! > > Thanks. > > Regards, > > > Leona > > On Tue, Jun 14, 2016 at 12:56 AM, Stephen Simmons > wrote: > >> Hi everyone, >> >> >> Would anyone like to help me put together a microbit session for the >> PyCon UK teachers' day using motion sensors? My plan is to use python on >> the microbit to illustrate some motion-related maths/physics principles >> from accelerometer/gyroscope data. >> >> Ideally we would prepare some exercises with direct relevance to >> classwork that teachers could take back to their students and use right >> away. >> >> So if you know microbits and are keen to help, get in touch! >> >> If you are a teacher with ideas you'd to implement, or you know teachers >> with ideas, then get in touch too. >> >> The deadline for proposals is in 2 weeks... >> >> Cheers >> Stephen >> >> P.S. I have also submitted a proposal on sensor fusion algorithms for the >> main PyCon UK conference, using MetaWear PRO wearables. They can transmit >> 9-axis accelerometer/gyroscope/magnetometer data over Bluetooth in real >> time. The microbit, as I understand it (mine will arrive in 2 weeks...) >> doesn't have enough memory to load Python and Bluetooth together. So we >> will have to be more creative about logging/retrieving results. Plenty of >> time to work through this in July/August. First step is the proposal.... >> _______________________________________________ >> python-uk mailing list >> python-uk at python.org >> https://mail.python.org/mailman/listinfo/python-uk >> > > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas at kluyver.me.uk Tue Jun 21 17:33:25 2016 From: thomas at kluyver.me.uk (Thomas Kluyver) Date: Tue, 21 Jun 2016 22:33:25 +0100 Subject: [python-uk] Microbit motion sensors at PyCon UK Teachers' Day In-Reply-To: References: <575F4828.8040505@stevesimmons.com> Message-ID: <1466544805.266749.644580329.0FF09E35@webmail.messagingengine.com> I have two microbits, and prototype machinery to drive them from a Jupyter notebook, if that's of interest for anything. On Tue, Jun 21, 2016, at 09:42 PM, Stestagg wrote: > Hi! > > I have a micro:bit and would love to help in any way possible. > > Feel free to get in touch if you would like to discuss > > Thanks > > Steve > > On Mon, 20 Jun 2016 at 09:42, Leona So via python-uk uk at python.org> wrote: >> Hi Stephen, >> >> I teach Maths at a FE college, have general interest in programming >> especially Python and would be more than happy to help. The only >> downside is I don't have access to a microbit, it's hard to get hold >> of one. I used it briefly during microbit training sessions with >> STEMNET, so I may be able to provide some ideas! >> >> Thanks. >> >> Regards, >> >> >> Leona >> >> On Tue, Jun 14, 2016 at 12:56 AM, Stephen Simmons >> wrote: >>> Hi everyone, >>> >>> >>> Would anyone like to help me put together a microbit session for >>> the PyCon UK teachers' day using motion sensors? My plan is to use >>> python on the microbit to illustrate some motion-related >>> maths/physics principles from accelerometer/gyroscope data. >>> >>> Ideally we would prepare some exercises with direct relevance to >>> classwork that teachers could take back to their students and use >>> right away. >>> >>> So if you know microbits and are keen to help, get in touch! >>> >>> If you are a teacher with ideas you'd to implement, or you know >>> teachers with ideas, then get in touch too. >>> >>> The deadline for proposals is in 2 weeks... >>> >>> Cheers >>> Stephen >>> >>> P.S. I have also submitted a proposal on sensor fusion algorithms >>> for the main PyCon UK conference, using MetaWear PRO >>> wearables. They can transmit 9-axis >>> accelerometer/gyroscope/magnetometer data over Bluetooth in >>> real time. The microbit, as I understand it (mine will arrive >>> in 2 weeks...) doesn't have enough memory to load Python and >>> Bluetooth together. So we will have to be more creative about >>> logging/retrieving results. Plenty of time to work through >>> this in July/August. First step is the proposal.... >>> _______________________________________________ >>> python-uk mailing list >>> python-uk at python.org >>> https://mail.python.org/mailman/listinfo/python-uk >> >> _______________________________________________ >> python-uk mailing list >> python-uk at python.org >> https://mail.python.org/mailman/listinfo/python-uk > _________________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at stevesimmons.com Tue Jun 21 18:12:19 2016 From: mail at stevesimmons.com (Stephen Simmons) Date: Tue, 21 Jun 2016 23:12:19 +0100 Subject: [python-uk] Microbit motion sensors at PyCon UK Teachers' Day In-Reply-To: References: <575F4828.8040505@stevesimmons.com> Message-ID: <5769BBC3.2000000@stevesimmons.com> Hi Steve, Leona, Thanks for replying. I'll send an email followup shortly. The PyCon UK deadline proposal is Tues 28 June. Let's get a proposal together over the next few days. Stephen On 21/06/16 21:42, Stestagg wrote: > Hi! I have a micro:bit and would love to help in any way possible. Feel free to get in touch if you would like to discuss Thanks Steve > > On Mon, 20 Jun 2016 at 09:42, Leona So via python-uk > wrote: > > Hi Stephen, > > I teach Maths at a FE college, have general interest in programming especially Python and would be more than happy to help. The only downside is I don't have access to a microbit, it's hard to get hold of one. I used it briefly during microbit training sessions with STEMNET, so I may be able to provide some ideas! > > Thanks. > > Regards, > > > Leona > > On Tue, Jun 14, 2016 at 12:56 AM, Stephen Simmons > wrote: > > Hi everyone, > > > Would anyone like to help me put together a microbit session for the PyCon UK teachers' day using motion sensors? My plan is to use python on the microbit to illustrate some motion-related maths/physics principles from accelerometer/gyroscope data. > > Ideally we would prepare some exercises with direct relevance to classwork that teachers could take back to their students and use right away. > > So if you know microbits and are keen to help, get in touch! > > If you are a teacher with ideas you'd to implement, or you know teachers with ideas, then get in touch too. > > The deadline for proposals is in 2 weeks... > > Cheers > Stephen > > P.S. I have also submitted a proposal on sensor fusion algorithms for the main PyCon UK conference, using MetaWear PRO wearables. They can transmit 9-axis accelerometer/gyroscope/magnetometer data over Bluetooth in real time. The microbit, as I understand it (mine will arrive in 2 weeks...) doesn't have enough memory to load Python and Bluetooth together. So we will have to be more creative about logging/retrieving results. Plenty of time to work through this in July/August. First step is the proposal.... > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > > > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ford99 at ntlworld.com Fri Jun 24 13:44:58 2016 From: ford99 at ntlworld.com (ford99 at ntlworld.com) Date: Fri, 24 Jun 2016 20:44:58 +0300 Subject: [python-uk] improvement Message-ID: <000049a60f13$24769e52$8de0f9ae$@ntlworld.com> Hi, I've noticed a great improvement in your work, and I need your opinion about an issue, please take a look Kind regards, ford99 at ntlworld.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.inglesby at gmail.com Mon Jun 27 08:06:16 2016 From: peter.inglesby at gmail.com (Peter Inglesby) Date: Mon, 27 Jun 2016 13:06:16 +0100 Subject: [python-uk] PyCon UK update Message-ID: Hi everyone, Some PyCon UK updates: - The Call for Proposals closes tomorrow, and it's not too late to submit your proposal for a talk or workshop. Don't forget that we're offering speaker mentorship . We're particularly keen to hear from first-time speakers and people from under-represented groups. - Also closing tomorrow is the first tranche of applications for our financial assistance programme. - Tickets are selling steadily, so make sure you don't miss out. Tickets for the whole conference start at ?96. - The children's day returns. Bring your children on the Saturday for a fun-packed day of activities and workshops, to learn all about getting the most out of the world with Python. - Do you know any teachers who might be interested in learning more about Python? We're running conference-within-a-conference for teachers , and we're offering bursaries to cover the cost of supply cover. You'll find more details about the whole conference on our website . If you've got any questions, please get in touch with the committee via pyconuk-enquiries at python.org. All the best, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From tibs at tibsnjoan.co.uk Mon Jun 27 14:10:01 2016 From: tibs at tibsnjoan.co.uk (Tibs) Date: Mon, 27 Jun 2016 19:10:01 +0100 Subject: [python-uk] Next CamPUG meeting: Tue 5th July 2016 Message-ID: <81569FF2-E2EF-4C5E-83E8-29A7D5F4A93E@tibsnjoan.co.uk> The next Cambridge Python User Group meeting will be on Tuesday 5th July at 7pm, at the Raspberry Pi Foundation offices, 30 Station Road, Cambridge. Damien George will talk about MicroPython, some details of how it works / why it's different to normal Python, and also how it can be used for the Internet of Things (with maybe some demos!) Please note that we are now on meetup.com, at http://www.meetup.com/CamPUG/. If possible, please RSVP there for meetings so we have an idea of numbers. As an incentive, there's normally more detail about each meeting there, and you can also find out about future meetings. Tweeting may occur at https://twitter.com/campython Tibs From thomas at kluyver.me.uk Mon Jun 27 14:36:30 2016 From: thomas at kluyver.me.uk (Thomas Kluyver) Date: Mon, 27 Jun 2016 19:36:30 +0100 Subject: [python-uk] Next CamPUG meeting: Tue 5th July 2016 In-Reply-To: <81569FF2-E2EF-4C5E-83E8-29A7D5F4A93E@tibsnjoan.co.uk> References: <81569FF2-E2EF-4C5E-83E8-29A7D5F4A93E@tibsnjoan.co.uk> Message-ID: <1467052590.3444134.649972313.44ADAEE4@webmail.messagingengine.com> Coincidentally, the next Southampton PUG meeting will *also* be on the 5th of July, but at 6pm, in the Murray Building at Southampton Uni, room 1023. Robin Wilson will talk about his experience of writing Python code to process millions of data records from mobile phone calls after the Nepal earthquake. We're also hoping to get a lightning talk about Micropython on the BBC micro:bit (another coincidence :-). And we'll be going to a pub afterwards. All details about the group and its meetings are here: http://southampton-python.github.io/ Thanks, Thomas On Mon, Jun 27, 2016, at 07:10 PM, Tibs wrote: > The next Cambridge Python User Group meeting will be on Tuesday 5th July > at 7pm, at the Raspberry Pi Foundation offices, 30 Station Road, > Cambridge. > > Damien George will talk about MicroPython, some details of how it works / > why it's different to normal Python, and also how it can be used for the > Internet of Things (with maybe some demos!) > > Please note that we are now on meetup.com, at > http://www.meetup.com/CamPUG/. If possible, please RSVP there for > meetings so we have an idea of numbers. As an incentive, there's normally > more detail about each meeting there, and you can also find out about > future meetings. > > Tweeting may occur at https://twitter.com/campython > > Tibs > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk From jrs.idx at ntlworld.com Tue Jun 28 07:47:23 2016 From: jrs.idx at ntlworld.com (John Sampson) Date: Tue, 28 Jun 2016 12:47:23 +0100 Subject: [python-uk] Windows Clipboard Module Message-ID: <61d20518-46b0-090d-3562-1c399575c8e1@ntlworld.com> I am using win32clipboard module with Python 2.7 in Windows 7. I have code which uses GetClipboardData() and SetClipboardText(argument). Before running the code I copy text into the Windows clipboard from a proprietary program. I know that this program adds garbage to the end of the string, namely null-value bytes and possibly other invisible stuff. When I paste the contents of the Windows clipboard into a Tkinter text box I get the string obtained by GetClipboardData() although I have since run SetClipboardText(argument). If I paste the contents of the Windows clipboard at this stage into the Boxer text editor I get the string placed by SetClipboardText(argument). If I paste into the Tkinter program again, or into Vim or into Microsoft Word, I get the string obtained using GetClipboardData(). I can repeat this as many times as I like - one string into Boxer, the other string into the other programs. I deduce that both strings must be in the clipboard at the same time, but it depends which program has focus which string is pasted in using Control v. Is there a way of showing the contents of the clipboard, garbage and all? I would like to find a way of making the Windows clipboard behave as it is supposed to - new contents overwriting the old. Regards John Sampson From petef4+usenet at gmail.com Tue Jun 28 13:45:38 2016 From: petef4+usenet at gmail.com (Pete Forman) Date: Tue, 28 Jun 2016 18:45:38 +0100 Subject: [python-uk] Windows Clipboard Module References: <61d20518-46b0-090d-3562-1c399575c8e1@ntlworld.com> Message-ID: John Sampson writes: > I am using win32clipboard module with Python 2.7 in Windows 7. I have > code which uses GetClipboardData() and SetClipboardText(argument). > Before running the code I copy text into the Windows clipboard from a > proprietary program. I know that this program adds garbage to the end > of the string, namely null-value bytes and possibly other invisible > stuff. > > When I paste the contents of the Windows clipboard into a Tkinter text > box I get the string obtained by GetClipboardData() although I have > since run SetClipboardText(argument). > > If I paste the contents of the Windows clipboard at this stage into > the Boxer text editor I get the string placed by > SetClipboardText(argument). If I paste into the Tkinter program again, > or into Vim or into Microsoft Word, I get the string obtained using > GetClipboardData(). I can repeat this as many times as I like - one > string into Boxer, the other string into the other programs. > > I deduce that both strings must be in the clipboard at the same time, > but it depends which program has focus which string is pasted in using > Control v. > > Is there a way of showing the contents of the clipboard, garbage and > all? I would like to find a way of making the Windows clipboard behave > as it is supposed to - new contents overwriting the old. I don't have access to a Windows PC at the moment but here are a couple of scripts I wrote 9 years ago to play with the clipboard. Bear in mind that the clipboard is not just text. It is written to in a number of formats and is designed that the reader pull off the best, whatever that might be. There are a number of clipboard viewer or manager applications available on Windows. Something to watch out for is that clipboard behaviour may be affected by adding viewers. === clipboardViewer.py: import win32clipboard def getClipboardViewer(): return win32clipboard.GetClipboardViewer() if __name__ == '__main__': print getClipboardViewer() === clipboard.py: import collections import win32clipboard import pywintypes class defaultdict1(collections.defaultdict): # defaultdict is new in Python 2.5 def __missing__(self, key): value = self.default_factory(key) self[key] = value return value def getClipboardFormatName(format): try: # succeeds for registered formats return win32clipboard.GetClipboardFormatName(format) except pywintypes.error: return 'Unregistered format: %d' % format formatName = defaultdict1(getClipboardFormatName) for s in dir(win32clipboard): if s.startswith('CF_'): formatName[getattr(win32clipboard, s)] = s formatName[17] = 'CF_DIBV5' # since Windows 2000, not in pywin32-210 def getAvailableFormats(): """Return a list of format numbers available on the clipboard.""" formats = [] try: win32clipboard.OpenClipboard(0) cf = win32clipboard.EnumClipboardFormats(0) while (cf != 0): formats.append(cf) cf = win32clipboard.EnumClipboardFormats(cf) finally: win32clipboard.CloseClipboard() return formats if __name__ == '__main__': for f in sorted(getAvailableFormats()): # sorted is new in Python 2.4 print '0x%04x %s' % (f, formatName[f]) -- Pete Forman https://payg-petef.rhcloud.com (formerly on http://petef.22web.org/payg.html) From jrs.idx at ntlworld.com Wed Jun 29 04:52:39 2016 From: jrs.idx at ntlworld.com (John Sampson) Date: Wed, 29 Jun 2016 09:52:39 +0100 Subject: [python-uk] Windows Clipboard Module In-Reply-To: References: <61d20518-46b0-090d-3562-1c399575c8e1@ntlworld.com> Message-ID: <85075764-552c-fd9b-474f-86edb9a1c837@ntlworld.com> On 28/06/2016 18:45, Pete Forman wrote: > John Sampson writes: > >> I am using win32clipboard module with Python 2.7 in Windows 7. I have >> code which uses GetClipboardData() and SetClipboardText(argument). >> Before running the code I copy text into the Windows clipboard from a >> proprietary program. I know that this program adds garbage to the end >> of the string, namely null-value bytes and possibly other invisible >> stuff. >> >> When I paste the contents of the Windows clipboard into a Tkinter text >> box I get the string obtained by GetClipboardData() although I have >> since run SetClipboardText(argument). >> >> If I paste the contents of the Windows clipboard at this stage into >> the Boxer text editor I get the string placed by >> SetClipboardText(argument). If I paste into the Tkinter program again, >> or into Vim or into Microsoft Word, I get the string obtained using >> GetClipboardData(). I can repeat this as many times as I like - one >> string into Boxer, the other string into the other programs. >> >> I deduce that both strings must be in the clipboard at the same time, >> but it depends which program has focus which string is pasted in using >> Control v. >> >> Is there a way of showing the contents of the clipboard, garbage and >> all? I would like to find a way of making the Windows clipboard behave >> as it is supposed to - new contents overwriting the old. > I don't have access to a Windows PC at the moment but here are a couple > of scripts I wrote 9 years ago to play with the clipboard. > > Bear in mind that the clipboard is not just text. It is written to in a > number of formats and is designed that the reader pull off the best, > whatever that might be. > > There are a number of clipboard viewer or manager applications available > on Windows. Something to watch out for is that clipboard behaviour may > be affected by adding viewers. > [clip] Many thanks. What has fixed it for a newbie like me was to empty the clipboard explicitly with EmptyClipboard() before running SetClipboardText(argument). I did not appreciate that programs draw off their selection from the clipboard when pasting. From ford99 at ntlworld.com Fri Jun 24 13:49:41 2016 From: ford99 at ntlworld.com (ford99 at ntlworld.com) Date: Fri, 24 Jun 2016 20:49:41 +0300 Subject: [python-uk] so strange but interesting Message-ID: <00007d120c9c$d18a2d62$3e7cbd4d$@ntlworld.com> Hi, I know it might be something strange, but still so interesting, you have to see it here Bests, ford99 at ntlworld.com -------------- next part -------------- An HTML attachment was scrubbed... URL: