614 Posted Topics

Member Avatar for dirt14

[QUOTE]Dutch artist Job Koelewijn sure knows how to make an awesome bookcase. Behold his lemniscate bookshelf that represents the infinite power of books and learnin’ [url]http://www.topnewsblog.info/tblog_11136.htm[/url] [/QUOTE] But how would you get to the books on the inside?!?

Member Avatar for chili5
0
105
Member Avatar for codedhands

Just an idea but in the regular expression you look for a string that goes "group:" with a colon while in the text file you have it like "group=" so that could be screwing it up.

Member Avatar for codedhands
0
107
Member Avatar for elvenstruggle

There is a great module called winsound. [code=python] import winsound winsound.PlaySound("soundFile.wav",SND_ASYNC) raw_input() [/code] Just make sure to change the name of the file. FOr more reference check out this page: [url]http://python.active-venture.com/lib/module-winsound.html[/url]

Member Avatar for Ene Uran
0
1K
Member Avatar for woah

Okay, firstly, what are you talking about? Are you using Notepad to save your python files and that is stuffing up? Are you using IDLE and that wont save? Have you got a save box in your program that stuffs it up? Please provide more information, otherwise its hard to …

Member Avatar for mn_kthompson
0
108
Member Avatar for Stefano Mtangoo

This worked for me: [code=python] import wx import wx.media import os class Events(): def __init__(self,player): self.player = player def pauseFile(self,event): self.player.Pause() class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,title = "Media Player") self.panel = wx.Panel(self) self.player = wx.media.MediaCtrl(self.panel) self.functions = Events(self.player) self.load = wx.Button(self.panel,wx.ID_ANY,"Load File") self.load.Bind(wx.EVT_BUTTON,self.loadFile) self.play = wx.Button(self.panel,wx.ID_ANY,"Play") self.play.Bind(wx.EVT_LEFT_DOWN,self.playFile) self.pause = wx.Button(self.panel,wx.ID_ANY,"Pause") …

Member Avatar for Stefano Mtangoo
0
114
Member Avatar for lllllIllIlllI

Hi I have been using classes for quite a while but there is still one concept yet that i havent ever quite understood and that is decorators. I have noticed Gribouillis uses them a lot so in some ways this question is directed at him. I would like to know …

Member Avatar for lllllIllIlllI
0
114
Member Avatar for dseto200

I used a function and that cut down on code needed: [code=python] # Character Development Dungeons and Dragons # pool are the total points that I can use. pool = 30 strength = 0 health = 0 wisdom = 0 dexterity = 0 choice = None def getInt(prompt, maximum, cur): …

Member Avatar for dseto200
0
118
Member Avatar for lllllIllIlllI

Well, Christmas eve and right now is where you find lots of TV shows trying to get into the festive season by doing a Christmas Special. Now some of these can be good... but some, just are not meant to even be christmas specials. I thought it would be good …

0
80
Member Avatar for rajasekhar1242

There are lots of python HTML modules out there and places that teach you loads about HTML with python: [url]http://www.boddie.org.uk/python/HTML.html[/url] [url]http://www.hoboes.com/Mimsy/?ART=128[/url] [url]wiki.python.org/moin/WebProgramming[/url]

Member Avatar for EAnder
0
201
Member Avatar for tutti

Yes, for all versions 2.x-2.6 . Now that is not true when going from python 3.0 down to something like python 2.5 or 2.6 because python 3.0 is structured completley differently to python 2.5 or others. There is no raw_input() there is no print.

Member Avatar for sneekula
0
77
Member Avatar for shr2408

Ah good old SendKeys. I have written whole programs using this. Its a really great module to use. It is really simple but it has one pitfall in my mind. That is that every time that you use it NumLock is disabled. I know that dosent affect some people because …

Member Avatar for shr2408
0
367
Member Avatar for Zetlin

Try open Ctrl+Alt+Del and going to the processes tab. Then look for any processes called "python.exe" or "pythonw.exe" then end all of those. If you have any python windows open they will shut so close everything beforehand. Then once all processes called "python.exe" or "pythonw.exe" have ended it should work. …

Member Avatar for mn_kthompson
0
366
Member Avatar for rockrushali

Could you post the code and perhaps a bit more detail of your problem. What is the input and output at the moment and stuff like that.

Member Avatar for lllllIllIlllI
0
63
Member Avatar for Hrothgar

Normally when you open a file though it will re-write the file, that is if you open it in write mode. So make sure, if you dont want anything wiped that you can either load the file into a string or something, change what you want and then re-write it …

