Re: Python in Blender. Writing information to a file.

2019-08-08 Thread Cameron Simpson
On 08Aug2019 22:42, Paul St George wrote: On 08/08/2019 10:18, Peter Otten wrote: The print() function has a keyword-only file argument. So: with open(..., "w") as outstream: print("Focal length:", bpy.context.object.data.lens, file=outstream) [...] That worked perfectly. outstream = o

Re: How do i execute some code when I have subscribed to a topic with a message payload for mqtt in python?

2019-08-08 Thread Spencer Du via Python-list
On Thursday, 8 August 2019 22:48:11 UTC+2, Spencer Du wrote: > Ok so here is some code below. How do I write an if code block to execute > some commands when I subscribe to the topic: > microscope/light_sheet_microscope/UI and which has a message which is a > device type published to it. I want

How do i execute some code when I have subscribed to a topic with a message payload for mqtt in python?

2019-08-08 Thread Spencer Du via Python-list
Ok so here is some code below. How do I write an if code block to execute some commands when I subscribe to the topic: microscope/light_sheet_microscope/UI and which has a message which is a device type published to it. I want to execute some code to check if the device has a python file in the

Re: Re: Python in Blender. Writing information to a file.

2019-08-08 Thread Paul St George
On 08/08/2019 10:18, Peter Otten wrote: Paul St George wrote: I am using Python 3.5 within Blender. I want to collect values of the current settings and then write all the results to a file. I can see the settings and the values in the Python console by doing this for each of the settings | |

Re: Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
On Fri, 9 Aug 2019, Chris Angelico wrote: There's one other potential trap you MAY fall into, but only if you have multiple Python 3s installed (eg 3.7, 3.8, and 3.9). ChrisA, Not likely. I'm the only one using these hosts and I keep only a single, current, version of software. So to be abs

Re: Installing python3 packages using pip

2019-08-08 Thread Chris Angelico
On Fri, Aug 9, 2019 at 5:01 AM Rich Shepard wrote: > > On Fri, 9 Aug 2019, Chris Angelico wrote: > > > Once you're using pip3, you don't need to specify the 3 anywhere else. It > > should just be "pip3 install numpy". The pip download resolver will make > > sure that it gets a version that's appro

Re: Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
On Thu, 8 Aug 2019, MRAB wrote: What's numpy3? Is it different from numpy? I run Slackware and the SlackBuilds.org packages distinguish buiding between python2 and python3. I've used those build scripts for years but they've failed me on this new desktop and one laptop so I used pip3 instead.

Re: Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
On Fri, 9 Aug 2019, Chris Angelico wrote: Once you're using pip3, you don't need to specify the 3 anywhere else. It should just be "pip3 install numpy". The pip download resolver will make sure that it gets a version that's appropriate to your Python (including architecture/word size, version (x

Re: Installing python3 packages using pip

2019-08-08 Thread MRAB
On 2019-08-08 19:01, Rich Shepard wrote: On Thu, 8 Aug 2019, Richard Moseley wrote: You will need to have to install python3-pip (or equivalent on your repository) to install the version of pip suitable for use with python 3.x. The program is usually installed as 'pip3' so substitute 'pip' for

Re: Installing python3 packages using pip

2019-08-08 Thread Chris Angelico
On Fri, Aug 9, 2019 at 4:02 AM Rich Shepard wrote: > > On Thu, 8 Aug 2019, Richard Moseley wrote: > > > You will need to have to install python3-pip (or equivalent on your > > repository) to install the version of pip suitable for use with python 3.x. > > The program is usually installed as 'pip3'

Re: Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
On Thu, 8 Aug 2019, Richard Moseley wrote: You will need to have to install python3-pip (or equivalent on your repository) to install the version of pip suitable for use with python 3.x. The program is usually installed as 'pip3' so substitute 'pip' for 'pip3' to install or upgrade Pypy packages

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 1:33 PM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > >> Pyke has been ported to py3. Here is the code that returns the data I > >> am trying to process: > >> > >> return map(self.doctor_answer, it) > >> > >> I don't see anything calling imap. > > > > I g

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Peter Otten
Larry Martell wrote: >> Pyke has been ported to py3. Here is the code that returns the data I >> am trying to process: >> >> return map(self.doctor_answer, it) >> >> I don't see anything calling imap. > > I grepped through the entire pyke code and imap is not in there. Fire up the python3 interp

