1,175 Posted Topics
Re: I have started to program with windows concepts. It is different then console and that is were the learning curve sets in. Once you realize how to approach a GUI with its frames, windows, dialog boxes, buttons, labels and so on, you will enjoy it. I use Tkinter right now, … | |
I have a data file with chemical names (one name per line) and want to load that into a Tkinter GUI listbox and then be able to select it by clicking on the line. Need some help. | |
I am experimenting (playing around) with the Python Tkinter Gui, and wondered if there is a way to play a sound like from a .wav or .au file? | |
Re: Nice program! I ran it and for factorial 13 I got 1932053504 when it should be 6227020800. ![]() | |
I know that Pyhon compiles source code to a Byte Code before the interpreter works on it. What does this Byte Code look/behave like? | |
I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation? | |
Which Graphics User Interface (GUI) would you recommend for a beginner? I have seen some examples of Tkinter, wxPython and GTK. | |
I have a color data file that gives the color name and its RGB values, for instance like this: [CODE] red RGB(255,0,0) green RGB(0,128,0) blue RGB(0,0,255) brown RGB(165,42,42) gold RGB(255,215,0) maroon RGB(128,0,0) [/CODE]I like to create a color dictionary from this file that looks like this: [CODE] {'red': (255,0,0), 'green': … | |
Re: Sounds like hard program to play around with. You could really do some damage to files in your hard drive! | |
When do you use a for loop and when to use a while loop. Are there other loop types in Python? Some of the slicing examples almost look like loops. | |
![]() | Re: LaMouche, nice game! What would a dictionary do to improve it? Would it be hard to dress the game up in a GUI like Tkinter? |
I have a file of sentences similar to this: [CODE] Tom ate his Apple. Frank shoveled Snow. Henry drove a Truck. [/CODE]I would like to prosess each sentence so it only retains the capital letter in the first word, every other word in the senetnce should be lower case. The … ![]() | |
Re: Look what can happen if you spend a lot of time on DaniWeb! The government will probably legislate a warning sticker soon! | |
Re: What is pygtk/gtk and what is is it used for? Also, what is a treeview? | |
I like to create a structure in Python, something like: [code]solvent_name boiling_point melting_point flash_point [/code]I need to search and sort this structure. How can I best do that? | |
Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321. | |
Re: I think I will stay away from using "class" until I learn how to use OOP at least rudimentary. | |
What is the most efficient way to spell a string in reverse, for instance s = "banana". ![]() | |
If I have an integer like x = 12345, how do I separate that into individual integers 1, 2, 3, 4, 5? | |
Re: Just an exercise in passing arguments to functions: [code]def increment(a, b, c): a += 1 b += 1 c += 1 return a, b, c def main(): c = d = e = 0 c, d, e = increment(c, d, e) # test the result print c, d, e # … | |
![]() | Re: I am new to Python, but it seems to me that using main(), or whatever you want to call it, forces you to write cleaner code. Here is my argument, with no main() you create automatically global variables: [code]def show_x(): """possible since x is global and is not changed""" print … |
With the ease of argument passing to and from functions in Python, why would anyone want to use global variables. Isn't that an open invitation for mistakes to happen? Yet, I see code in threads here that abound with globals. I am a little confused here. | |
How to I best pass multiple arguments to and from a function? | |
I have played with Python code just a little and like it so far. I am using a Windows XP machine and have downloaded Python 2.5. As recommended in the "Starting Python" thread, I am saving my test files in the directory C:\Python25\Atest\. When I bring up the IDLE editor, … | |
I thought function xrange would give me a list of integers, but I got a string instead: [code]x = "xrange(1, 5)" print x # xrange(1, 5) x = xrange(1, 5) print x # xrange(1, 5) same result as string above!? [/code] |
The End.