Member Avatar for Stefano Mtangoo
0
175
Member Avatar for dseto200

You could also go: [code=python] import random w1 = ["abacus", "biology", "chemistry", "dog", "elf", "ghost"] for f in range(len(w1)): w = random.choice(w1) w1.remove(w) print w [/code]

Member Avatar for dseto200
0
88
Member Avatar for lllllIllIlllI

Hi, Im making a program that is sortove like a media player... well, it is a media player. Its quite basic at the moment but i have been working on a few features. One of the things it can do is that it can play a video full screen. I …

0
52
Member Avatar for mckillmt

Just wonding, i know a lot of people here will probably not have heard of Panda3D. Me included. Personally i would reccommend talking to the people at the site. Here is a place that has forums that deal with Panda3D, they may be able to offer more help: [url]http://panda3d.org/phpbb2/index.php[/url]

Member Avatar for shadwickman
0
90
Member Avatar for Andrew Wiggin

Ah, your problem is the following. You have put in your raw_input() to open the file e:. The problem with that is that you are asking it to open a full directory, not just a file. I had this same problem instead with writing files. You need to specify an …

Member Avatar for lllllIllIlllI
0
17K
Member Avatar for vasioky
Member Avatar for Stefano Mtangoo
Member Avatar for Stefano Mtangoo
0
171
Member Avatar for gabec94

Just a word of advice about your if in your code. That is statement will almost always execute unless start is equal to zero. The reason is, even though saying OR something else. You cant apply the same operator to each. So you would have to go: [code=python] if start …

Member Avatar for stephendoyle75
0
88
Member Avatar for Damagh25

We wont be able to help you unless you also provide the code for theGraph. Otherwise we are just guessing.

Member Avatar for Damagh25
0
239
Member Avatar for Stefano Mtangoo

I got this problem once. I fixed it my (in windows XP) by opening the task manager and ending any processes of python. I found that some of my previous programs, usually the wxPython ones, were excellent at leaving behind processes especially if they didnt end properly. I find that …

Member Avatar for Stefano Mtangoo
0
128
Member Avatar for jcp200817

Well there are a few ways to do it. Preferably i would use a dictionary but as we cant here is another way: [code=python] import string number = raw_input("Please enter the number:").lower() n_list = list(number) for enu,f in enumerate(number): if f in string.ascii_lowercase: i = string.ascii_lowercase.index(f)+2 i /= 3 if …

Member Avatar for jcp200817
0
451
Member Avatar for lllllIllIlllI

Hi guys, I was making a program yesterday that would send an email using the email modules of python as well as the smtp module. My problem is when i put it into an exe using py2exe and vega's code snippet setup i get some problems. This is the error …

Member Avatar for lllllIllIlllI
0
2K
Member Avatar for lllllIllIlllI

Hi guys, I have a program that lets the user play a sound but i was wanting to know how i could make it so the user could vary the speed in which the sound plays so the sound can play slowly and quickly and normaly as well. Is this …

Member Avatar for lllllIllIlllI
0
3K
Member Avatar for kiddo39

Could you test how many pixels are red? Because a circle will require many more pixels to draw then a line. I know when getting colours i used something like: [code=python] import Image im = image.open("myPic.jpg") for pixel in im.getdata(): #check if it is red [/code]

Member Avatar for vegaseat
0
2K
Member Avatar for lllllIllIlllI

Hi Guys, My setup is as follows, i have a D-Link DI-524 router and four computers. Three of them have windows XP Professional while the other computer has windows XP Home edition. They are all connected to the router. The ones with winows Professional are all wireless while the one …

Member Avatar for hotmatrixx
0
147
Member Avatar for vmars
Member Avatar for jmn0729

if you want to print a variable in the middle of a print statement there are two ways to do it. [code=python] grade = 0 print "Final grade is",grade,"out of 100" [/code] OR [code=python] grade = 0 print "Final grade is %i out of 100" %grade [/code] Hope that helps.

Member Avatar for Gribouillis
0
411
Member Avatar for lllllIllIlllI

Hi guys I am making a program that uses a text control to move messages from one place to another. My program needs to be able to, once the message has been moved, delete what is in the textCtrl. I can go: [code=python] self.textCtrl.SetValue('') [/code] but that leaves me with …

Member Avatar for Freaky_Chris
0
240
Member Avatar for shadwickman

Well python only does one thing at a time so perhaps while the images are being done it dosent do the GUI. A way around this is to use the thread module. Threading is useful if you want two things to be able to happen at once.

