4,305 Posted Topics

Member Avatar for c_shaft05

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 …

Member Avatar for Duskic
0
434
Member Avatar for GrimJack

... and here I always thought that the Easter Bunny would lay its own eggs. :)

Member Avatar for Nick Evan
3
57
Member Avatar for serkan sendur

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"?

Member Avatar for ronnieaka
0
1K
Member Avatar for G-Do
Member Avatar for Gael Varoquaux
0
332
Member Avatar for winmic

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.

Member Avatar for phunehehe
0
717
Member Avatar for ana12
Member Avatar for WASDted
-3
60
Member Avatar for BestJewSinceJC
Member Avatar for SgtMe
1
305
Member Avatar for vegaseat

Suddenly I am interested in the tcl scripting language. Does anybody know a good website to learn the rudimentaries.

Member Avatar for gwmorris
0
3K
Member Avatar for vegaseat

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!"

Member Avatar for crunchie
0
858
Member Avatar for cwarn23
Member Avatar for cwarn23
0
123
Member Avatar for ana12

I like a nice medium-rare steak for breakfast. This way I have enough nourishment to fight those dang signature spammers!

Member Avatar for jacktb
-7
335
Member Avatar for Ancient Dragon

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!

Member Avatar for dexter737
0
164
Member Avatar for zortec

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.

Member Avatar for dexter737
0
360
Member Avatar for ana12

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. :)

Member Avatar for dexter737
-5
219
Member Avatar for Hugers
Member Avatar for ana12

[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!

Member Avatar for dexter737
-11
324
Member Avatar for iamthwee

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.

Member Avatar for dexter737
0
200
Member Avatar for The Dude

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.

Member Avatar for dexter737
0
147
Member Avatar for cwarn23

Dateline 2020: "Computer? Isn't that the tiny chip that gets implanted when we are born?

Member Avatar for happygeek
0
155
Member Avatar for Avner .H.

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]

Member Avatar for zaghaghi
0
9K
Member Avatar for vegaseat

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 …

Member Avatar for Gribouillis
0
439
Member Avatar for Prachu

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.

Member Avatar for changtraidoc
0
2K
Member Avatar for Fallen05

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 …

Member Avatar for Fredo699
0
282
Member Avatar for Roadphantom13

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 …

Member Avatar for forsakenedzero
0
5K
Member Avatar for vmars

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

Member Avatar for Stefano Mtangoo
0
398
Member Avatar for cwarn23

"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; …

Member Avatar for efmesch
1
175
Member Avatar for varunrathi

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 …

Member Avatar for richieking
0
920
Member Avatar for mezz80

You really should post this on the Python forum. We geeks in the geeks' lounge do not do other folks homework.

Member Avatar for mjhurdle
-3
310
Member Avatar for sss33

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.

Member Avatar for vegaseat
0
136
Member Avatar for Ultralisk

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 …

Member Avatar for vegaseat
0
2K
Member Avatar for lewashby

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 …

Member Avatar for vegaseat
0
112
Member Avatar for kimmi_baby
Member Avatar for freddypyther

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.

Member Avatar for brandonrunyon
0
987
Member Avatar for ryufire

Once you highlight the text you can use ctrl/c to copy, ctrl/v to paste and ctrl/x to cut.

Member Avatar for vegaseat
0
133
Member Avatar for Sabryan

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 …

Member Avatar for ih8bugz
0
210
Member Avatar for kinniburghc

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 …

Member Avatar for kinniburghc
0
7K
Member Avatar for Tenck

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

Member Avatar for snippsat
0
287
Member Avatar for UaBoy

Python 3.2 is still in alpha release, not at all recommended for beginners!

Member Avatar for vegaseat
0
279
Member Avatar for gunneronaspooky

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 …

Member Avatar for gunneronaspooky
0
133
Member Avatar for radioman28

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 …

Member Avatar for ocmseo
0
668
Member Avatar for Hawkeye Python

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 …

Member Avatar for vegaseat
0
275
Member Avatar for Ancient Dragon
Member Avatar for ll_MORTAL_ll
0
854
Member Avatar for Deeplop

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

Member Avatar for snippsat
0
193
Member Avatar for brown23

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for ﻼim

I am worried about the fact that I just don't worry about anything.

Member Avatar for ﻼim
0
237
Member Avatar for acrocephalus

You could also look here: [url]http://python-forum.org/pythonforum/viewtopic.php?f=4&t=20465[/url]

Member Avatar for vegaseat
-1
489
Member Avatar for D33wakar

[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]

Member Avatar for vegaseat
0
9K
Member Avatar for erogol

[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.

Member Avatar for snippsat
0
145
Member Avatar for smohrchi

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]

Member Avatar for smohrchi
0
152
Member Avatar for rexona

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]

Member Avatar for vegaseat
0
113

The End.