Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Formatting float number output
Post: RE: Formatting float number output

(May-04-2023, 01:54 PM)Gribouillis Wrote: (May-04-2023, 01:39 PM)barryjo Wrote: I would rather not have to use..print('{:010.4f}'.format(x)) for each print statement.This doesn't output the float ...
barryjo General Coding Help 2 914 May-04-2023, 02:04 PM
    Thread: Formatting float number output
Post: Formatting float number output

Is there a way to globally set the output of printed floats to 2 decimal places? I would rather not have to use..print('{:010.4f}'.format(x)) for each print statement.
barryjo General Coding Help 2 914 May-04-2023, 01:39 PM
    Thread: How do I use a whl puython distribution?
Post: RE: How do I use a whl puython distribution?

I found the files where you say. If I run the following example below I would get an output in x,y,z format. How would I know the units and orientation of the coordinates? It would be nice if there w...
barryjo General Coding Help 6 1,786 Aug-15-2022, 03:00 AM
    Thread: How do I use a whl puython distribution?
Post: RE: How do I use a whl puython distribution?

I am a bit confused. I installed ...whl and executed and received the following.. ******************************************************************* C:\PythonFiles>pip install orbit_predictor-1....
barryjo General Coding Help 6 1,786 Aug-15-2022, 01:19 AM
    Thread: How do I use a whl puython distribution?
Post: How do I use a whl puython distribution?

I just downloaded an orbit prediction package called orbit_predictor-1.15.0.py3-none-any.whl. How do I go about converting this file into python files? also, when I unpack this distribution, I am sur...
barryjo General Coding Help 6 1,786 Aug-14-2022, 09:45 PM
    Thread: home automation using python
Post: home automation using python

I would like to be able to control my home automation switches, lights, and etc using python. Essentially, I want to do what Alexa and Google home does. Is/are there python libraries to do this? I w...
barryjo General Coding Help 1 1,193 Jul-24-2022, 03:42 PM
    Thread: confused about string formatting
Post: RE: confused about string formatting

So the 05 means a total of 5 spaces (including the decimal) and the.2 means 2 places to the right of the decimal. Got it.
barryjo General Coding Help 7 1,987 Mar-05-2022, 10:48 PM
    Thread: confused about string formatting
Post: RE: confused about string formatting

This is good info. But, if I had a number like 1.12345 How would I format it to read 01.12 ?
barryjo General Coding Help 7 1,987 Mar-05-2022, 10:33 PM
    Thread: confused about string formatting
Post: RE: confused about string formatting

What you say works. Thanks
barryjo General Coding Help 7 1,987 Mar-05-2022, 10:12 PM
    Thread: confused about string formatting
Post: confused about string formatting

I am confused about string formatting. If I have a number 14.20003 I want to make it into a string s = 14.20 Do I use the "f" format or the "%" format? what is the best way for the above example.
barryjo General Coding Help 7 1,987 Mar-05-2022, 09:45 PM
    Thread: satellite tracking module
Post: satellite tracking module

Does anyone know of a python satellite tracking module that inputs the two line orbit elements and then outputs the az/el as a function of time?
barryjo General Coding Help 1 1,407 Feb-28-2022, 09:11 PM
    Thread: a general question
Post: RE: a general question

Dean, I understand what you are saying. Gribou, could I also do this... ser = serial.serial('COM3', '9600') def SendCommandV1(ser, command_string): ser.write(command_string) def SendCommandV2(...
barryjo General Coding Help 5 1,502 Feb-01-2022, 09:05 PM
    Thread: a general question
Post: a general question

I have the following code, the first method, SendCommandV1, was given to me. My question is do I have to pass ser as an argument when I call SendCommand? Since ser is defined globally, I do not see a...
barryjo General Coding Help 5 1,502 Feb-01-2022, 06:04 PM
    Thread: use of format function
Post: use of format function

In the following code, s is returned as an integer The output is 1 How do I convert the integer s into a string with two decimal places. i.e. I would like to print the month as 01 not 1 I assume I nee...
barryjo General Coding Help 3 1,670 Jan-31-2022, 10:09 PM
    Thread: how to change font size
Post: RE: how to change font size

This helps but what does the 40 mean" does it mean size 40 for a default font? If I change 40 to 20 nothing happens. ??? However, I Find I can change the font merely by naming the font and size as be...
barryjo GUI 4 3,886 Jan-26-2022, 07:16 PM
    Thread: confusion using the import statement
Post: RE: confusion using the import statement

I get it I thnk
barryjo GUI 4 1,544 Jan-26-2022, 07:10 PM
    Thread: confusion using the import statement
Post: RE: confusion using the import statement

I need more clarification. Does line 1 and 3 import all of the tinker module? Or, is line 1 and 3 the same thing? By using the as word does this mean that I can reference tkinter.font or tk.font as ...
barryjo GUI 4 1,544 Jan-26-2022, 05:40 PM
    Thread: confusion using the import statement
Post: confusion using the import statement

What is the differences between the following statements? 1) import tkinter 2) import tkinter as tk 3) from tkinter import * 4) from tkinter import font as tkFont
barryjo GUI 4 1,544 Jan-26-2022, 05:19 PM
    Thread: how to change font size
Post: how to change font size

I have a button defined below. What does 40 mean? Is there a 40 font? How do I change the font size. i.e. maker it larger or smaller? buttonGetAzEl=tk.Button(frame, text="GetAzEl", font = 40, comman...
barryjo GUI 4 3,886 Jan-26-2022, 05:08 PM
    Thread: main lop in python tkinter
Post: RE: main lop in python tkinter

I don't understand how this works but it does. In the above, it seems like the function is calling itself?? Maybe some day I will understand Thanks, now my real code works
barryjo GUI 6 5,396 Jan-24-2022, 01:25 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020