woooee 814 Nearly a Posting Maven

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. You have 178 lines of code, and a lot of it is wrong and has to be changed. Take any online tutorial, see "Putting it all together" at http://python-textbok.readthedocs.io/en/1.0/Introduction_to_GUI_Programming.html and again, start with one thing. Once that works you can expand the program.

woooee 814 Nearly a Posting Maven

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.

woooee 814 Nearly a Posting Maven

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

Encray commented: can u pls tell me how yo fix it +0
woooee 814 Nearly a Posting Maven

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 to know which one you are referring to. Use a Toplevel() instead. This modified code does what I think you want.

from tkinter import *
root = Tk()
root.title("Main Form")
root.geometry("640x480")

def helloBack():
   msg = messagebox.showinfo( "Hello Python")

def registrastie():
    root_reg = Toplevel()
    root_reg.title("Registrasie")
    root_reg.geometry("400x400")

    btn_ok = Button (root_reg ,command=helloBack, height=1, width=7, text='Login')

    label_text_name = Label(root_reg, text="name : ")
    label_text_name.place(x= 101, y=50)
    label_text_userid = Label(root_reg, text="userid : ")
    label_text_userid.place(x=100, y=80)
    label_text_token = Label(root_reg, text="Paswoord : " )
    label_text_token.place(x=80, y=110)
    btn_ok_REG = Button(root_reg, height=1, width=7, text='Login')
##    btn_ok_REG.pack()
    btn_ok_REG.place(x= 100 , y=50)


    lbn_name= Entry(root_reg, width=30 )
    lbn_name.place(x=150, y=50)

    lbn_userid= Entry(root_reg, width=30 )
    lbn_userid.place(x=150, y=80)
    lbn_token= Entry(root_reg, width=30 )
    lbn_token.place(x=150, y=110)

def login():
    root_login = Toplevel()
    root_login.title("Login")
    root_login.geometry("400x400")
    label_text_login = Label(root_login, text="User ID : ")
    label_text_login.place(x= 114, y=50)
    label_text_token = Label(root_login, text="Paswoord :")
    label_text_token.place(x= 100, y=80)
    lbn_name= Entry(root_login, width=30 )
    lbn_name.place(x=160, y=50)
    lbn_userid= Entry(root_login, width=30 )
    lbn_userid.place(x=160, y=80)
# login
btn_number_one = Button (root ,command=login, height=1, width=7, text='Login')
##btn_number_one.pack()
btn_number_one.place(x= 100 , y=50)

# Registratie
btn_number_one = Button (root ,command=registrastie, height=1, width=7, text='Registratie')
##btn_number_one.pack()
btn_number_one.place(x= 200 , y=50)

root.mainloop()
woooee 814 Nearly a Posting Maven

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))
woooee 814 Nearly a Posting Maven

login() is declared uner the class, even though it is not a member of the class.

TickleMeElmo commented: Thanks very much for your help! +0
woooee 814 Nearly a Posting Maven

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

woooee 814 Nearly a Posting Maven

Please don't post twice. That is rude.

woooee 814 Nearly a Posting Maven

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, "*", 4, 5, 6, "-", 1, 2, 3, "+"]:
    Button(btns_frame, text = num, fg = "black", width = 10, height = 3, bd = 0,
               bg = "#fff", cursor = "hand2",activebackground = "#1E90FF", 
               command = lambda: btn_eval(num)).grid(row = this_row,
               column = this_column, padx = 1, pady = 1)
    this_col += 1
    if this_col > 3:
        this_row += 1
        this_col = 0
woooee 814 Nearly a Posting Maven

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 exactly like this," and the letters "r", "w", and "x" stand for "read", "write", and "execute", respectively. The commas separate the different classes of permissions, and there are no spaces in between them"  From https://www.computerhope.com/unix/uchmod.htm
woooee 814 Nearly a Posting Maven

A simple split will do the trick

test =""" 
        [
        "this is a text and its supposed to contain every possible char."
        ], 
        [
        "like *.;#]ยง< and many more."
        ], 
        [
        "plus there are even
        newlines

        in it."
        ]"""

x=test.split('[\n')
for rec in x:
    print(rec)
    print("-"*20)
woooee 814 Nearly a Posting Maven

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

woooee 814 Nearly a Posting Maven

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

woooee 814 Nearly a Posting Maven

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

woooee 814 Nearly a Posting Maven

NameError: name 'url' is not defined

There is no variable named 'url' in code posted above.

woooee 814 Nearly a Posting Maven

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 to count the number of words in a string:')
    print('Enter 4 to count the number of vowels in a string:')
    print('Enter 5 to exit:')

    choice = ""
    while (choice != 5):
        ## what happens when someone enters a letter
        choice = int(input('Enter your choice:'))
        if choice in [1, 2, 3, 4]:
            string_input=get_sring()
        if(choice == 1):
            upper(string_input)
        elif(choice == 2):
            lower(string_input)
        elif(choice == 3):
            split(string_input)
        elif(choice == 4):
            vowels(string_input)
        elif(choice == 5):
            print('Thank you. Goodbye!')
            return  ## <----- exit function
        else:
            print('Incorrect entry, please try again.')

