• Member Avatar for woooee
    woooee

    Replied To a Post in How do I get a button to do what it is supposed to do?

    Start with tkinter basics. As already stated, the Label isn't going to change, so using cget() on a label does not provide any useful data. Second, start with one get. …
  • Member Avatar for woooee
    woooee

    Began Watching How do I get a button to do what it is supposed to do?

    The button in question is supposed to calculate the cost of a car rental, from inputs for how many months, how many weeks and how many days. This is the …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Run a command with arguments in python

    Use subprocess.run() https://python.land/operating-system/python-subprocess It receives a list, so it is easy to include parameters. Be sure to read about the shell=True option and decide whether it is necessary or not.
  • Member Avatar for woooee
    woooee

    Began Watching Run a command with arguments in python

    Hello All I am want to run a command "Merge -i file1.txt -i file2.txt -o out.txt" using python script. Here Merge is a exe file located in different path and …
  • Member Avatar for woooee
    woooee

    Replied To a Post in I need help, when i run this python code it skips the part with the quiz.

    Your indentation is off. Look at a basic tutorial and classes. https://wiki.python.org/moin/BeginnersGuide
  • Member Avatar for woooee
    woooee

    Began Watching I need help, when i run this python code it skips the part with the quiz.

    it skips line 11-29 it is really annoying can you pls help me to fix my code i am brand new to coding and need help. Thanks calculater_name = 'Tajs …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Button don't show

    First, don't use pack() and place(). How is Tkinter to know which one to apply to the widget. Don't start multiple instances of Tk(). Same thing. How is Tkinter supposed …
  • Member Avatar for woooee
    woooee

    Began Watching Button don't show

    He, i am strugeling whit a problem , i wannel call the ok restrasion botten. but it don't show on the screen. of form i gows over this pies of …
  • Member Avatar for woooee
    woooee

    Replied To a Post in NEED HELP- creating a simple script!

    Where does dollars come from, and how is it different from total_value def get_left_over_cents(pennies, nickels, dimes, quaters): total_value = get_dollars(pennies, nickels, dimes, quaters) left_over_cents = int(100 *(total_value - dollars))
  • Member Avatar for woooee
    woooee

    Began Watching NEED HELP- creating a simple script!

    ***** I created the format: def main(): pennies=int(input("Enter pennies:")) nickels = int(input("Enter nickels:")) dimes = int(input("Enter dimes:")) quarters = int(input("Enter quarters:")) print("You entered:") print("\tPennies:" , pennies) print("\tNickels:" , nickels) print("\tDimes:" …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Help Me With My A-Level Python Banking System Project

    login() is declared uner the class, even though it is not a member of the class.
  • Member Avatar for woooee
    woooee

    Began Watching Help Me With My A-Level Python Banking System Project

    Hey guys, I'm in desparate need of assistance with my A-Level project. I'm writing a Banking system in Python and I'm being told by the idle log that a function …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Tkinter clear window

    You have to grid, pack or place widgets to get them to appear http://www.effbot.org/tkinterbook/grid.htm
  • Member Avatar for woooee
    woooee

    Began Watching Tkinter clear window

    from tkinter import * import time root = Tk() root.title("Testing System") root.geometry("900x600") def main(): def tick(): time_str1= time.strftime("%H:%M:%S") clock.config(text = "Current Time:\n" + time_str1) clock.after(200, tick) def date(): date_str1 = …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Python tkinter Calculator

    Please don't post twice. That is rude.
  • Member Avatar for woooee
    woooee

    Began Watching Python tkinter Calculator

    Hi! I am creating a simple python tkinter calculator. However when I was due to submit my code in my teacher said that my code is inefficient and recommended i …
  • Member Avatar for woooee
    woooee

    Replied To a Post in simple Python tkinter calculator

    >Can anyone help me? Not without knowing what you have tried. The number buttons is a simple for loop this_row = 2 this_col=0 for num in [7, 8, 9, "*", …
  • Member Avatar for woooee
    woooee

    Began Watching simple Python tkinter calculator

    Hi! I am creating a simple python tkinter calculator. However when I was due to submit my code in my teacher said that my code is inefficient and recommended i …
  • Member Avatar for woooee
    woooee

    Replied To a Post in How can I make a Python script executable on Unix?

    > chmod u=rwx,g=rx,o=r myfile "This example uses symbolic permissions notation. The letters u, g, and o stand for "user", "group", and "other". The equals sign ("=") means "set the permissions …
  • Member Avatar for woooee
    woooee

    Began Watching How can I make a Python script executable on Unix?

    Can anyone help me with the process of making an executable python script in Unix?
  • Member Avatar for woooee
    woooee

    Replied To a Post in Python regex characters between certain characters

    A simple split will do the trick test =""" [ "this is a text and its supposed to contain every possible char." ], [ "like *.;#]ยง< and many more." ], …
  • Member Avatar for woooee
    woooee

    Began Watching Python regex characters between certain characters

    Hi, i have a textfile with a string in it. The string is built like this: test =""" [ "this is a text and its supposed to contain every possible …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Multiple Toggle in the same window

    I could not insert code into the previous post so it's posted on PasteBin https://pastebin.com/746AAg7W
  • Member Avatar for woooee
    woooee

    Replied To a Post in Multiple Toggle in the same window

    Generlly, you send the button number to the function. Also, you import Tkinter twice. Which one is the program supposed to use?
  • Member Avatar for woooee
    woooee

    Began Watching Multiple Toggle in the same window

    So I'm trying to create a UI that allows multiple buttons in the same window. All of the are toggles to control GPIO outputs to control relays. I've managed to …
  • Member Avatar for woooee
    woooee

    Replied To a Post in I need help with Phython work

    Using random.shuffle(), you can just then read them in order. http://www.tutorialspoint.com/python/number_shuffle.htm
  • Member Avatar for woooee
    woooee

    Began Watching I need help with Phython work

    hello, I am currently working on an assignment in my IPT class and I am trying to get questions from my questions box randomly. I am able to do the …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Display An Image From A URL (Tkinter, Python)

    NameError: name 'url' is not defined There is no variable named 'url' in code posted above.
  • Member Avatar for woooee
    woooee

    Began Watching Display An Image From A URL (Tkinter, Python)

    This code shows how to obtain and display a GIF image from an internet website using the Tkinter GUI toolkit that comes with the Python installation.
  • Member Avatar for woooee
    woooee

    Replied To a Post in Writing a program in Python

    Everything regarding the menu is usually in the same function def displayMenu(): print('Enter 1 to convert a string to uppercase:') print('Enter 2 to convert a string to lowercase:') print('Enter 3 …
  • Member Avatar for woooee
    woooee

    Began Watching Writing a program in Python

    **hey guys, im trying to get this program done for class. this is the assignment:** For this assignment, you will write a program that uses a method called displayMenu to …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Python append to an existing file via thread class

    Have BClass write to a separate file and combine them when the threads have finished. You could also use a thread safe SQL server, like MariaDB/MySql, but not SQLite.
  • Member Avatar for woooee
    woooee

    Began Watching Python append to an existing file via thread class

    Hi. im trying to append a text file that is created by another class via another class which are threads. for example, i have : class AClass(QThread): def run(self): with …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Creating a program in python that counts the number of words in a sentence

    Please don't post code without any testing it.
  • Member Avatar for woooee
    woooee

    Began Watching Creating a program in python that counts the number of words in a sentence

    Hello guys!! I really need your help, I'm starting to use python and I have to write a program that counts the letters of a sentence entered by the user. …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Tkinter how to output a value when a specific dynamic button is pressed

    Use partial to pass something to the function, and the function will do something based on the value. This example prints what was passed to the function. Note that the …
  • Member Avatar for woooee
    woooee

    Began Watching Tkinter how to output a value when a specific dynamic button is pressed

    import tkinter root = tkinter.Tk() root.geometry("200x200") buttons=[i for i in range(10)] def getNext(): #If specific button is pressed, output "YES" for num in buttons: btn=tkinter.Button(root, text=num,command=getNext) btn.pack(side=tkinter.TOP)
  • Member Avatar for woooee
    woooee

    Replied To a Post in Python tkinter - how to be given an option to connect to a table in sqlite.

    You have two root=Tk() statements which Tkinter does not like. Also you don't have a mainloop(). And I have no idea what you want to do or why this program …
  • Member Avatar for woooee
    woooee

    Began Watching Python tkinter - how to be given an option to connect to a table in sqlite.

    from tkinter import* import tkinter import sqlite3 import sys conn = sqlite3.connect('REVISION CARD.db') c=conn.cursor() def load(): root=Tk() root.title("REVION CARDS") root.geometry("700x400+100+100") w1=Label(root, text="Question") w1.pack() e=Entry(root,width=40) e.pack() w2=Label(root,text="Answer") w2.pack() e1=Entry(root,width=40) e1.pack() toolbar=Frame(root) …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Find bytes from a read() does not find all occurences

    `if not read_file:`This statement is executed when bytes1 is **found** at the beginning of the file, offset/read_file==0). Use instead with open("foundhex.txt", "a") as found1: while True: read_file = bytearray(binaryfile.read(1024)) if …
  • Member Avatar for woooee
    woooee

    Began Watching Find bytes from a read() does not find all occurences

    Hi, i wasn't sure about the title of my question, hope its okay. Anyway, the program i have is suppose to read a binary file then find for specific bytes …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Masking only on shapefile geometry in cartopy

    How do you determine boundaries? I would suggest that you post some stripped down code, i.e without all of the plotting, etc. as that has nothing to do with "outside …
  • Member Avatar for woooee
    woooee

    Began Watching Masking only on shapefile geometry in cartopy

    I interpolated temperature data observed on an urban area formed by 12 locations. Now i would like to remove all interpolated values that are outside the shapefile layer. How can …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Trouble with a Python Numerology Program (using Python Lists)

    Add a print so you know what is going on and where the problem is occurring. for ch in name: print("\nbefore", ch, total) total = ord(ch) + total - 96 …
  • Member Avatar for woooee
    woooee

    Began Watching Trouble with a Python Numerology Program (using Python Lists)

    I am supposed to write a program that takes a person's whole name and returns the name's numerical value. The numerical value is found by the values of the letters …
  • Member Avatar for woooee
    woooee

    Replied To a Post in total+=sum(k) TypeError: unsupported operand type(s) for +:'int' and'str'

    k is a dictionary value for the Albert Einstien key `self.grades[name]` so you are trying to sum/add a dictionary `total+=sum(k)`. I would suggest that you print "grades" so you at …
  • Member Avatar for woooee
    woooee

    Began Watching total+=sum(k) TypeError: unsupported operand type(s) for +:'int' and'str'

    class subjectGradeBook(object): def __init__(self): self.grades={} def addStudents(self,name): self.grades[name]={} def reportGrade(self,name,subject,grade): k=self.grades[name] gradeList=k.setdefault(subject,[]) gradeList.append(grade) def averageGrade(self,name): k=self.grades[name] total,count=0,0 for grades in k.values(): total+=sum(k) count+=len(k) return total/count book = subjectGradeBook() book.addStudents('AlbertEinstein') book.reportGrade('AlbertEinstein', …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Need help whit MySQL UPDATE query in wxPython

    You SQL query is wrong. It should be obvious that SQL can not know which field in the record to update. See "Parameterized queries" at http://zetcode.com/db/sqlitepythontutorial/
  • Member Avatar for woooee
    woooee

    Began Watching Need help whit MySQL UPDATE query in wxPython

    Hi, i am working on program that connect to database, and user then cans see, edit, insert and delete data in mysql database. I have problem whit update query, can …
  • Member Avatar for woooee
    woooee

    Replied To a Post in Using a list as values in a dictionary?

    You can do everything after the else on one line else: dictfeature[key] = [word] Or even better IMHO if key not in dictfeature: dictfeature[key]=[] dictfeature[key].append(word)

The End.