1,175 Posted Topics

Member Avatar for danizzil14

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, …

Member Avatar for Ene Uran
0
219
Member Avatar for sneekula

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.

Member Avatar for vegaseat
0
2K
Member Avatar for sneekula

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?

Member Avatar for sneekula
0
5K
Member Avatar for k8lj

Nice program! I ran it and for factorial 13 I got 1932053504 when it should be 6227020800.

Member Avatar for iamthwee
0
107
Member Avatar for sneekula

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?

Member Avatar for vegaseat
0
148
Member Avatar for sneekula

I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation?

Member Avatar for bumsfeld
0
131
Member Avatar for sneekula

Which Graphics User Interface (GUI) would you recommend for a beginner? I have seen some examples of Tkinter, wxPython and GTK.

Member Avatar for vegaseat
0
435
Member Avatar for sneekula

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': …

Member Avatar for sneekula
0
194
Member Avatar for Matt Tacular

Sounds like hard program to play around with. You could really do some damage to files in your hard drive!

Member Avatar for sneekula
0
160
Member Avatar for sneekula

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.

Member Avatar for fireworks-style
0
189
Member Avatar for Mouche

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?

Member Avatar for vegaseat
0
10K
Member Avatar for sneekula

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 …

Member Avatar for Mouche
0
122
Member Avatar for mattyd

Look what can happen if you spend a lot of time on DaniWeb! The government will probably legislate a warning sticker soon!

Member Avatar for mattyd
0
76
Member Avatar for pachjo
Member Avatar for pachjo
0
190
Member Avatar for sneekula

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?

Member Avatar for jbennet
0
232
Member Avatar for sneekula

Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321.

Member Avatar for ghostdog74
0
466
Member Avatar for macca1111

I think I will stay away from using "class" until I learn how to use OOP at least rudimentary.

Member Avatar for macca1111
0
318
Member Avatar for sneekula

What is the most efficient way to spell a string in reverse, for instance s = "banana".

Member Avatar for Mouche
0
126
Member Avatar for sneekula

If I have an integer like x = 12345, how do I separate that into individual integers 1, 2, 3, 4, 5?

Member Avatar for sneekula
0
122
Member Avatar for macca1111

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 # …

Member Avatar for Ene Uran
0
83
Member Avatar for Mouche

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 …

Member Avatar for vegaseat
0
137
Member Avatar for sneekula

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.

Member Avatar for jrcagle
0
143
Member Avatar for sneekula
Member Avatar for vegaseat
0
275
Member Avatar for sneekula

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, …

Member Avatar for sneekula
0
111
Member Avatar for sneekula

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]

Member Avatar for sneekula
0
95

The End.