## same thing for a strint
def get string():
    #Allow user to enter string
    while True:  ## infinite loop
        user_string = input('Enter a string: ')
        if len(user_string):  ## not an empty string
            return user_string
woooee 814 Nearly a Posting Maven

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.

woooee 814 Nearly a Posting Maven

Please don't post code without any testing it.

woooee 814 Nearly a Posting Maven

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 Python Style Guide suggests function names should be lower case letters and underscores https://www.python.org/dev/peps/pep-0008/

root = tkinter.Tk()
root.geometry("200x300")
##buttons=range(10)
button_list=[]

def get_next(button_num):
    print("button number =", button_num)
    ## change the color of the button pressed to show how the list works
    button_list[button_num].config(bg="lightblue")

for num in range(10):
    btn=tkinter.Button(root, text="Button %d" % (num),
                       command=partial(get_next, num))
    btn.pack(side=tkinter.TOP)
    ## save a reference to the button so it can be used in get_next
    ## the button number corresponds to the offset in the list
    button_list.append(btn)

root.mainloop()
woooee 814 Nearly a Posting Maven

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 was posted here.

woooee 814 Nearly a Posting Maven

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 len(read_file):
                  find_bytes1 = read_file.find(bytes1, 0)
                  if fine_bytes1 != -1:
                      found1.write("Found 41646F626520 at : " + str(find_bytes1) + "\n")
              else:
                  break

Also this statement find_bytes1 = read_file.find(bytes1, 0)
starts at the beginning every time, so you are finding only the first sting and not any subsequent strings. Finally, for this statement read_file = bytearray(binaryfile.read(1024))
what happens if half of bytes1 is in one read, and half is in the next read?

woooee 814 Nearly a Posting Maven

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 boundaries". Include also an explanation of how you would like to determine what is outside the boundaries.

glez_b commented: I want to plot only the data that are inside the Multipolygon of the shapefile +1
woooee 814 Nearly a Posting Maven

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            
        print("after", ch, total)
woooee 814 Nearly a Posting Maven

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 least know what it contains.

woooee 814 Nearly a Posting Maven

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/

woooee 814 Nearly a Posting Maven

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)
woooee 814 Nearly a Posting Maven

Variables created in a function are garbage collected when the function exits so you have to return them to keep a variable. Any tutorial that explains functions covers this https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

woooee 814 Nearly a Posting Maven

You don't need the lambdas. You are executing the function (parens follow function name) so that requires a lambda. Just pass the function reference.

self.bind('<Enter>', self._label_enter)  ## no parens
## and then
def _label_enter(event=None):
woooee 814 Nearly a Posting Maven

All of the widget.get() statements are called when the widgets are created, i.e. before anything is entered. See the example for the Entry using a button to get the results, the other widgets are the same at effbot http://effbot.org/tkinterbook/entry.htm So start with one widget and test it until it does what you want, and then add more.

woooee 814 Nearly a Posting Maven

You don't increment "count" correctly in the file input (I would guess since we don't know the layout of the file). The printing of lastname, firstname, etc. should show that. Also, use one lookup function only. Past the list to use to the function. So to lookup lastname, pass the lastname list to the function and "last name". Then input "Enter the %s to look up" % lit_passed_to_func.

woooee 814 Nearly a Posting Maven

split() on <doc> first and then process each item separately in the returned list.

woooee 814 Nearly a Posting Maven

First, pygame is probably a better option to display a stream. The end-of-file pointer is not updated until the file is closed so it shows zero length. I can't tell from the code if the file is closed or not after the capture and write. You want something similar to an SQL file that has a manager running independently to handle read and writes simultaneously. Otherwise, you will have to do something like read x bytes from the file, or close the file every second or so, opening a different one for the next write sequence, and then it can be read. Perhaps someone else will have more info. To test this I would suggest that you read from the camera, close the "read" program, then open the Tkinter program and see if it can then display the file from the camera capture.

woooee 814 Nearly a Posting Maven

They are all True on my computer as each pair points to the same address in memory (although I am on a 64 bit computer and it may be different on a 32 bit machine). Python keeps a list of objects for all "small" integers so they don't have several references to the same number in a program. When you create an int in that range you actually just get back a reference to the existing object. So each variable in the pair points to the same existing object. To get a False you would have to point to some calculated number i.e. it is not a reference to an existing object.

a = 256  ## lookup in existing list
b = 256
print a is b

c = 257
d = 257
print c is d

e = 258
f=258
print e is f

## create and put in unique memory location
## "256+1" not in list
g = 256+1
print "c is g", c is g, c, g

""" prints
True
True
True
c is g False 257 257
"""
woooee 814 Nearly a Posting Maven

Please post the code you have tried so far, to be used as a starting point. The question can not be answered until we know how "e, 2, 1" is similar

woooee 814 Nearly a Posting Maven
if 0 < (speed - limit) < 10:
    fine=$30
elif etc.
woooee 814 Nearly a Posting Maven