Re: Python help needed

2019-08-08 Thread Dan Sommers
On 8/8/19 12:26 PM, Paolo G. Cantore wrote: > I think the special case treatment could be avoided. > > First: Join all items with ' and ' > Second: Replace all ' and ' with ', ' except the last That works great, until one of the elements of the original list is "spam and eggs": >>> spam = [

Re: Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
On Thu, 8 Aug 2019, Richard Moseley wrote: You will need to have to install python3-pip Richard, Aha! I thought it was just pip3. Hope this helps, Richard Moseley. Yes, it does. Many thanks, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:34 PM Rhodri James wrote: > > On 08/08/2019 17:16, Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > >> > >> Larry Martell wrote: > [snip] > >>> But in py3 that fails with: AttributeError: module 'itertools' has no > >>> attr

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Rhodri James
On 08/08/2019 17:16, Larry Martell wrote: On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: Larry Martell wrote: [snip] But in py3 that fails with: AttributeError: module 'itertools' has no attribute 'imap' In Python 3 the map() builtin is "lazy", so you can use that ins

Re: Python help needed

2019-08-08 Thread Paolo G. Cantore
Am 08.08.19 um 01:18 schrieb MRAB: On 2019-08-07 21:36, Kuyateh Yankz wrote: #trying to write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space, with and inserted before the last item. For example, passing the previous sp

Re: Installing python3 packages using pip

2019-08-08 Thread Richard Moseley
You will need to have to install python3-pip (or equivalent on your repository) to install the version of pip suitable for use with python 3.x. The program is usually installed as 'pip3' so substitute 'pip' for 'pip3' to install or upgrade Pypy packages. Of course, if possible always create a new '

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:16 PM Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > > > Larry Martell wrote: > > > > > I have some code that is using the pyke package > > > (https://sourceforge.net/projects/pyke/). That project seems fairly > > > dead

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > > I have some code that is using the pyke package > > (https://sourceforge.net/projects/pyke/). That project seems fairly > > dead, so asking here. > > > > There is a pyke function that returns a cont

Installing python3 packages using pip

2019-08-08 Thread Rich Shepard
The host has Python3-3.7.4 installed. Trying to use "pip install numpy3" fails: # pip install numpy3 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop suppo

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread MRAB
On 2019-08-08 15:29, Larry Martell wrote: I have some code that is using the pyke package (https://sourceforge.net/projects/pyke/). That project seems fairly dead, so asking here. There is a pyke function that returns a context manager with an iterable map. In py2.7 I did this: from pyke import

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Peter Otten
Larry Martell wrote: > I have some code that is using the pyke package > (https://sourceforge.net/projects/pyke/). That project seems fairly > dead, so asking here. > > There is a pyke function that returns a context manager with an > iterable map. In py2.7 I did this: > > from pyke import knowl

SCons 3.1.1 Released

2019-08-08 Thread Bill Deegan
SCons - a software construction tool What is SCons? SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/au

AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
I have some code that is using the pyke package (https://sourceforge.net/projects/pyke/). That project seems fairly dead, so asking here. There is a pyke function that returns a context manager with an iterable map. In py2.7 I did this: from pyke import knowledge_engine vasculopathy_engine = know

Re: Python in Blender. Writing information to a file.

2019-08-08 Thread Peter Otten
Paul St George wrote: > I am using Python 3.5 within Blender. I want to collect values of the > current settings and then write all the results to a file. > > I can see the settings and the values in the Python console by doing > this for each of the settings > | > | > > |print(“Focal length:”,b

Python in Blender. Writing information to a file.

2019-08-08 Thread Paul St George
I am using Python 3.5 within Blender. I want to collect values of the current settings and then write all the results to a file. I can see the settings and the values in the Python console by doing this for each of the settings | | |print(“Focal length:”,bpy.context.object.data.lens)| ---Foc

10 Reasons Why You Should Keep Learning Game Development

2019-08-08 Thread angel . thomas1717
If you ask any software developer, there’s a decent chance that they have tried their hand at game development. It seems like a natural fit since it uses many of the same skills. What’s more, programmers come into it with the knowledge that most aspiring game makers lack: how to write good code