Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Returning to coding after >1 year
Post: RE: Returning to coding after >1 year

I've always had a preference for mind mapping, based on the Tony Buzan approach, and whilst I've made heavy use of the more sophisticated tools, such as Mind Manager, over the years (not least to read...
gruntfutuk News and Discussions 8 1,926 Jun-13-2022, 11:24 AM
    Thread: rename and add desire "_date" to end of file name before extention
Post: RE: rename and add desire "_date" to end of file ...

So where exactly are you stuck? You might want to explore using pathlib to handle the path/folder/filenames. Good article on this lib on RealPython.com. They also cover how to rename files.
gruntfutuk General Coding Help 1 1,237 Jun-13-2022, 11:16 AM
    Thread: Input function
Post: RE: Input function

The function you shared (without formatting) is incomplete. def mytriangle (base, height): print ("The base is ", base) print ("The height is ", height) base (10) height (15) myar...
gruntfutuk Homework 11 5,934 Jan-09-2021, 11:36 AM
    Thread: installing openpyxl
Post: RE: installing openpyxl

You have a choice of any package being installed in the default directory, or creating a Python virtual environment using the venv command. The latter option is generally preferred to avoid polluting ...
gruntfutuk General Coding Help 2 11,746 Jan-28-2020, 01:24 PM
    Thread: f-string-ify
Post: RE: f-string-ify

(Jan-25-2020, 07:28 PM)Skaperen Wrote: my requirement is very simple. i need to just do what an f-string does, but getting the contents between the quotes from somewhere else besides the source cod...
gruntfutuk News and Discussions 10 4,826 Jan-26-2020, 10:54 AM
    Thread: f-string-ify
Post: RE: f-string-ify

Yes, but just to illustrate. I am sure you recognise the foo and bar references in the template definition are not related to the foo and bar used later. The substitution could have been in-situ and l...
gruntfutuk News and Discussions 10 4,826 Jan-25-2020, 12:03 PM
    Thread: f-string-ify
Post: RE: f-string-ify

Look again.
gruntfutuk News and Discussions 10 4,826 Jan-24-2020, 06:08 PM
    Thread: f-string-ify
Post: RE: f-string-ify

Not tried it, but I wonder if you could use string Template, from string import Template to handle the patterns. Just tried a crude example, apologies if missing the plot here: from string import Te...
gruntfutuk News and Discussions 10 4,826 Jan-22-2020, 05:44 PM
    Thread: App for excel sheet analysis
Post: RE: App for excel sheet analysis

(Jan-20-2020, 04:27 PM)Larz60+ Wrote: You can certainly use openpyxl, but if you are willing to spend a bit of time learning, I would suggest that Pandas is the way to go. Package overview: https://...
gruntfutuk Homework 6 2,774 Jan-20-2020, 06:33 PM
    Thread: Rename file from value in text file
Post: RE: Rename file from value in text file

So where exactly are you stuck? Use pathlib to handle the filenames, loop through the list of employee names and for each name, rename the file to the corresponding new filename. Use try/except block...
gruntfutuk General Coding Help 1 2,172 Jan-20-2020, 03:50 PM
    Thread: f-string-ify
Post: RE: f-string-ify

Care to share an example of the code?
gruntfutuk News and Discussions 10 4,826 Jan-20-2020, 03:45 PM
    Thread: App for excel sheet analysis
Post: RE: App for excel sheet analysis

Look at examples for using the openpyxl library. Here's some code showing a simple example I shared on the learnpython subreddit a little while back. import openpyxl from openpyxl import Workbook fro...
gruntfutuk Homework 6 2,774 Jan-20-2020, 03:29 PM
    Thread: Phone app from python code
Post: RE: Phone app from python code

Take a look at kivy if you want something that looks like a native app. Also, consider turning your work into a webapp.
gruntfutuk General Coding Help 1 2,228 Mar-29-2019, 05:16 PM
    Thread: Testing an API
Post: RE: Testing an API

You are going to have to help us to help you, like sharing some code maybe.
gruntfutuk General Coding Help 1 1,788 Mar-29-2019, 05:10 PM
    Thread: Python only outputting "101"
Post: RE: Python only outputting "101"

Your code is fine, so something must be wrong with your environment. Are you using an IDE like PyCharm? Are you sure you are executing the correct code (run does not necessarily execute the code you ...
gruntfutuk General Coding Help 4 9,248 Jan-08-2019, 08:05 PM
    Thread: beginning python help request (for loop)
Post: RE: beginning python help request (for loop)

In Python, variable names point to objects somewhere in memory. Objects are things like integers, strings, lists, and so on. So, result = 1 means result refers to the object somewhere in memory that i...
gruntfutuk Homework 3 2,706 Oct-26-2018, 07:20 PM
    Thread: convert words to nums and vica versa
Post: RE: convert words to nums and vica versa

Don't try to write Python. Not at first. Instead, work out how you would do this yourself if you had to do it in very very basic steps where you can only do one thing at a time, and have very poor me...
gruntfutuk Homework 5 2,934 Oct-26-2018, 07:05 PM
    Thread: Print The Length Of The Longest Run in a User Input List
Post: RE: Print The Length Of The Longest Run in a User ...

It would be better if you posted your code on this forum rather than in a link. I have looked at your code. Please rewrite and use meaningful variable names. It is very hard to follow your intentions...
gruntfutuk Homework 3 3,178 Oct-26-2018, 06:56 PM
    Thread: Login and register code
Post: RE: Login and register code

Firstly, here's your definition of ref with a minor correct to the text your write to file (you mistyped Password): def reg(): uname = input("Please enter a username: ") pword = input("Please...
gruntfutuk Homework 1 2,450 Oct-13-2018, 07:48 PM
    Thread: .remove() method in for-loop
Post: RE: .remove() method in for-loop

You can avoid a lot of problems when removing items from a list if you traverse it in reverse: sw = ['bo', 'go', 'bo', 'do', 'bo', 'we', 'bo', 'bo'] for cm in sw[::-1]: if cm == "bo": sw....
gruntfutuk Homework 7 4,358 Oct-13-2018, 07:05 PM

User Panel Messages

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