Same here. I usually write it in Postscript and convert it, or when it is simple, do it in LibreOffice and save the file as a PDF.

woooee 814 Nearly a Posting Maven

Posted sign: If you trespass your children will be given all the surgar cookies they can hold, and a kitten.

woooee 814 Nearly a Posting Maven

Frist you have to determine the length of the final list. Then append zeroes unless the list offset is in the dictionary passed to the function.

def convert_dictionary(dict_in):
    """ a dictionary's keys are not necessarily in entry order
    """
    print max(dict_in.keys())
    print dict_in.keys()

convert_dictionary({0: 1, 2: 1, 4: 2, 6: 1, 9: 1})
woooee 814 Nearly a Posting Maven

Not a joke, but a good riddle for kids.

What belongs to you but is used by others more than you. Your name.

woooee 814 Nearly a Posting Maven

Note also that this statement will always be true

    elif guess == a1a or a2a or a3a or a4a or a5a or a6a or a7a or a8a or a9a or a10a or a11a or a12a or a13a or a14a or a15a or a16a or a17a

an "or" is the same as if/elif so your statement becomes

elif guess == a1a:
    elif a2a:
    elif a3a:  

etc. " elif a2a" will always be true as long as any of the a2a-a17a is not an empty string, zero, or None.

woooee 814 Nearly a Posting Maven

Good luck getting someone to go through 768 lines of code. Present a simplified form of the part that is not working, like the following

""" This does not allow for a word that has the same letter
    multiple times
    Nor does it exit when the word is guessed before the allowed
    number of tries
"""

word="turkey"
to_print=["-" for ltr in word]

## give them 7 guesses:
for ctr in range(7):
    guess = raw_input('Enter a letter: ')
    guess=guess.lower()
    if guess in word:
        location=word.find(guess)
        to_print[location]=guess
    if "-" not in to_print:
        print "\n****You guessed the word*****\n"

    print "".join(to_print)
woooee 814 Nearly a Posting Maven

Also, strings in Python 3 are unicode so enocde and decode are not necessary.

woooee 814 Nearly a Posting Maven

Use the codecs' encoding parameter when reading and writing, although you can do it manually yourself, I find that this method works without problems. Also, note that how it prints depends on the default encoding of your OS.

import codecs

s = b'B1=A\xF1adir+al+carrito\n'.decode('latin-1')
with codecs.open('lat.txt', mode="wb", encoding='latin-1') as fp:
    fp.write(s)

with codecs.open('lat.txt', "r", encoding='latin-1') as fp:
    r=fp.read()

print s
print r
woooee 814 Nearly a Posting Maven

You use rowconfigure and columnconfigure. If you comment one of them out in the following example, it will only expand in the direction of which ever was not commented.

try:
    import Tkinter as tk     ## Python 2.x
except ImportError:
    import tkinter as tk     ## Python 3.x

def column_row_expandable():
    """ the labels and button will not expand when the top frame expands
        without the rowconfigure and columnconfigure statements
    """
    top=tk.Tk()
    top.rowconfigure(0, weight=1)
    for col in range(5):
        top.columnconfigure(col, weight=1)
        tk.Label(top, text=str(col)).grid(row=0, column=col, sticky="nsew")

    top.rowconfigure(1, weight=1)
    tk.Button(top, text="button").grid(row=1, column=0, columnspan=10, sticky="nsew")
    top.mainloop()

column_row_expandable()
woooee 814 Nearly a Posting Maven

Perhaps "using a list" means something more along the lines of the following. Your code is redundant in that the values are in the list and in a, b, & c. Note that a fib sequence can start with any 2 numbers--the following uses zero and one, but you could also use 1 and 1.

fib_list=[0, 1]
for ctr in range(10):  ## or while <
    fib_list.append(fib_list[-1]+fib_list[-2])

print fib_list
woooee 814 Nearly a Posting Maven

To further the foo_1 is not mutable (when it is changed it resides at a new memory address).

foo_1=3
print "at memory address", id(foo_1)

foo_1 += 2
print "not mutable so new value=new address"
print id(foo_1)

print "\n lists are mutable (same memory address)"
foo_1 = [3]
print id(foo_1)
foo_1[0] += 2
print id(foo_1)
woooee 814 Nearly a Posting Maven

In approximately 1 to 2 billion years, the Sun will have expanded enough to engulf the Earth.

woooee 814 Nearly a Posting Maven

Forum posts on DaniWeb are called "articles".

woooee 814 Nearly a Posting Maven

When palaces are kept up
Fields are left to weeds
And granaries empty (economy trashed);
Wearing fine clothes,
Bearing sharp swords,
Glutting with food and drink,
Hoarding wealth and possessions -
These are the ways of theft,
And far from the Way.

Tao Dejing #53

woooee 814 Nearly a Posting Maven

Tkinter variables are different (classes) from Python variables so you always have to convert one to the other. In Tkinter a StringVar shows any changes as they occur (to the StringVar). See the simple example at effbot http://effbot.org/tkinterbook/entry.htm showing set() --> Python to Tkinter, and get() --> Tkinter to Python