1,175 Posted Topics

Member Avatar for zachabesh

Tkinter's 'command=' accepts a function reference not a function call, so you have to use a callback arrangement to pass arguments: [code=python]# Tkinter example showing several ways for command to pass an argument import Tkinter as tk # use a closure def closure_callback(val): def closure(): root.title(val) return closure def change_title(val): …

Member Avatar for zachabesh
0
116
Member Avatar for steven woodman

A little black hole wouldn't be the end of the whole galaxy, just Earth or maybe our solar system. Remember our galaxy has already a rather large black hole near its center. Actually, the little black hole thing came up during a BBC interview of 7 year old school children.

Member Avatar for GrimJack
0
192
Member Avatar for alberttruism

A nice project! Welcome to the small group of DaniWeb Pythonoreans and Pythealots here.

Member Avatar for sneekula
0
325
Member Avatar for ~s.o.s~

--- Lazy, Useless & Apathetic --- I don't think so! Keep up the good works ~S.O.S~, and may the Almighty bless you!

Member Avatar for sneekula
3
427
Member Avatar for Alex Edwards

[QUOTE=Lardmeister;686750]Mine have been answered too by the same organization. Great for doing homework. May the Superior Omnipresent Being bless them with all force![/QUOTE]Superior Omnipresent Being? SOB may be an unrighteous remark.

Member Avatar for sneekula
0
185
Member Avatar for Ene Uran

I have some guys in my science class that look a lot worse than those chimps!

Member Avatar for sneekula
1
73
Member Avatar for Dave Sinkula
Member Avatar for sneekula
3
300
Member Avatar for Ene Uran

[QUOTE=GrimJack;685141]Why do you guys keep posting the entire scam here - especially right after I pointed this thread to scambusters. Do think it gets more interesting after the 10,000th time we see it?[/QUOTE]This thread is more or less for people on DaniWeb that have been exposed to scams. Is there …

Member Avatar for Lardmeister
0
161
Member Avatar for tomtetlaw

Just some errors you need to correct: [code=python]# put the prompt string inside the function's () choice = raw_input("Look around or go back to the field(look or field)") # don't forget the : to start the statement block if choice == "look": print "You find a fishing spear and some …

Member Avatar for tomtetlaw
0
64
Member Avatar for PalomoBlanco
Member Avatar for CostaRica

You may want to contact (PM) user evstevemd, who has a similar problem. See what he figured out so far.

Member Avatar for sneekula
0
88
Member Avatar for jimjag

Actually your problem was that you called loadImages() before assigning some meaningful value to the direction: [code] self.direction = "RIGHT" # "" self.loadImages() [/code]

Member Avatar for sneekula
0
163
Member Avatar for jonce

[QUOTE=jonce;683146]hi im now startin a degree in computer science and i hav 2 complete a disatation... programming is not my strongest point so i have decided to do a research based project... can any help me with some idears on what to do???[/QUOTE]A few English courses would help. Then you …

Member Avatar for jwenting
0
55
Member Avatar for lumeniel

Mixing tabs and spaces will give you very troublesome indentations. I recommend to stick with spaces only, since not everyone's tab settings are the same. Somewhere in your program you have to get a value for image_name before you call your function.

Member Avatar for lumeniel
0
729
Member Avatar for The Dude
Member Avatar for GrimJack

Looks like you might just have to laugh at some of the silly stuff the present Republican Administration is doing.

Member Avatar for GrimJack
0
180
Member Avatar for Ancient Dragon

Time to put the death penalty on evil-minded hackers! In my mind they are nothing but terrorists, out there to do the most damage they can.

Member Avatar for R0bb0b
0
139
Member Avatar for Dave Sinkula

[QUOTE=Aia;544157]Wrong conclusion. I don't watch regular TV channels for a couple years in a row. My plasma TV is just for Xbox and Wii. If I am going to waste time, at least I want to do it in my own terms. ;)[/QUOTE]No wonder you are so smart! Watching regular …

