Re: help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
so when I write from tkinter import* t=Tk() tkinter.colorchooser.askcolor() I get this error message Traceback (most recent call last): File "C:\Users\kabba\Desktop\color and coordinates.py", line 3, in tkinter.colorchooser.askcolor() NameError: name 'tkinter' is not defined I also tried ano

Re:help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
I one more thing I am using python 3 Sent from my Huawei Mobile Original Message Subject: Re: help with tkinter From: Ahmad Adam Kabbara To: Wildman CC: python-list@python.org so when I write**from tkinter import* t=Tk() tkinter.colorc

Re: help with tkinter

2019-08-09 Thread Peter J. Holzer
On 2019-08-09 10:34:34 +0300, Ahmad Adam Kabbara wrote: > so when I write from > tkinter import* > t=Tk() > tkinter.colorchooser.askcolor() > I get this error message > Traceback (most recent call last): > File "C:\Users\kabba\Desktop\color and coordinates.py", line 3, in > > tkinter.colorch

Help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
I am having trouble with tkinter can you please help help with tkinter Inbox A adam kabbara to python-list@python.org 8 days ago Details Hello I am having trouble with tkinter when I enter the command from tkinter import* I get an error message Sent from Mail

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

2019-08-09 Thread Paul St George
On 09/08/2019 04:09, Cameron Simpson wrote: 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)

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

2019-08-09 Thread Rhodri James
On 09/08/2019 14:54, Paul St George wrote: On 09/08/2019 04:09, Cameron Simpson wrote: 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

String slices

2019-08-09 Thread Paul St George
In the code (below) I want a new line like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 But not like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 Is it possible? (I am using Python 3.5 within Blender.) # import os outstream = open(os.path

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

2019-08-09 Thread Rhodri James
On 08/08/2019 21:47, Spencer Du via Python-list 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 to execute some

Re: String slices

2019-08-09 Thread Dan Sommers
On 8/9/19 10:13 AM, Paul St George wrote: In the code (below) I want a new line like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 But not like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 Is it possible? (I am using Python 3.5 within Blend

Re: String slices

2019-08-09 Thread Rhodri James
On 09/08/2019 15:13, Paul St George wrote: In the code (below) I want a new line like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 But not like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 Is it possible? (I am using Python 3.5 within Blen

Re: String slices

2019-08-09 Thread Peter Otten
Paul St George wrote: > In the code (below) I want a new line like this: > > Plane rotation X: 0.0 > Plane rotation Y: 0.0 > Plane rotation Z: 0.0 > > But not like this: > > Plane rotation X: > 0.0 > Plane rotation Y: > 0.0 > Plane rotation Z: > 0.0 > > Is it possible? > print( > > "Plane ro

py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
I have some python 2 code: def decode(key, string): decoded_chars = [] string = base64.urlsafe_b64decode(string) for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(abs(ord(string[i]) - ord(key_c) % 256)) decoded_chars.append

Re: py2 to 3 base64 issues

2019-08-09 Thread Chris Angelico
On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > I have some python 2 code: > > def decode(key, string): >decoded_chars = [] >string = base64.urlsafe_b64decode(string) >for i in range(len(string)): >key_c = key[i % len(key)] >encoded_c = chr(

Re: py2 to 3 base64 issues

2019-08-09 Thread MRAB
On 2019-08-09 17:06, Larry Martell wrote: I have some python 2 code: def decode(key, string): decoded_chars = [] string = base64.urlsafe_b64decode(string) for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(abs(ord(string[i]) - o

Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > > On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > > > I have some python 2 code: > > > > def decode(key, string): > >decoded_chars = [] > >string = base64.urlsafe_b64decode(string) > >for i in range(len(strin

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

2019-08-09 Thread Paul St George
On 09/08/2019 15:59, Rhodri James wrote: On 09/08/2019 14:54, Paul St George wrote: On 09/08/2019 04:09, Cameron Simpson wrote: 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") a

Re: help with tkinter

2019-08-09 Thread Michael Torrie
On 8/9/19 4:52 AM, Peter J. Holzer wrote: > On 2019-08-09 10:34:34 +0300, Ahmad Adam Kabbara wrote: >> so when I write from >> tkinter import* >> t=Tk() >> tkinter.colorchooser.askcolor() >> I get this error message >> Traceback (most recent call last): >> File "C:\Users\kabba\Desktop\color and c

Re: help with tkinter

2019-08-09 Thread Peter J. Holzer
On 2019-08-09 12:43:45 -0600, Michael Torrie wrote: > On 8/9/19 4:52 AM, Peter J. Holzer wrote: > > You didn't import 'tkinter', you imported all symbols ('*') from > > tkinter. So, since you imported colorchooser, you can call > > colorchooser.askcolor() (not tkinter.colorchooser.askcolor()) > >

Re: py2 to 3 base64 issues

2019-08-09 Thread MRAB
On 2019-08-09 19:21, Larry Martell wrote: On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > I have some python 2 code: > > def decode(key, string): >decoded_chars = [] >string = base64.urlsafe_b64decode(string) >

Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 3:17 PM MRAB wrote: > > On 2019-08-09 19:21, Larry Martell wrote: > > On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > >> > >> On Sat, Aug 10, 2019 at 2:09 AM Larry Martell > >> wrote: > >> > > >> > I have some python 2 code: > >> > > >> > def decode(key, string):

Re: Re: String slices

2019-08-09 Thread Paul St George
On 09/08/2019 16:29, Rhodri James wrote: On 09/08/2019 15:13, Paul St George wrote: In the code (below) I want a new line like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 But not like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 Is it p

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

2019-08-09 Thread Cameron Simpson
On 09Aug2019 20:53, Paul St George wrote: I almost understand. Are you saying I should change the first line of code to something like: |outstream = with open(path to my file,'w') # this is invalid syntax| and then delete the outstream.close() No, you should do what Peter wrote: with open

Re: String slices

2019-08-09 Thread Cameron Simpson
On 09Aug2019 22:28, Paul St George wrote: On 09/08/2019 16:29, Rhodri James wrote: The 'sep="\n"' parameter to print() means "put a newline between each item."  So don't do that.  Put the newlines you do want in explicitly, or use separate calls to print(): (I'm abbreviating because I really