Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Importing classes?
Post: RE: Importing classes?
i have used
subprocess.Popen('afairesh.py', shell=True)to open the module upon button click. Still,searching for the previous issue though |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-31-2018, 04:48 PM |
|
|
Thread: Importing classes?
Post: RE: Importing classes?
Thank you for your response.Made me think better for my future projects!
I think i am making progress.The only error i get now is
NameError: name 'root' is not definedfrom my "afairesh" file( the mod... |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-31-2018, 03:34 PM |
|
|
Thread: Importing classes?
Post: RE: Importing classes?
From "imported" i removed the class and sticked all the functions to the __init__ method.
IMPORTED.py
from tkinter import *
import numpy as np
import os
import sys
import GUI
import subprocess
... |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-30-2018, 08:20 PM |
|
|
Thread: Importing classes?
Post: RE: Importing classes?
Nop,we have to do it all by our selves. I will try your solution now! |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-30-2018, 07:04 PM |
|
|
Thread: Importing classes?
Post: RE: Importing classes?
My module named "afairesh",(lets call it "imported" just for you), has
class MyApp:
def __init__(self,root):and everything is under __init__. The only thing that is not under __init__ is
root=T... |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-30-2018, 03:10 PM |
|
|
Thread: Importing classes?
Post: RE: Importing classes?
Object oriented coding in python is a huge mountain for me.I need to study it a lot more to fully understand it.
GUI.py
import tkinter as tk
from tkinter import messagebox
from sys import exit
import... |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-30-2018, 02:42 PM |
|
|
Thread: Importing classes?
Post: Importing classes?
I have created 2 python programs. One is a GUI and the other is the fuctions that should be done when a button is pressed in the gui. I got it working by using import XXXX when the button is pressed,s... |
|
frequency |
General Coding Help |
11 |
4,819 |
Dec-30-2018, 02:21 PM |
|
|
Thread: Tkinter window minimize,appear
Post: RE: Tkinter window minimize,appear
Its kinda sloppy to use subprocess,but it wont go to waste.I will try to do the normal way by using the imports in a copy version just to test and see. Thanks |
|
frequency |
GUI |
5 |
14,135 |
Dec-28-2018, 02:02 PM |
|
|
Thread: Tkinter window minimize,appear
Post: RE: Tkinter window minimize,appear
I MADE IT WORK!
i used
import subprocessThen i edited hide_and_return function and added
subprocess.Popen('GUI.py', shell=True)This command runs the script with the help of OS and i used the arg shell... |
|
frequency |
GUI |
5 |
14,135 |
Dec-27-2018, 02:44 AM |
|
|
Thread: Tkinter window minimize,appear
Post: RE: Tkinter window minimize,appear
Thanks.I went with your 1st way. Now I added to my GUI
if __name__ == '__main__':
root=tk.Tk()
guitest=GUI(root)
root.mainloop()
But if i try to use
import GUIi will get NameError: ... |
|
frequency |
GUI |
5 |
14,135 |
Dec-27-2018, 01:37 AM |
|
|
Thread: Tkinter window minimize,appear
Post: Tkinter window minimize,appear
Hello,
I am making a GUI for my code. Take a look:
import tkinter as tk
from sys import exit
class GUI:
def __init__(self,root):
root.title("Αρχική είσοδος")
self.maingui=tk.Frame(... |
|
frequency |
GUI |
5 |
14,135 |
Dec-26-2018, 12:59 PM |
|
|
Thread: Make a fully functional program as a library
Post: RE: Make a fully functional program as a library
Managed to somehow make it work,by importing them from a def.For example:
def sum_py(self):
root.withdraw()
import mymoduleit will work,but if it loads it 2 times,the program disappear... |
|
frequency |
GUI |
3 |
2,641 |
Dec-26-2018, 12:18 PM |
|
|
Thread: Make a fully functional program as a library
Post: RE: Make a fully functional program as a library
Sure,take a look at the other programs.
from tkinter import *
import numpy as np
import os
import sys
class MyApp:
def __init__(self,root):
root.title("Αφαίρεση πινάκων")
self.roo... |
|
frequency |
GUI |
3 |
2,641 |
Dec-26-2018, 09:55 AM |
|
|
Thread: Make a fully functional program as a library
Post: Make a fully functional program as a library
Hello!,
I am creating a GUI that will unite all the 3 programs together.3 differend buttons for 3 differend .py files. How can i make each one of them able to work as soon as i tab a button on my GUI?... |
|
frequency |
GUI |
3 |
2,641 |
Dec-25-2018, 07:44 PM |
|
|
Thread: Hide button when clicked
Post: RE: Hide button when clicked
Hello!.I am using tkinter,you are correct.I tried your code but did not make it work. This a snippet.Enough to fix the issue,i guess.
def start(self):
self.w=Label(self.root,text="Πρόσθεση πι... |
|
frequency |
GUI |
2 |
8,816 |
Dec-24-2018, 02:10 PM |
|
|
Thread: Hide button when clicked
Post: Hide button when clicked
self.w3=Button(self.root,text="This must dissapear when clicked ",font="Arial 12",bg="#d9d9d9",command=self.check)
self.w3.grid(row=8,column=1)This button calls a an other function called "check",but ... |
|
frequency |
GUI |
2 |
8,816 |
Dec-24-2018, 11:58 AM |
|
|
Thread: Tkinter window issue
Post: RE: Tkinter window issue
I made it work. Thanks to everybody! Toplevel will be my way to go with windows now.
def check(self):
alpha="abcdefghijklnopqrstuvwxyz"
alpha_cap=alpha.upper()
alpha=alpha+al... |
|
frequency |
GUI |
4 |
3,368 |
Dec-24-2018, 10:49 AM |
|
|
Thread: Tkinter window issue
Post: RE: Tkinter window issue
This is the default fuction
def check(self):
self.t1=self.entry1.get()
self.t2=self.entry2.get()
self.t3=self.entry3.get()
self.t4=self.entry4.get()
if self.t... |
|
frequency |
GUI |
4 |
3,368 |
Dec-23-2018, 05:56 PM |
|
|
Thread: Tkinter window issue
Post: Tkinter window issue
Hello,
I am trying to make a popup window when a user enters a str value.Such as "$$@","sdasd","2y"
def check(self):
self.t1=self.entry1.get()
self.t2=self.entry2.get()
... |
|
frequency |
GUI |
4 |
3,368 |
Dec-22-2018, 10:54 PM |
|
|
Thread: Magic square!
Post: Magic square!
Hello! I was asked to make a magic square solver program.By breaking the program into categories,i must get the user input which will be given with entries separated with commas.So far so good. But i ... |
|
frequency |
Homework |
1 |
2,557 |
Dec-17-2018, 05:30 PM |