Member Avatar for GrimJack
0
610
Member Avatar for leegeorg07

Actually the module shelve works better with dictionaries: [code=python]# save and retrieve data via a shelve byte stream file # creates a 'persistent to file' dictionary import shelve phonebook = { 'Andrew Parson': 8806336, 'Emily Everett': 6784346, 'Peter Power': 7658344, 'Lewis Lame': 1122345 } # dictionary data will be in …

Member Avatar for Gribouillis
0
148
Member Avatar for Ene Uran

God bless you! You made the 1000 post milestone despite all the bad marks that jwenting gave you early on!

Member Avatar for mackone
2
108
Member Avatar for baba786

Don't forget Danieb's very own "Starting Python" at: [url]http://www.daniweb.com/forums/thread20774.html[/url] You can find some helpful talk, code samples and hints.

Member Avatar for sneekula
0
283
Member Avatar for kushyer

Just remember that py2exe brings in some Dynamic Link Libraries (DLL) that are unique to the Windows OS. You might be better off putting PortablePython onto a cheap USB flash drive.

Member Avatar for sneekula
0
108
Member Avatar for ssharish2005

[QUOTE=leegeorg07;677719]nothing against zetlins first reply but he did just copy that from the tutorial from [URL="http://www.sthurlow.com/python/"]here[/URL][/QUOTE]He should have given some credit to the original source. Reminds me of a quote from Albert Einstein: [QUOTE][B][COLOR="Green"]Plagiarism is stealing from one source. Research is stealing from many sources[/COLOR][/B].[/QUOTE]

Member Avatar for sneekula
0
510
Member Avatar for lllllIllIlllI

I tried gpy2exe and it simply does not work with programs that use Tkinter or PIL.

Member Avatar for lllllIllIlllI
0
903
Member Avatar for Lardmeister
Member Avatar for The Dude
Member Avatar for ZZucker
0
147
Member Avatar for Salem

Oh the pain of "gorilla arm", looks like the medical profession will rake in the money more than ever. Microsoft has to copy someone elses idea, this time it's the iPhone?

Member Avatar for sneekula
0
129
Member Avatar for Stefano Mtangoo

A program called Boa Constructor is wxDev-CPP's couterpart for Python programming. It uses wxPython and has a drag and drop frame builder. See the post at: [url]http://www.daniweb.com/forums/post400296-107.html[/url]

Member Avatar for ZZucker
0
135
Member Avatar for leegeorg07

Add the line number1 = number2 = number3 = number4 = number5 = number6 = 0 right below the line counter = counter +1 This way your line 64 does not mix up the possible answers and Python knows about all the variables used in that line.

Member Avatar for Ene Uran
0
122
Member Avatar for ZZucker

[QUOTE=~s.o.s~;667431]De-generated all the way. ;-)[/QUOTE]Generation D was not in the list.

Member Avatar for R0bb0b
0
305
Member Avatar for magicMan123

Interesting problems, but you got to show us some code of your own attempts at this!

Member Avatar for slate
0
187
Member Avatar for Jadellll

Spelling a string in reverse the old fashioned way is always a good exercise in any computer language. Here is an example in C language: [code=c]// spell a text string forward and backward #include <stdio.h> int main(void) { char text[80]; int k; strcpy(text, "Spell this string forward then backward"); printf("String …

Member Avatar for Aia
0
140
Member Avatar for Salem

[QUOTE=R0bb0b;666148]Speaking of taxes, check this out. [URL="http://www.ananova.com/news/story/sm_2935937.html"]http://www.ananova.com/news/story/sm_2935937.html[/URL][/QUOTE]Great idea! Hope the Holy Father (the Pope) is reading this! He sure could use the savings to do good and holy things.

Member Avatar for sneekula
0
155
Member Avatar for vmanes
Member Avatar for bumsfeld
3
1K
Member Avatar for Jadellll

