Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Flask basics... url
Post: RE: Flask basics... url

return redirect(url_for('...'))
ifigazsi Web Scraping & Web Development 1 1,501 Nov-19-2021, 09:38 PM
    Thread: Flask basics... url
Post: Flask basics... url

Hi! When I render the movie.html page, is it possible to change the url as well? Thank you! from flask import Flask, render_template, request app = Flask(__name__) db_movie = {} db_movie['Dune'] =...
ifigazsi Web Scraping & Web Development 1 1,501 Nov-19-2021, 05:40 PM
    Thread: Flask Basics request.form
Post: Flask Basics request.form

Hi! There is a html file, with two separate <form(s)>. How to get the data from both? from flask import Flask, request, render_template, url_for app = Flask(__name__) @app.route('/', method...
ifigazsi Web Scraping & Web Development 0 1,783 Feb-09-2021, 09:05 AM
    Thread: Flask request.form
Post: RE: Flask request.form

if request.method == 'POST': add_button = request.form.get('add') list_button = request.form.get('list') del_button = request.form.get('del') if add_button: print('Add somethin...
ifigazsi Web Scraping & Web Development 2 3,576 Feb-02-2021, 08:03 AM
    Thread: Flask request.form
Post: Flask request.form

Hi! I have three buttons on new_page.html Only the first one is working . Add something button. How to fix it? I guess try-expect blocks are not to pythonic. from flask import Flask, render_templ...
ifigazsi Web Scraping & Web Development 2 3,576 Feb-01-2021, 01:49 PM
    Thread: datetime / time
Post: RE: datetime / time

(Jan-31-2021, 07:44 PM)Larz60+ Wrote: the try/except block should not be indented. Ofc! But still why is the try part not working?
ifigazsi General Coding Help 5 7,054 Jan-31-2021, 08:51 PM
    Thread: datetime / time
Post: datetime / time

Hi! The code is below, i got the solution, i'm just curious why datetime.time + datetime.timedelta is not working... import datetime t = datetime.time(7, 0) d = datetime.datetime(2021, 1, 1, 7, ...
ifigazsi General Coding Help 5 7,054 Jan-31-2021, 07:31 PM
    Thread: Opening new window
Post: RE: Opening new window

Thank you! :) Works great!
ifigazsi GUI 2 1,874 Jan-20-2021, 04:16 PM
    Thread: Opening new window
Post: Opening new window

Hi! I have a window, but i want to open another one, upon pushing a button. (so both of them should be open simultaneously) import sys from PyQt5.QtWidgets import * class Window_No1(QWidget): d...
ifigazsi GUI 2 1,874 Jan-20-2021, 12:36 PM
    Thread: Class variable / instance variable
Post: RE: Class variable / instance variable

(Jul-27-2020, 02:57 PM)deanhystad Wrote: It is not a common practice to hid import statements inside a function. They should all appear at the top of the file unless you are trying to get around a ...
ifigazsi General Coding Help 9 4,220 Jul-27-2020, 09:03 PM
    Thread: Class variable / instance variable
Post: RE: Class variable / instance variable

(Jul-26-2020, 05:43 PM)deanhystad Wrote: Good or bad design depends on the problem you are trying to solve. Global variables are usually bad, but sometimes they can lead to an elegant solution for ...
ifigazsi General Coding Help 9 4,220 Jul-26-2020, 07:04 PM
    Thread: Class variable / instance variable
Post: RE: Class variable / instance variable

(Jul-26-2020, 04:03 PM)Yoriz Wrote: Something like this ? class Something: data = [2, 3, 4, 5] def __init__(self): self.reset_data() def reset_data(self): self.data...
ifigazsi General Coding Help 9 4,220 Jul-26-2020, 05:19 PM
    Thread: Class variable / instance variable
Post: RE: Class variable / instance variable

(Jul-26-2020, 03:20 PM)buran Wrote: (Jul-26-2020, 02:32 PM)ifigazsi Wrote: I have a class variable, but I want to change this at instance level, without changing the original class variable, how c...
ifigazsi General Coding Help 9 4,220 Jul-26-2020, 03:40 PM
    Thread: Class variable / instance variable
Post: Class variable / instance variable

class Something: saved_data = [2, 3, 4, 5] def __init__(self): self.data = Something.saved_data self.data2 = [x for x in Something.saved_data] x = Something() print(x.data ...
ifigazsi General Coding Help 9 4,220 Jul-26-2020, 02:32 PM
    Thread: Notebook + modules
Post: RE: Notebook + modules

(Apr-08-2020, 03:38 PM)deanhystad Wrote: Try adding more pages. If that is easy to do, the design is good. Think about how you would use this design for something more realistic. What are the sho...
ifigazsi GUI 6 2,482 Apr-09-2020, 11:18 AM
    Thread: Notebook + modules
Post: RE: Notebook + modules

I was able to create it, but is it good? That is the way I should make it? At least it works... So the two files: program.py: import tkinter as tk from tkinter import ttk import memberspage root =...
ifigazsi GUI 6 2,482 Apr-08-2020, 09:15 AM
    Thread: Notebook + modules
Post: RE: Notebook + modules

(Apr-06-2020, 06:20 PM)deanhystad Wrote: Yes. It is possible and a good idea. Thank you :D But now i have to ask: and how?
ifigazsi GUI 6 2,482 Apr-06-2020, 07:07 PM
    Thread: Notebook + modules
Post: Notebook + modules

Hi! Is it possible to create your own module for every notebook(tab)? Then to import them. I want to make my code a bit better readable\manageable... (instead of one very long .py file) So something...
ifigazsi GUI 6 2,482 Apr-06-2020, 08:48 AM
    Thread: TkInter Binding Buttons
Post: RE: TkInter Binding Buttons

(Apr-06-2020, 04:36 AM)deanhystad Wrote: Yes, you can bind both a key and a button to the same function. You were really close with the lambda. All you had to do was throw away the event which you...
ifigazsi GUI 5 4,167 Apr-06-2020, 08:30 AM
    Thread: TkInter Binding Buttons
Post: RE: TkInter Binding Buttons

Ok, i got the answer: simply, with invoke() (Apr-05-2020, 10:47 AM)ifigazsi Wrote: Is it possible that tk.Button and Key binding use the same function? field_entry.bind("<Return>", lambda eve...
ifigazsi GUI 5 4,167 Apr-05-2020, 07:03 PM

User Panel Messages

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