345 Posted Topics

Member Avatar for vskumar19

you want to open the text file in your python program? [url]http://lmgtfy.com/?q=Python+File+IO[/url]

Member Avatar for hondros
0
11K
Member Avatar for leviaeon

I recommend that you place print statements in various places in your code, so that you can find the actual place of the issue. It may not be the function that is not working, it could be one of your if() statements or whatever. Work through your code, so that …

Member Avatar for leviaeon
0
119
Member Avatar for SgtMe

Let's say I have this: [CODE] class main: def add(self): print '1 + 2 = 3' [/CODE] I then want to be able to call the add function again from within itself. Like this (BUT THIS DOESNT WORK!!!) [CODE] class main: def add(self): print '1 + 2 = 3' self.add() …

Member Avatar for SgtMe
0
82
Member Avatar for TomD22

No offence, but you are being slightly stupid :D There should be no difference in window size in either of your attemps. This is because you are calling[CODE]root = Tk()[/CODE]which is what makes the window. You can use stuff like this: [CODE]root = Tk() root.title('hello') root.minsize(100, 100) root.maxsize(400, 400) root.geometry("231x326") …

Member Avatar for SgtMe
0
578
Member Avatar for dilbert_here00
Member Avatar for lmnopt

Are you using 64-bit Python? If so, this is likely to be the issue. Unfortunately, you will need to uninstall all the python modules you have and reinstall them on a 32-bit version of Python. Some modules such as Pygame and PyQt4 do not yet have support for 64-bit Python. …

Member Avatar for lmnopt
0
1K
Member Avatar for pjistaz

It's printing you lose because you are trying to use the module 'random' as a variable. Therefore, no statements in your loop for win checking are excepted, apart from, of course, the else statement, which prints 'You lose'. You need to make a variable for the computers' choice. So this …

Member Avatar for SgtMe
0
101
Member Avatar for jjrrmm

What are you trying to do? What do you need to find out? What does it do? Why should we help you? Why aren't you using code tags? What the hell are you even talking about...

Member Avatar for SgtMe
-2
98
Member Avatar for SgtMe

Hi again. I want to have a file for one of my python programs, that looks something like this: [CODE]<WINDOW> #Window size 640 480 <WINDOW TITLE> App Platform Test <ICON> icon.png[/CODE] I have a function that reads each line of, and uses the data to make a window. What happens …

Member Avatar for snippsat
0
16K
Member Avatar for «¤¦PR☼GRAM¦¤»

Are you allowed to use other modules? If so use pygame. Look at the documentation at pygame.org under key. I'm pretty sure you can set modifier keys.

Member Avatar for Tech B
0
300
Member Avatar for SgtMe

Hi guys! I am in the process of making a game...similar to this one: [url]http://www.miniclip.com/games/nfl-lateral-collateral/en/[/url] I am using the following code to detect key presses: [CODE] pygame.event.pump() key = pygame.key.get_pressed() if key[pygame.K_LEFT]: ... [/CODE] How can I detect if a key is released? I have seen this done with using …

Member Avatar for tbone2sk
0
14K
Member Avatar for ChargrO

Well I'm actually doing some tutorials on Youtube ATM, covering lots of stuff in Tkinter. I did a vid on cascade menus but I didn't cover parent to child. Anyway here is a link to my vids: [url]http://www.youtube.com/pyProgrammer96[/url]

Member Avatar for pythonNerd159
0
167
Member Avatar for smithy40000

Hi. Note for next time: GIVE MORE INFO! You were having an error with the top.config() command. This is backed up by the fact that I took the not working code and changed it to this: [CODE] from Tkinter import * root = Tk() menubar = Menu(root) frame = Frame() …

Member Avatar for SgtMe
-1
213
Member Avatar for bumsfeld
Member Avatar for Alq Veers
1
487
Member Avatar for virtualsaum

You have two problems: 1. Your code is all over the place 2. Your binding everything to the same window. 1. With your class, you should call root = Tk() inside the __init__ function, this also means that root.mainloop() should go at the end of the __init__ function. Also, I …

Member Avatar for SgtMe
0
1K
Member Avatar for Clueless86

I use Netbeans. Its great for organising your projects, and it shows you errors as you type. It can do pretty much any language as well, if you download the plugins (python is a plugin!). Just download the base IDE and get the python plugin.

Member Avatar for Stefano Mtangoo
0
323
Member Avatar for slmsatish

For a menu, just make a new function. Have it print out the choices on screen, including a number, and then the option is chosen by inputing a number. You could use the raw_input() function, but this is rather crude, as it throws errors, if it recieves a value that …

Member Avatar for snippsat
0
198
Member Avatar for Allyw

I have Windows 64-bit on my PC. It's quick, though mostly because my computer's hench. Anyhoo, I just think Win7 is sexy...

Member Avatar for BestJewSinceJC
0
404
Member Avatar for txwooley

oh BTW just got summin to add. I no ur linux and im win7 64-bit but hey... i use: [CODE] import os strng = os.system('dir') #using dir as example - a cmd function print string #show us os.system('pause') #give us time to reeeeeaaaaadddddd. [/CODE] i no ive only done it …

Member Avatar for txwooley
0
110
Member Avatar for SgtMe

Hi all. :) I'm having trouble with pygame, images and transparency. Lets say I have an image...a circle to keep it simple (for example only). What I want is to be able to draw the image, but with only the circle showing (ie. not a white box around it). Oh …

Member Avatar for SgtMe
0
336
Member Avatar for SgtMe

