4,305 Posted Topics
Re: I pulled that out of one of my Python snippets. It shows you how to use the for loop in steps of 10. All you need to do is to rewrite the function to convert from Celsius to Fahrenheit ... [code=python]# define/create a function # the indented lines are part … | |
Re: ... and here I always thought that the Easter Bunny would lay its own eggs. :) | |
Re: In 2001 "Star Trek The Motion Picture" brought up a living machine so big that we couldn't fathom it. Then who could forget HAL in "2001 SO"? | |
Re: I will be waiting for that code snippet! Sounds all very interesting to me too! | |
Re: According to: [url]http://www.wxpython.org/docs/api/wx.ListBox-class.html[/url] the listbox does not have a mehod SetMaxSize(). You might as well set the size of the listbox itself as you create the instance. | |
Re: Smimming is fun, everybody should do it! You can do it with your Wii. | |
Re: I was always partial to Benny Hill when his show was on the tele. | |
Suddenly I am interested in the tcl scripting language. Does anybody know a good website to learn the rudimentaries. | |
Here is my contribution ... Two Scotts talking to each other: "This morning I threw my toothbrush away because one bristle fell out!" "Why would you do such a thing?" "It was the last bristle!" | |
Re: I like a nice medium-rare steak for breakfast. This way I have enough nourishment to fight those dang signature spammers! | |
Re: He is really kind of bad at doing this! Sort of unsmart, I was hoping he would hit his toe! It was much better when Gallagher used a watermelon on stage! | |
Re: In the price range you are talking about repairs are bound to come quickly, so stay with something homegrown like a Chevy or Ford where the parts are easier to get and cheaper. | |
Re: Just like Miller Lite, there is now Spam Lite. Turkey Spam is highly recommended and very good for you! I would avoid Signature Spam, that one simply suggs! A day without Spam is like a day without healthy food. :) | |
Re: My advice, get a loan from some rich unsuspecting relative. | |
Re: [QUOTE=Ezzaral;1205199]Hey, if you can't pasta the pasta, then pasta you should just pasta pasta.[/QUOTE]Well said! :) Pasta makes hair grow on your teeth! | |
![]() | Re: Whatever you buy, get a real noisy bike so you can irritate your neighbors a lot!:) I used to ride a motor bike (BMW) in my teenage years, but the only girls I ever got to ride with me were the once with warts and very hairy legs. |
Re: With a large enough antenna you should get a decent current. I would use different diodes though. However, during the day a solar cell would be better. | |
Re: Dateline 2020: "Computer? Isn't that the tiny chip that gets implanted when we are born? | |
Re: Bumsfeld you are right, avoid globals, they do lead to errors. Using a generator function avoids globals ... [code=python]def static_num2(): k = 0 while True: k += 1 yield k static = static_num2().next for i in range(0,10) : print static() [/code] | |
The map() function applies a function to every member of a list. Here a list of numbers 32 to 255 is changed to a list of the corresponding ASCII characters. Then map() is used in a more complex application to combine the two lists to form a dictionary containing number:character … | |
Re: Try something like this ... [code=python]program = "C:\\Python25\\Test\\LH-Sitekit\\sitekit\\engine\\install-nt.bat" # supply the proper input values as strings input1 = 'x' input2 = 'x' input3 = 'z' import subprocess subprocess.call([program, input1, input2, input3]) [/code]Sorry, line one comes out a little goofy. Toggle to plain text to see the correct line. | |
Re: A command like Python.exe Filename.py will do. It is simpler to run it from an editor/IDE like IDLE, see the "Starting Python" sticky right here. On Windows, once you have installed Python, any .py file is associated with Python.exe, so you just double click on the .py file. I don't … | |
Re: You are using 'avg is 1', this is like saying 'avg is True' which is True as long avg is not zero, so you will get the first statement. You have to use 'avg == 1' or better 'avg > 1' ... [code=python]def main(): print"This program will calculate average word … | |
Re: [QUOTE=shirl1;1114752]I did not intend to join an ongoing service - I only wanted to find the answer to ONE question, which I did not get. I am not savvy enough to make us of your Forum. Please unsubscribe me immediately.[/QUOTE] Strange, this is the only posting you did. The reason … | |
Re: "PC Helpline, how may I help you?" "Yes, well, I'm having trouble with WordPerfect." "What sort of trouble?" "Well, I was just typing along, and all of a sudden the words went away." "Went away?" "They disappeared." "Hmm. So what does your screen look like now?" "Nothing." "Nothing?" "It's blank; … | |
Re: The STL has a function next_permutation() which you can apply to a vector. This sample code is written for integers, it is your mission to apply your genius to make it work with characters! Report back your success to this illustrious forum! [code] // permutations of a three digit integer … | |
Re: You really should post this on the Python forum. We geeks in the geeks' lounge do not do other folks homework. | |
Re: Wow, a very nice homework assignment. It will definitely test your Python skills. Once you establish your list for each line, slicing will help you a lot. | |
Re: A temporary test print might shed some light on the workings of the code ... [code]def insertion_sort( lista ): for i in range ( 1, len( lista ) ): save = lista[i] j = i while ( j > 0 and lista[j - 1] > save ): lista[j] = lista[j … | |
Re: The arguments/parameters for the button are [B]wx.Button(parent, id, label, pos, size, style, name)[/B] A number of these arguments have defaults, but [B]parent[/B] has to be specified. It is the frame, panel or other surface where the button will appear on. In your case [B]win[/B] is the parent and is the … | |
Re: Thanks Henri, I just downloaded the latest version too! Looks like a nice improvement! I think I am going to write a short example how to use Boa in the "Starting Python" sticky. | |
Re: Once you highlight the text you can use ctrl/c to copy, ctrl/v to paste and ctrl/x to cut. | |
Re: According to the Alaska Department of Fish and Game, both male and female reindeer grow antlers in the summer, but each year male reindeer drop their antlers at the beginning of winter. Female reindeer retain their antlers till after they give birth in the spring. Therefore, according to every historical … | |
Re: Here is one way to do it ... [code]# with the Tkinter canvas, drawings can only be saved as .ps files # use PIL to draw simultaneuosly to memory and then save to file # PIL allows .png .jpg .gif or .bmp file formats import Tkinter as tk from PIL … | |
Re: First of all Python 3.2 is a alpha release for testing by experts. Use a stable production release like 3.1.2 or even better Python 2.7 | |
Re: Python 3.2 is still in alpha release, not at all recommended for beginners! | |
Re: Asking any user to enter 100 numbers is simply an atrocity. Let's say the user makes a mistake at the 87th number, you have to build in a way to recover without having to start with the first number again, or the nice piece of hardware may end up on … | |
Re: Always a hot topic!!! Which is the best language to learn and otherwise? Start with C, you can write unbelievably bad and undecipherable code with it. There is a huge amount of sample code out there from which to learn, mostly real old stuff with tons of strange looking header … | |
Re: Something like q = 3/5 would signify a division of integers and would give you q = 0 in most computer languages and Python2 Python3 has changed this '/' is now a floating point division and '//' is an integer division. If you want q to be a floating point … | |
Re: This is a C++ program and should be moved to the cplusplus snippets! | |
Re: You have to use module py2exe. This module is a packer that puts your code, all needed modules and the Python interpreter into a self-unpacking .exe file. Use google to find it, it's a free download | |
Re: The only language that has similarities with C++ IMHO is Java. VB.Net has the power of Microsoft behind it and is a well established language. Python is open source and supported by an innovative group of people. It's syntax is easy to learn, but it is a modular language and … | |
Re: I am worried about the fact that I just don't worry about anything. | |
Re: You could also look here: [url]http://python-forum.org/pythonforum/viewtopic.php?f=4&t=20465[/url] | |
Re: [B]winsound.Beep(37,10)[/B] Your frequency of 35 hertz is below the audible range Your duration of 10 milliseconds is too short Try something like ... [B]winsound.Beep(440, 200)[/B] | |
Re: [QUOTE=erogol;1320973]What is the general usage area of python? Maybe I can change my question.[/QUOTE]Python is a high level modern language. It will do anything but the low level stuff. For that you need to glue in some C code. | |
Re: You need to save your code file from the editor of IDLE not the dang Python shell! That Python shell is one of the worst traps for beginners. Do us a favor and take a look at: [url]http://www.daniweb.com/forums/thread20774.html[/url] | |
Re: Correcting your original thought ... [code]a = [] x = 1234 y = str(x) for character in y: a.append(character) print(a) # ['1', '2', '3', '4'] [/code] |
The End.