diff --git a/klippy/console.py b/klippy/console.py index 0a20e09e3..c0205b491 100755 --- a/klippy/console.py +++ b/klippy/console.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Script to implement a test console with firmware over serial port # # Copyright (C) 2016-2021 Kevin O'Connor diff --git a/klippy/klippy.py b/klippy/klippy.py index 5f0ea4633..69e46556a 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Main code for host side printer firmware # # Copyright (C) 2016-2024 Kevin O'Connor diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index b35873840..59b3c5de7 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Script to handle build time requests embedded in C code. # # Copyright (C) 2016-2024 Kevin O'Connor diff --git a/scripts/canbus_query.py b/scripts/canbus_query.py index 52dd4706e..e6eeb5f53 100644 --- a/scripts/canbus_query.py +++ b/scripts/canbus_query.py @@ -1,10 +1,10 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Tool to query CAN bus uuids # # Copyright (C) 2021 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import sys, os, optparse, time +import sys, optparse, time import can CANBUS_ID_ADMIN = 0x3f0 diff --git a/scripts/checkstack.py b/scripts/checkstack.py index 1a6605fe5..709d2ae8d 100755 --- a/scripts/checkstack.py +++ b/scripts/checkstack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Script that tries to find how much stack space each function in an # object is using. # diff --git a/scripts/graph_temp_sensor.py b/scripts/graph_temp_sensor.py index c1d185260..45fdfe140 100755 --- a/scripts/graph_temp_sensor.py +++ b/scripts/graph_temp_sensor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Tool to graph temperature sensor ADC resolution # # Copyright (C) 2020 Kevin O'Connor diff --git a/scripts/make_version.py b/scripts/make_version.py index e64ef7d6c..671b0f7da 100644 --- a/scripts/make_version.py +++ b/scripts/make_version.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Get the version number for klippy # # Copyright (C) 2018 Lucas Fink diff --git a/scripts/parsecandump.py b/scripts/parsecandump.py index d575dc5af..666fc9dd1 100755 --- a/scripts/parsecandump.py +++ b/scripts/parsecandump.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # Check for out of order timestamps in the output of candump # # Copyright (C) 2023 Kevin O'Connor diff --git a/scripts/spi_flash/spi_flash.py b/scripts/spi_flash/spi_flash.py index e9394dbe5..9dff07800 100644 --- a/scripts/spi_flash/spi_flash.py +++ b/scripts/spi_flash/spi_flash.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Module supporting uploads Klipper firmware to an SD Card via SPI and SDIO # # Copyright (C) 2021 Eric Callahan diff --git a/scripts/stepstats.py b/scripts/stepstats.py index 4292a5258..a8c7d3b54 100755 --- a/scripts/stepstats.py +++ b/scripts/stepstats.py @@ -1,9 +1,10 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Script to calculate stats for each stepper from a log of messages # # Copyright (C) 2016 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. +from __future__ import print_function import optparse def main(): @@ -33,8 +34,8 @@ def main(): so[2] += 1 so[{'0': 3, '1': 4}[so[1]]] += int(args['count']) for oid, so in sorted([(int(i[0]), i[1]) for i in steppers.items()]): - print "oid:%3d dir_cmds:%6d queue_cmds:%7d (%8d -%8d = %8d)" % ( - oid, so[0], so[2], so[4], so[3], so[4]-so[3]) + print("oid:%3d dir_cmds:%6d queue_cmds:%7d (%8d -%8d = %8d)" % ( + oid, so[0], so[2], so[4], so[3], so[4]-so[3])) if __name__ == '__main__': main() diff --git a/scripts/whconsole.py b/scripts/whconsole.py index 5e76b3bce..20f58fa40 100755 --- a/scripts/whconsole.py +++ b/scripts/whconsole.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Test console for webhooks interface # # Copyright (C) 2020 Kevin O'Connor