Sign up to connect with slate and gain access to their complete profile
  • Member Avatar
    slate

    Replied To a Post in simple Python tkinter calculator

    Your teacher is right. If you see lots of lines in the code, that differ from each other only in a few characters, then your code (or your programming language) …
  • Member Avatar
    slate

    Replied To a Post in Adding a while loop to my rock paper scissors code?

    I know, you did not ask, but the program should be more tight (compact). Something like this: import random def main() : tie_message="It's a draw. You both threw %s." win_message="You …
  • Member Avatar
    slate

    Replied To a Post in Python_Query

    Beside Gribouillis' explanation. > Although, sounds simple but still not able to understand the concept behind. Core concepts are the most hard things. > I would like to know how …
  • Member Avatar
    slate

    Replied To a Post in Guess the number recursion

    Good luck! from random import randint def guess(): if int(input("Guess the number (1-10):"))==randint(1,10): print("Got it") else: print("Wrong!") guess() guess()
  • Member Avatar
    slate

    Replied To a Post in Make A Button That Opens Another Tk() That I Have Made (Python\tkinter)

    You did not mention any reason that justifies creating a new tkinter mainloop. So take a look at these: http://tkinter.unpythonic.net/wiki/ModalWindow http://effbot.org/tkinterbook/tkinter-dialog-windows.htm You can make FirstScreen a modal toplevel window. If …
  • Member Avatar
    slate

    Replied To a Post in regarding the usage of taking slice from multi-dimensional array in python

    > I am not very clear about what does this mean, my original understanding is that x will keep data's first two dimensions, and take a slice from data on …
  • Member Avatar
    slate

    Replied To a Post in How Can I Improve My Game

    Well. I would gladly demonstrate, what I am talking about. Please, show me a working code! If you have difficulties posting here, use pastebin.com.
  • Member Avatar
    slate

    Gave Reputation to tinstaafl in The sum and average of cubes

    Here's the code from the pastebin: print ("This calculates the sum of the cubes of the 1st natural numbers") natn = eval(input("How many cube numbers do you want to sum? …
  • Member Avatar
    slate

    Replied To a Post in How Can I Improve My Game

    First try to make a version of it, that actually can be run by others. If I copy-paste your code into notepad, then save it, it does not run. I …
  • Member Avatar
    slate

    Replied To a Post in draw a triangle and its median?

    I/ if you import everything from turtle, like this: `from turtle import *` Then you cannot make statements like this: `point = turtle.Point(x,y)` You should do: `import turtle` II/ allTriMedian …
  • Member Avatar
    slate

    Replied To a Post in The sum and average of cubes

    * You are not adding up the even cubes. You are adding up all cubes of numbers between 0 and natn-1.Look up [range documentation](https://docs.python.org/3/library/functions.html#func-range), how to generate even numbers. * …
  • Member Avatar
    slate

    Replied To a Post in python

    Google is your friend. https://www.google.hu/search?q=python+smtplib+tutorial+gmail First hit: http://naelshiab.com/tutorial-send-email-python/ Which sais: [ EDIT: Gmail made some security change change recently. You now have to allow “less secure apps” on your account. …
  • Member Avatar
    slate

    Replied To a Post in How to convert letters into maritime letter flags, using turtle graphics?

    I do not understand. * Do you want to draw the maritime flag images using turtle graphics or you want to put the downloaded flag images on a canvas? * …
  • Member Avatar
    slate

    Gave Reputation to Gribouillis in how generate dictionary from checkbutton

    There is a good example at the bottom of this page http://www.python-course.eu/tkinter_checkboxes.php . Take the time to read about the use of tkinter Variable classes.
  • Member Avatar
    slate

    Replied To a Post in How to choose make checkbox true if value of respective key is 1

    python3: import tkinter as tk master = tk.Tk() menu={'pizza':1,'Burger':1,'sandwitch':0} menuvars={} for row, (key, value) in enumerate(menu.items()): menuvars[key]=tk.IntVar() menuvars[key].set(value) tk.Checkbutton(master, text=key, variable=menuvars[key]).grid(row=row, sticky=tk.W) tk.mainloop()
  • Member Avatar
    slate

    Replied To a Post in How to make more then one check button using for loop from sorted list?

    > How to make panel in tkinter or which widget will be used to hide and show checkbox? I am not sure, I understand this sentence. Something about the keywords …
  • Member Avatar
    slate

    Replied To a Post in Not able to initialize default radio button

    Maybe I was not clear enough. If you give a variable to a control object in tkinter, then the control reads its state from this variable. If you do not …
  • Member Avatar
    slate

    Replied To a Post in Not able to initialize default radio button

    Line 46: v = IntVar() ** v goes out of scope.** If you bind v to something persistent (self), then it works. How did you plan to read that variable …
  • Member Avatar
    slate

    Replied To a Post in Convert text baed program to GUI (python)

    Yes. There is a way to convert it to a GUI based program. Before you do that, I would recommend: * Make a self containained version, so others can run …
  • Member Avatar
    slate

    Replied To a Post in Update Jquery

    Why is there a python tag?
  • Member Avatar
    slate

    Replied To a Post in Python: Creating Seperate Functions

    Hello there! Short version: I do not understand the question. Long version: My eagle eye detected you posting the [second](https://www.daniweb.com/programming/software-development/threads/504480/python-comparing-two-values-of-lists-) question about the same project. This should be a very …
  • Member Avatar
    slate

    Replied To a Post in Need help with a few more requirements for this code, keep getting errors.

    Please post a working code, to help others. Try to copy-paste your own posted code into a .py file and see, that it does not work. There is a syntax …
  • Member Avatar
    slate

    Replied To a Post in finding the highest, lowest and average

    Besides from [whathaveyoutried.com](whathaveyoutried.com) , I can only say: values=[int(input("Give the number(%s): " % i)) for i in range(1,6)] print("Highest: {} \n Lowest: {} \n Average: {}".format(max(values),min(values), sum(values)/len(values))) But beleve me. …
  • Member Avatar
    slate

    Replied To a Post in python3-tk scratchpad advice needed

    You use global imported variables locally. There is no need to pass ScrolledText and Tk to the Scratchpad class's dunder init. This is redundant. This is the same, but cleaned …
  • Member Avatar
    slate

    Replied To a Post in simple, clutter-free layout drawing tool needed

    I think the most used layout for tkinter is grid. So grid paper and pen. I know, this is not software. [Others](http://stackoverflow.com/questions/14142194/is-there-a-gui-design-app-for-the-tkinter-grid-geometry) recommend that, too.
  • Member Avatar
    slate

    Replied To a Post in Finding states with max and min population in python

    Here you are. I hope, this makes you a really good programmer. f=open("states.txt").readlines() states=sorted([(f[i].strip(),f[i+1].strip(),int(f[i+2])) for i in range(0,len(f)-3,3)],key=lambda x:x[2]) print("minimum population:",states[0]) print("maximum population:",states[-1])
  • Member Avatar
    slate

    Replied To a Post in Combine Output Class

    class Date(object): def __init__(self, year, month, day): self.year=year self.month=month self.day=day def __add__(self, other): if not isinstance(other,Delta): raise Exception("can only add Delta object") #FIXME handle the calendar year=self.year+other.year month=self.month+other.month return Date(year,month,self.day) …
  • Member Avatar
    slate

    Replied To a Post in Timing five isprime functions (Python)

    There is my python implementation in [this](https://www.daniweb.com/software-development/python/code/216880/check-if-a-number-is-a-prime-number-python) thread as an answer. Nobody bothered to read it ...
  • Member Avatar
    slate

    Replied To a Post in Timing five isprime functions (Python)

    I hope nobody thinks these algos are used in the real world. There are much better [algos](http://en.wikipedia.org/wiki/Primality_test) to determine if a number is prime. Since the beginning of the 20th …
  • Member Avatar
    slate

    Replied To a Post in SOLVE IF YOU CAN

    There is no question. So I have solved it.

The End.