Member Avatar for shadwickman
0
145
Member Avatar for pyth0n

You could use list comprehension as well [code=python] binary = raw_input() if False in [f == '0' or f == '1' for f in binary]: print "Not Binary" else: print "Is Binary" [/code]

Member Avatar for Murtan
0
3K
Member Avatar for MaxVK

I think you could also use XML to save it. If you are using wxPython then there is an XML module you can load that makes it nice and easy to load. The module is wx.xrc, it can load a panel, a frame or any other kind of object. Its …

Member Avatar for MaxVK
0
1K
Member Avatar for Stefano Mtangoo

It is used with events in wxPython. If you have a button lets say that when you press it pops up a dialog box. But there is also something else going on and you want the method that makes that dialog box to be called After the event function is …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for dseto200

This is not very hard if you use the random module. [code=python] import random words = ['hello','python','monday','tuesday','friday','ice'] choice = random.choice(words) print "Guess the word!" guess = raw_input() while guess.lower() != choice: print "sorry, not correct" guess = raw_input() print "well dont that was it!" [/code]

Member Avatar for woooee
0
2K
Member Avatar for Darkangelchick
Member Avatar for lllllIllIlllI
0
142
Member Avatar for Darkangelchick

just quickly i wanted to remind Darkangel or the NCSS Challenge rules. Rule 3 stated that: "The solutions you submit must be your own. It is fine to discuss the problems, and to read code in books or on web sites to get ideas, but you must be the author …

Member Avatar for Darkangelchick
0
215
Member Avatar for Stefano Mtangoo
Member Avatar for Stefano Mtangoo
0
72
Member Avatar for lllllIllIlllI

Yesterday, i was programming a program in Java when i came accross something i though was just amazing. I could read and write complete Obects with just one line of code! They would go to a file and when i loaded then they would be straight back, without me having …

Member Avatar for lllllIllIlllI
0
88
Member Avatar for adam291086

If you want to do that to an int and you just want to add it on the end then you could go: [code=python] >>> adam = 123 >>> john = 456 >>> #if you just add them together they don't add on to the end, >>> print adam+john 579 …

Member Avatar for paddy3118
0
93
Member Avatar for rastaberry

Python would be easy to do this in. You could use a mixture of the random module as well as the String module and combining them together to get something that does it for you. In fact i will show you how i would do it if i was making …

Member Avatar for rastaberry
0
88
Member Avatar for Bouzy210

Just take the comma off the end of line 20. Adding the comma makes it a tuple.

Member Avatar for Bouzy210
0
119
Member Avatar for ccandillo

I find functions still a great thing to have if you want to have something unrelated to either class. Personally i like to only have related functions in a class and if i want a function and there is no specific class that it fits into then i do not …

Member Avatar for Stefano Mtangoo
0
143
Member Avatar for tomtetlaw

you can also use eval or exec on the text file if it was like this: [quote] t = 1 variable2 = 10 string = 'hello' [/quote] if you had this in your program [code=python] f = open('variables.txt') for line in f: eval(line) #or exec(line) [/code] That will then set …

Member Avatar for tomtetlaw
0
103
Member Avatar for payne_99

Your problem is that sys.argv is what you supply on the command line after starting the script. So you would go [code=python] python mycode.py arg1 arg2 [/code] For yours to work you need at least 2 arguments for there to be sys.argv[1]

Member Avatar for lllllIllIlllI
0
126
Member Avatar for ccube921

You have a lot of errors your code. First of all let me say that you can really only use self when you are in a class. A lot of your code in your program should be in the __init__ method. Also in you Add method you have return x …

Member Avatar for ccube921
0
121
Member Avatar for Devlan

So you want the user to be able to specify which class to use? Well a way to do that would be to split the string and do some if statements such as: [code=python] i = raw_input() if i.split()[0] == 'add': p = add(i) p.hi [/code] If thats not it …

Member Avatar for Devlan
0
101
Member Avatar for cmharris90

Can you please give us examples of numbers which stuff up the program and the FULL error statement because that will help even more. Also tell us wether you are doing a withdrawal, deposit or something else at that time. Oh and please wrap your code in code tags. I …

Member Avatar for lllllIllIlllI
0
94
Member Avatar for ccandillo

Ah i have had this problem before. I found it really really useful to use Threading. So maybe you could make a function or class that uses Threading and then you can have it wait for user input while the rest of the program goes its own way.

Member Avatar for ccandillo
0
145

The End.