Hi all. :) I'm having trouble with pygame, images and transparency. Lets say I have an image...a circle to keep it simple (for example only). What I want is to be able to draw the image, but with only the circle showing (ie. not a white box around it). Oh …

0
54
Member Avatar for adam4u

well have you started? what code have you got already? what are you stuck on? we wont help you if you get the answers 'no' and 'none' to the first questions. Sorry to be of no help, but it's a rule.

Member Avatar for HiHe
-3
171
Member Avatar for SpyrosMet

Also, you may need header guards. Check out this thread (started by me - when I was more of a noob than I am now...). [url]http://www.daniweb.com/forums/thread238216.html[/url] Hope it helps... Mark

Member Avatar for SgtMe
0
132
Member Avatar for germ

I don't know if this is what your looking for - i just did a quick google! [url]http://www.devshed.com/c/a/Python/Database-Programming-in-Python-Accessing-MySQL/[/url]

Member Avatar for Ene Uran
0
96
Member Avatar for King Dede
Member Avatar for gangster88

If you want to print it out, then it's best to print out how many people got a certain amount of marks before starting the function again. Then you have no way of retrieving the data if you write over it. Also, you need: if finish == no: instead of …

Member Avatar for gangster88
0
84
Member Avatar for SgtMe

Hi everyone! I would like to make an Air Hockey game in pygame. I was wondering if it was possible to have 'proper' bouncing (ie. the puck goes in a direction relative to the angle the paddle hit it in). I can easily write the rest of the code. Thank …

Member Avatar for SgtMe
0
1K
Member Avatar for SgtMe

Hi all. Every now and again I get these Java update messages, which (if I choose to) in stall the latest JRE. In the C:\Program Files\Java folder, I have: One folder named: 'jre6' Several named: 'jre1.60_' and then a number (01, 02, etc.) I presume that the folders 'jre1.60_...' are …

Member Avatar for Laser
0
120
Member Avatar for Noor Ur Rehman

Have you started? If so, can we see your code so far? If not, well don't wait for a reply - start programming now and you might make it. No-one here will help you. It's a rule. [quote] The Queen of DaniWeb: 'We only give homework help to those who …

Member Avatar for SgtMe
-5
83
Member Avatar for SgtMe

Hi all. I'm interested in Java ME, so I downloaded Netbeans with the JDK. Here is the story: 1.) I installed the wrong version of Java JDK 2.) I removed the JDK 3.) Accidentally removed JRE as well :( 4.) JDK data still on system 7.) Downloaded and 'installed' Netbeans …

0
53
Member Avatar for xzero_x

Also, I don't think many people would bother writing a program that does that - they would just learn to write it correctly in the first place. Soooooo obviosuly a homework...

Member Avatar for SgtMe
0
320
Member Avatar for SgtMe

Hi all. I'm using the following tutorials: [url]http://lighthouse3d.com/opengl/glut/[/url] (for GLUT) [url]http://www.3dcodingtutorial.com/[/url] (for GLM (3D models)) I'm using OpenGL with GLUT and GLM to make a 3D game. Seeing as I was a complete noob, my friend challenged me to make a game 'where you can shoot stuff'. Anyhoo, all was …

0
55
Member Avatar for kevinkev

and??? What's the problem... no one here's gonna write it for you...just help you...

Member Avatar for pac-man
-3
80
Member Avatar for Spiderpig085
Member Avatar for zobadof
Member Avatar for zobadof
0
98
Member Avatar for zobadof

What happens? Soz I don't have CodeBlocks + I'm on my DSi. Anyway, you could put: using namespace std; instead of putting: std::cout... all the time. Also, do you need to declare the two void functions at the top, as they have nothing in them, and you declare them later.

Member Avatar for Nick Evan
-1
163
Member Avatar for laelzio.mosca
Member Avatar for rrvs331

well it would need to be over a network, unless you are relying on peoples sense of not looking at their friends card so they can own them. With networking, you need to send messages to the clients telling them what the other players have done, so it doesn't all …

Member Avatar for SgtMe
0
114
Member Avatar for zobadof

I recommend that you start with simple graphics. Head over to this site, and start on the allegro tutorials. [url]http://www.cppgameprogramming.com/cgi/nav.cgi?page=allegbasics[/url] :icon_idea: PS. Double click anywhere on the site to bring up a menu to go onto the next tutorial.

Member Avatar for SgtMe
0
181
Member Avatar for asator
Member Avatar for SgtMe

Now I must explain that I am a noob. I would like to write my own header file, and use the functions from it in a program. When I get Dev-C++ to compile, it says that it is an invalid function, and I need to put that before the main. …

Member Avatar for SgtMe
0
255
Member Avatar for iammfa
Member Avatar for bahr_alhalak

All you need is to have the data stored in variables that can then be written into a text file (saving) and then read from the text file (loading). Check out the tutorials at cplusplus.com. Then have a function that can be called by the user, that writes out a …

Member Avatar for Md. Asaduzzaman
-2
96
Member Avatar for SgtMe

Hi. Firstly, I am a complete noob, and cannot understand complicated answers. OK. I'm making a noobish space game, called Galactic Armageddon. I'm just testing the variables right now (for getting hit by lasers, missiles, etc.). I'm compiling using Dev-C++ and the default compiler. The program is written using the …

0
170
Member Avatar for MedianHansen

Thanks Tom. It worked for me too! I'm a complete noob, and I get loads of errors that I can't understand.

Member Avatar for SgtMe
0
939

The End.