-
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/ -
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 … -
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) -
Replied To a Post in How to use variable from a function to other function Python 3
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 -
Began Watching How to use variable from a function to other function Python 3
for example, i have this code def awal(): a = 2 def akhir(): print(a) awal() akhir() well i got error that said a is not defined? i used global, same … -
Replied To a Post in Selectable Label in tkinter
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 ## … -
Began Watching Selectable Label in tkinter
I was looking around the web for a "selectable label" in tkinter, everyone seems to point to a disabled text entry. I wanted to share mine thus far. I plan … -
-
-
Began Watching Python Class Problem
Hi there! I am having trouble figuring out what is wrong with my code also I'm kinda new to Python. I'm trying to get variables to one class to another … -
Replied To a Post in Python Class Problem
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, … -
Began Watching python phonebook assignment HELP
HELP! I've been working on this assignment for a while and can't get it to work. It's supposed to pull contact info from a text file, and then return it. … -
Replied To a Post in python phonebook assignment HELP
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. … -
Began Watching Split document an count words
I have a txt file within there are three articals recognizable by the html tags < doc > < / doc> As a result i need to count the words … -
Replied To a Post in Split document an count words
split() on <doc> first and then process each item separately in the returned list. -
Began Watching Python 2.7 CV2 & Tkinter with webcam
I am using Tkinter to make a gui to display the output from a usb camera. It is for a microscopy experiment with the idea being that the gui shows … -
Replied To a Post in Python 2.7 CV2 & Tkinter with webcam
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 … -
Began Watching Python Companion operator
Please take a look at the following codes and explain what’s happening here: a = 256 b = 256 a is b #True its ok c = 257 d = … -
Replied To a Post in Python Companion operator
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 … -
Began Watching remove lines
Hi, I have text file where I have these lines with numbers: e, 1, 2 e, 1, 3 e, 2, 1 e, 3, 4 etc. I need remove similar lines, … -
Replied To a Post in remove lines
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 … -
Replied To a Post in Speeding Ticket Fine Calulation
if 0 < (speed - limit) < 10: fine=$30 elif etc. -
Began Watching Working With PDF files
At my current job me and the rest of the staff that work in my area are uisng a lot of files that when opened look like PDF files but … -
Replied To a Post in Working With PDF files
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. -
Replied To a Post in Jokes
Posted sign: If you trespass your children will be given all the surgar cookies they can hold, and a kitten. -
Began Watching sparse vector in python?
A sparse vector is a vector whose entries are almost all zero, like [1, 0, 0, 0, 0, 0, 0, 2, 0]. Storing all those zeros wastes memory and dictionaries … -
Replied To a Post in sparse vector in python?
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 … -
Replied To a Post in Jokes
Not a joke, but a good riddle for kids. What belongs to you but is used by others more than you. Your name. -
Replied To a Post in Hangman
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 … -
Began Watching Hangman
I created a hangman game but it isn't working. The code is here: import random import sys from string import whitespace uy = 'jrekghqegherwgbeuihrweig' choice = 'bhekvvvvvfaktgrwekubfhdbvbvdvbd' z = 'bqhjrfqfbrqkqbg' … -
Replied To a Post in Hangman
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 … -
Replied To a Post in decode string
Also, strings in Python 3 are unicode so enocde and decode are not necessary. -
Began Watching decode string
I have wrote a simple code in python s = b'B1=A\xF1adir+al+carrito\n'.decode('latin-1') print(s) with open ('lat.txt','wb') as f: f.write(bytes(s,'latin-1')) the output is **B1=Añadir+al+carrito** and the content of the file is also … -
Replied To a Post in decode string
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 … -
Began Watching Tkinter Grid Method Expand?
I would like the widgets on the window to expand as you expand the window. I know you can do it with the pack method but I'm using the grid … -
Replied To a Post in Tkinter Grid Method Expand?
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: … -
Began Watching Fibonacci program
Hello everybody I'm doing a program that finds the nth number in the fibonacci sequence. I actually already coded it. What I would like someone to do is maybe you … -
Replied To a Post in Fibonacci program
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, & … -
Began Watching Python objects and references
Hello, I am starting out learning Python syntax and in the book that I am reading it is mentioned that objects are assigned by reference and not by value, i.e. … -
Replied To a Post in Python objects and references
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 … -
Replied To a Post in Random Facts
In approximately 1 to 2 billion years, the Sun will have expanded enough to engulf the Earth. -
Replied To a Post in Random Facts
Forum posts on DaniWeb are called "articles". -
Replied To a Post in Memorable Quotations
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 … -
Began Watching Creating A GUI for a python Program
Hi Guys, I've been asked to create a GUI to output all the information gather by the program I currently have, however I'm new to using Tkinter and was wondering … -
Replied To a Post in Creating A GUI for a python Program
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 … -
Began Watching Python Checkers Multiple Jumps not Working Properly
I am implementing the last feature of my Python Checkers Game, which is to require the user to make multiple jumps. For captures, I do the following: 1 Check if … -
Replied To a Post in Python Checkers Multiple Jumps not Working Properly
Add some print statements to self.search_capture() to see where the append to the list is happening incorrectly, as obviously the length never equals zero. Note that in "right" and "left" … -
Replied To a Post in There is an elephant on the loo!
I recently went into a Rite-Aid. They take your old "rewards" card and sign you up for a Plenti card, asking for your email because you have to confirm the … -
Replied To a Post in Random Facts
Some turtles can breathe through their butt. A turtle/s ribs are used for the shell so they can not expand and contract their chest to breathe. http://news.discovery.com/animals/why-do-some-turtles-breathe-out-of-their-butt-140617.htm -
Began Watching Star expression in for loop
records = [ ('foo',1,2), ('bar','hello'), ('foo',3,4), ] def do_foo(x,y): print 'foo\t{0}{1}'.format(x,y) def do_bar(s): print 'bar\t{0}'.format(s) for tag , *args in records: if tag == 'foo': do_foo(*args) elif tag == 'bar': …
The End.