Python Forum
2,296 FOLLOWERS
Welcome to this dedicated Python forum. Find news and discussions about Python, get coding help from fellow programmers, share finished code with other forum users, discuss queries, and discover Python-related tutorials.
Python Forum
42m ago
sorry for my bad English,
1. in tkinter I tried to hide Minimize,
maximize button, but I only found :
Top.resizable(0,0)
what command to disable them?
2. I tried to edit the close button with
Top.withdraw()
what command to do that?
3. how to check if a Toplevel() window exists?
window = Toplevel(None)
thank you for reading,
have a nice day ..read more
Python Forum
42m ago
This is from Dave Beazly's Generators: The Final Frontier here. Part 3, the example inline_recursive.py
When I run inline_recursive.py in Idle, by copying and pasting the parts into Idle, it works and prints lots of:
print('Tick:', n)
But I get this error when I run inline_recursive.py in bash, right after the first tick is printed:
pedro@pedro-HP:~/myPython/yield/tutorial2014$ ./inline_recursive.py
Tick: 0
Error:
exception calling callback for <Future at 0x75e01f9e0be0 state=finished returned NoneType>
Traceback (most recent call last):
File "/usr/lib/python3.10/concurrent/fut ..read more
Python Forum
8h ago
I'm new to Python and have installed Python 3.12.3 with idle on Windows 10. Having had fairly good success with other scripts, I decided to try to code a simple plot from example, I believe I have installed matplotlib, but I get an error message "ModuleNotFoundError: No module named 'matplotlib'"
Filename scatter_plot.py
Thanks,
Here's the script:
import matplotlib.pyplot as plt
import numpy as np
# Fixing random state for reproducibility
np.random.seed(19680801)
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2 # 0 to 15 point ..read more
Python Forum
11h ago
I am relatively new to PYQT5. I am implementing a progress bar. However, I have run into the issue where the pop up progress bar does not run at the same time as when the function is called. In the example, I am using I want the progress bar to pop up and display progress while the self.main_window_button is clicked and executes a function under another file called untitled3.
import sys
import time
import untitled3
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets,QtGui
from PyQt5.QtWidgets import QDialog, QApplication,QMainWindow, QWidget, QHBoxLayout, QProgressBar,QVBoxLayout
from ..read more
Python Forum
13h ago
Hello, I have been trying to convert the CCI-EMA indicator prepared with pinescript on Tradingwiev to Python code for about a week and filtering through this code, but the graphic image on TW and the Python graphic image are different from each other. While it appears on CCI-EMA on TW, it is under the code I wrote. What am I doing wrong? When I want to solve this problem and filter the stocks that cut the ema value of the CCI indicator upwards, when I check the stocks listed with tw after the filtering, I see that there is either no intersection or they are far ahead of the intersection point ..read more
Python Forum
13h ago
I'm new to coding.
I created the following code, but I cannot place the data entered in my Google Sheet file. JSON works.
The date must go in the next 2 free cells in line 3
The time will have to go in the 2 next free cells in line 4
The registration must go in the 2 next free cells in line 1
Flight number will have to go in the 2 next free cells in line 2
routing will have to go in the next 2 free cells in line 5
I would then need when I click Visualiser les commandes pour un jour précis for the program to access the Google sheet and find the registration, flight id, time, routing informati ..read more
Python Forum
23h ago
Hello,
In the files I need to work with, I notice that the values in the following meta line can be either lower-case or capitalized.
What would be the right way to convert them to lower-case regardless so that search doesn't miss the others?
#could be "Content-Type" or "content-type"
meta = soup.head.find("meta", {"http-equiv":"content-type"})
if meta is None:
print("here1")
else:
print("here2")
Thank you ..read more
Python Forum
1d ago
hi
I read some about using mutable(list or dict) in function definition as an optional parameter as this was discussed in the site realpython(its address is in the below code). also, I talked about this subject in this forum before.
in the below code:
#mutable_in_func_def.py
'''
problems that arise when using mutables(such as lists or dictionaries) in functions
definition as default values.
ref:https://realpython.com/python-optional-arguments/#using-python-optional-arguments-with-default-values
'''
# optional_params.py
hardware_store_list = {}
supermarket_list = {}
chimical_store_list={}
d ..read more
Python Forum
1d ago
I am getting an error message when I try to install cucumber when using the following command. Any assistance would be greatly appreciated.
>>>import subprocess
>>>subprocess.check_call([sys.executable, "-m", "pip", "install", "cucumber-cpp ..read more
Python Forum
2d ago
I am trying to predict win or loss in ML using Python. Tried XGboost,Logistic and SVC method but getting struct in place where it says " estimators failed to fit".
Need help on this prediction.
I have given a sample data.. The first 6 Id have result known as either won or loss .. how can predict 7,8 and 9 on the sample data either won or loss and also any possibility to get the % of win or loss. we have Id, pl as place and tr as another categorical variable and based o n all the variable how can we predict Dealst....
your help would be greatly appreciated.
Id Pl tr days1 days2 days3 totalda ..read more