Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: how to compare two cards games?
Post: RE: how to compare two cards games?

Why use strings at all, when Python has enumerations: https://docs.python.org/3/library/enum.html? If you're going to use strings, make your code readable with full words..
ndc85430 Homework 7 308 Nov-25-2021, 06:23 PM
    Thread: POST Reply to Ajax/jQuery (mostly an HTML question)
Post: RE: POST Reply to Ajax/jQuery (mostly an HTML ques...

As above, you don't need an onclick attribute. There should be some JavaScript code that sets up the event handling for the click event on that button (for example, a call to jQuery's click function).
ndc85430 Web Scraping & Web Development 5 521 Nov-18-2021, 07:25 AM
    Thread: POST Reply to Ajax/jQuery (mostly an HTML question)
Post: RE: POST Reply to Ajax/jQuery (mostly an HTML ques...

Where's the JavaScript code that handles the click event on the button? You'll need to at least look at that.
ndc85430 Web Scraping & Web Development 5 521 Nov-16-2021, 05:13 PM
    Thread: SQL Query is not executing WHERE clause
Post: RE: SQL Query is not executing WHERE clause

(Nov-15-2021, 02:22 AM)menator01 Wrote: Try using fstring. Please don't suggest this (or string concatenation) - SQL queries should make use of placeholders ("prepared statements"), so as not to be ...
ndc85430 General Coding Help 7 313 Nov-15-2021, 06:37 AM
    Thread: Flask dynamic data ?
Post: RE: Flask dynamic data ?

Do note with AJAX, though, it's the client pulling the data, rather than the server pushing it. Both work, depends where you want to control things.
ndc85430 General Coding Help 10 404 Nov-14-2021, 04:49 PM
    Thread: Flask dynamic data ?
Post: RE: Flask dynamic data ?

HTTP is request/response, meaning that the client had to make the request for the data. If you want the server to push data to the client, then at least one way to do that is using WebSocket. Flask ma...
ndc85430 General Coding Help 10 404 Nov-14-2021, 04:27 PM
    Thread: Removing the unwanted data from a file
Post: RE: Removing the unwanted data from a file

(Nov-14-2021, 12:39 AM)jehoshua Wrote: I've done a grep search through all these emails and folders. The output is in a file. The data is like this Quote:family/Smallville, Robert & Mary/28134:...
ndc85430 General Coding Help 12 555 Nov-14-2021, 07:03 AM
    Thread: [split] Flask OSError: [Errno 98] Address already in use
Post: RE: [split] Flask OSError: [Errno 98] Address alre...

I mean, it really sounds like a network problem. I disagree when you say it's about a shared directory - why would a web server have knowledge of that? Does netstat show TCP sockets without -t? Is th...
ndc85430 Web Scraping & Web Development 8 433 Nov-11-2021, 05:06 PM
    Thread: [split] Flask OSError: [Errno 98] Address already in use
Post: RE: [split] Flask OSError: [Errno 98] Address alre...

Can you show how you're determining that there are no other processes listening on the port?
ndc85430 Web Scraping & Web Development 8 433 Nov-11-2021, 12:42 PM
    Thread: function for generating graph bar from list
Post: RE: function for generating graph bar from list

You're already passing duck_list to the function, so get the data from there instead of hard coding it. You're not currently using that argument. Also, what exactly are you trying to do with that mai...
ndc85430 Homework 4 288 Nov-10-2021, 01:44 PM
    Thread: [split] flask 500 internal server error
Post: RE: [split] flask 500 internal server error

Can you show (or explain) how you're getting the 500? I copied the code as is, ran it, navigated to localhost:5000 in my browser and I got the expected response (a 200 with "hello" in the body).
ndc85430 Web Scraping & Web Development 3 630 Nov-10-2021, 08:48 AM
    Thread: function for extracting data from lists
Post: RE: function for extracting data from lists

Why are you trying to assign to a variable in a return statement? return is for returning a value to the caller of the function.
ndc85430 Homework 9 421 Nov-09-2021, 06:29 AM
    Thread: Library or website for multiplayer games Flask/Python
Post: RE: Library or website for multiplayer games Flask...

Your post doesn't make a lot of sense to me. First you say you're writing a game for Flask. Flask is a web framework; why would you make games for it? Next you mention socket programming, but if you'r...
ndc85430 Game Development 1 752 Nov-07-2021, 06:45 AM
    Thread: What to do when the requirements.txt file does not work
Post: RE: What to do when the requirements.txt file does...

I'd suggest keeping your dependencies up to date really. You don't want to be using obsolete versions because the newer ones will have improvements of various kinds, but are also obviously supported (...
ndc85430 General Coding Help 2 285 Nov-04-2021, 01:30 PM
    Thread: Issues with the task of reseaching a user in a Flask datbase
Post: RE: Issues with the task of reseaching a user in a...

(Nov-04-2021, 10:39 AM)ibreeden Wrote: NEVER use "tuple" as a name for a variable. Because it hides the builtin tuple. It's also just a poor name, because it doesn't convey any meaning. What is the ...
ndc85430 Homework 2 299 Nov-04-2021, 10:58 AM
    Thread: SQLALCHEMY - Column doesn't exist
Post: RE: SQLALCHEMY - Column doesn't exist

I don't understand the aversion to doing the correct thing, especially when it isn't complicated.
ndc85430 General Coding Help 9 565 Nov-04-2021, 09:20 AM
    Thread: Hashing an address for binary file
Post: RE: Hashing an address for binary file

Also posted in Dream.in.code: https://www.dreamincode.net/forums/topic...inary-file.
ndc85430 General Coding Help 8 406 Nov-04-2021, 06:23 AM
    Thread: Populate Dropdown list from Database
Post: RE: Populate Dropdown list from Database

(Nov-02-2021, 04:57 PM)TommyAutomagically Wrote: Right, I understand I think. This would explain why it works when going direct to get_investor because it sends a GET request to the getInvestror fun...
ndc85430 General Coding Help 4 330 Nov-02-2021, 05:23 PM
    Thread: Populate Dropdown list from Database
Post: RE: Populate Dropdown list from Database

Remember that HTTP is request/response - the client has to request the data it wants and do something with it. The button click obviously happens on the client, so you could write some JavaScript to m...
ndc85430 General Coding Help 4 330 Nov-02-2021, 04:42 PM
    Thread: SQLALCHEMY - Column doesn't exist
Post: RE: SQLALCHEMY - Column doesn't exist

Still, there's no downside to constructing queries correctly and it doesn't take much effort.
ndc85430 General Coding Help 9 565 Nov-02-2021, 08:49 AM

User Panel Messages

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