There is a code snippet that vegaseat left at: [url]http://www.daniweb.com/code/snippet452.html[/url] He talks a little bit about the history of Python's sort() algorithm and calls it an adaptive mergesort algorithm. Very highly optimized, very fast and very stable, it is part of the interpreter core written in C. You would have …

Member Avatar for sneekula
0
108
Member Avatar for sneekula

Hallelujah! I made it past the first 1000 posts! This calls for a celebration this evening.

Member Avatar for sittas87
0
52
Member Avatar for flaco

[QUOTE=Lardmeister;666040]Depression is caused by an imbalance of brain chemicals, not by the environment. There are billions of people on this earth that live in much worse circumstances than you, and yet they are not depressed and don't think of suicide. Sometimes you can be treated with drugs to help you …

Member Avatar for steven woodman
0
674
Member Avatar for bigjonah

As quoted by Dennis Ritchie: "UNIX is simple. But It just needs a genius to understand its simplicity."

Member Avatar for sittas87
0
123
Member Avatar for iamoldest

Something like this will do: [code=python]#! usr/bin/env python import pygame from pygame.locals import * pygame.font.init pygame.init() screen = pygame.display.set_mode((150, 150)) pygame.display.set_caption('Help') pygame.mouse.set_visible(0) pygame.display.init() lives = 3 def main(): global lives font = pygame.font.Font(None, 36) s = "Lives =" + str(lives) text = font.render(s, 1, (250, 250, 250)) screen.blit(text, (0, 0)) …

Member Avatar for sneekula
0
2K
Member Avatar for your uptime

You can also simply visit [url]http://www.acne.org/[/url] and get tons of help.

Member Avatar for sneekula
0
45
Member Avatar for eibwen
Member Avatar for Aia

[QUOTE=Dave Sinkula;632010]There are [URL="http://www.americanthinker.com/2008/06/return_of_the_dupes_and_the_an.html"]other terms[/URL], but for simplicity (much like lumping me in with neocons or such) popular generalizations are sometimes used. And, opinions vary.[/QUOTE]Why do you always link to some outlandish blogger? Don't you have a mind of your own?

Member Avatar for Aia
0
761
Member Avatar for nuaris

Most of the DOS commands you are familiar with are contained in these two modules: [code]import os os.chdir(path) change directory to the one in path os.curdir return current directory os.chmod(path, mode) change the mode of path to the new mode os.getcwd() return the current working directory os.mkdir(path[, mode]) create a …

Member Avatar for BearofNH
0
201
Member Avatar for Briz

Interesting project, but you have to give us a lot more information. Does the robot use Python internally, or does it just communicate via a data port? What does the data stream look like?

Member Avatar for sneekula
0
70
Member Avatar for Matt Tacular
Member Avatar for mchen10
0
474
Member Avatar for devstudio.2007

If you have Windows, download the MS installer version of pygame for Python24 from: [url]http://www.pygame.org/ftp/pygame-1.8.0.win32-py2.4.msi[/url]

Member Avatar for Ene Uran
0
122
Member Avatar for 2ashwinkulkarni

Please learn how to use code tags around your code, nobody will read the ugly mess you are presenting otherwise.

Member Avatar for 2ashwinkulkarni
0
120
Member Avatar for db_ozbecool

Local variables are kept in the function's local dictionary which you can access with vars(). To access one function's local dictionary in another function, you have to pass it along: [code=python]def my_func(aaa, main_var): mvar = [key for key, val in main_var.items() if val==aaa][0] print aaa, main_var, mvar # 123 {'test_var': …

Member Avatar for ZZucker
0
313
Member Avatar for linkrulesx10

You can create a relatively safe numeric input with a function: [code=python]def get_num(prompt="Enter a number: "): """ the function will loop until a number has been entered, accepts int or float, returns a float """ while True: try: return float(raw_input(prompt)) except ValueError: print "Numeric value required!" print get_num() print get_num("Enter …

Member Avatar for linkrulesx10
0
5K
Member Avatar for cheesedoodle
Member Avatar for vegaseat
0
133

The End.