244 Posted Topics

Member Avatar for Skyforger

I'm up for contributing. My experience is mainly Python, but also PHP (+ HTML/CSS/Javascript; you said it was for browsers?) and also Actionscript 2.0 and 3.0, and a tad of C++, but that last one doesn't matter for web stuff. Also, money doesn't bother me - I program for fun

Member Avatar for shadwickman
0
83
Member Avatar for Aiban

I can't help with GUI stuff as I can't use Tkinter, only wxPython. However, if you decided to use [I]os[/I] system calls, you can always use threading to run the os calls in one thread, and use a second to update your GUI. Or like Bumsfeld said, you could go …

Member Avatar for shadwickman
0
111
Member Avatar for serkan sendur

[QUOTE=serkan sendur;927683]but they have something in common...[/QUOTE] Possibly some deeply-rooted Celtic hatred of the Saxons :P And moving out isn't just that easy. I work two jobs but still live at home...

Member Avatar for ~s.o.s~
0
383
Member Avatar for Aiban

I don't use Tkinter as I personally hate it :P But I'm going to assume that the [I]Text[/I] control has a [I]write[/I] function of some kind, just like the wxPython [I]TextCtrl[/I]s. If that's the case, then you redirect the standard output stream so that it uses your Text control as …

Member Avatar for Aiban
0
10K
Member Avatar for Alex!

[QUOTE=zachabesh;926136]Ewwww. Half your variables aren't even defined dude. You can't say: [CODE]def SplashScreen(self): root.title("My Title")[/CODE] What is root? When do you define root?[/QUOTE] If you scrolled to the bottom of the code, after the class definition, you'd see that he defined [I]root[/I] as [I]Tk()[/I] :P

Member Avatar for vegaseat
0
117
Member Avatar for Dixtosa

I have the same issue. When running a wxPython program from the .py file, it uses the Windows XP Luna theme on the widgets. However, when I compile it to an .exe with py2exe, it defaults to the classic theme on the widgets (win 2000, 98, etc). I couldn't find …

Member Avatar for Dixtosa
0
77
Member Avatar for vegaseat

[QUOTE=vegaseat;912274]Maybe I ought to wait till the Google Chrome OS comes out a year later. That one is supposed to be safe from virus attack.[/QUOTE] Ah, but I don't trust Google with my whole OS :P They already know enough about me... (my paranoia is kicking in) And it'll just …

Member Avatar for kaninelupus
0
637
Member Avatar for Aiban

Hello, I look forward to seeing you around :) And as a side note, I'd personally suggest sticking with Python 2.5 or 2.6 for another little while, just because so many third-party modules and such aren't supporting 3.x yet. (Among those important to me is wxPython, an excellent GUI toolkit …

Member Avatar for Clueless86
0
103
Member Avatar for dilbert_here00

You can try substituting your current thread with this custom Thread class which allows only itself to be killed. [code=python] import threading, sys, trace class KThread( threading.Thread ): def __init__( self, category, desc, func, params=() ): threading.Thread.__init__( self ) self.category = category self.desc = desc self.function = func self.params = …

Member Avatar for shadwickman
0
193
Member Avatar for SlvrDragon50

And by the way, you can copy from the Ubuntu terminal via [I]Ctrl+Shift+C[/I], and past into it with [I]Ctrl+Shift+V[/I]. Now you can give us a full traceback, plus you should also provide the code segment which the error is in, and any other info we need to know pertaining to …

Member Avatar for SlvrDragon50
0
141
Member Avatar for bgk111

Yeah, the "\x##" is the format for encoding non-ansi (is that correct?...) characters. As far as I can tell, these are useless characters anyway, because if you pick through the segment: [icode]'\x00A\x00D\x00A\x00M\x00S\x00 \x00C\x00O\x00U\x00N\x00T\x00Y\x00'[/icode] You can see that there are the regular letters "ADAMS COUNTY" in it. So are all these …

Member Avatar for bgk111
0
110
Member Avatar for serkan sendur

[QUOTE=serkan sendur;925279]That is why i respect a blonde cute female c++ developer too much. She could have taken advantage of her beauty instead of ... <snip>[/QUOTE] Let's please not let this thread steer in the creepy direction too. That whole post was completely unnecessary and I really didn't need to …

Member Avatar for shadwickman
0
125
Member Avatar for denniskhor

Do you mean you want to format your output automatically in Python, i.e. wrapping it in appropriate HTML tags? Or just do you mean save whatever comes out of your program into a file with a .html extension? For appending to a file, just open it with append mode, i.e. …

Member Avatar for shadwickman
0
4K
Member Avatar for arinlares

You're going to want to read up on what objects are; the whole [URL="http://en.wikipedia.org/wiki/Object-oriented_programming"]OOP[/URL] thing. You'd be doing something like: [code=python] class Room(object): def __init__(self, description): self.desc = description def showDesc(self): print self.desc myroom = Room('You are standing in a restroom...') otherroom = Room("You are out in a dark hallway...') …

Member Avatar for bumsfeld
0
103
Member Avatar for Morika

You were on the right track. Find the 'del' part, then include backwards until you encounter an underscore; this allows for if the number was single, double, triple, quadruple, etc digits long. [code=python] filename = '/grups.google.com/grup/cmp.lng.pythn/browse_thread/thread/8_ee63e_17del_0c12d' end = filename.find('del') # reverse-find the first underscore in the filename # from the …

Member Avatar for Morika
0
143
Member Avatar for sneekula

Are you talking about having your own host for this or some sort of community-based site?

Member Avatar for zachabesh
0
203
Member Avatar for tomtetlaw

Yes, but are you going to make the user open the second program when they run the game? You can't open a new console window through your main Python script.

Member Avatar for shadwickman
0
133
Member Avatar for Clueless86

Keep the gold amount as a list: [code=python] def goldKeeper(x): a = 200 # if 'x' contains any indices if x: if x[-1] <= a: # store new 'x' value x.append(a) elif x[-1] >= a: print a + x, # if 'x' is a blank list else: print a+x, gold …

Member Avatar for shadwickman
0
315
Member Avatar for pongetti

What does your main [I]package[/I] __init__ file look like? It could be that you're doing something like [icode]from subpackage1 import *[/icode], in which case, the module [I]subpackage1[/I] wouldn't actually be defined. You'd just be dumping everything from its namespace into the main one. Of course, this is just my guess …

Member Avatar for jlm699
0
301
Member Avatar for jephthah

[QUOTE=jephthah;920148]... Super Moderator badge? can i have it?[/QUOTE] You have my vote. I believe the forums would be filled with a lot less of the "i has homework give me code plz" posts.

Member Avatar for shadwickman
0
204
Member Avatar for Zetlin

re.split breaks the string in the specified pattern, removing the parts which caused the split. There is a much simpler solution to this problem though. Just iterate the string by splitting it at each space and compare each word to a list of words you're watching for. You don't need …

Member Avatar for Zetlin
0
259
Member Avatar for flipjoebanana

Well the simplest solution is just to use the style flag wx.TE_PASSWORD when you create the TextCtrl for the password. That automatically makes the output asterisks.

Member Avatar for vegaseat
0
155
Member Avatar for pads_irl

Well your code confuses me. The first instance of [I]j[/I] is in a conditional statement comparing it to the number 7. I don't see it even initialized before that. And the same goes for [I]a[/I]. Oh, and [I]Iteration[/I] - what's the value of that? Maybe post code explaining what those …

Member Avatar for pads_irl
0
94
Member Avatar for The Dude

Wow. He had to tase a pig? What a man... I guess they'll be needing those tasers for the estimated 100,000 Burmese Pythons that are on the loose in Florida though.

Member Avatar for shadwickman
0
77
Member Avatar for rahul8590

I get this error if I run a wxPython program more than one time from within IDLE. For some reason, IDLE buggers it up, which is why I don't develop with it. If you close IDLE and re-open your script and run it once, it should work the first time, …

Member Avatar for shadwickman
0
162
Member Avatar for katamole

jice is right. You're telling it to start at 0 and end at 13, but your step is -1, so it won't work. I think you're a little confused; the [I]-1[/I] does not 'reverse' the operation. It sets the amount it steps by each time... So if I set it …

Member Avatar for sravan953
0
144
Member Avatar for rajasekhar1242

Can you please post a smart question? You included no details about this "python application output" or anything about your program as it is. Then maybe I'll help.

Member Avatar for zachabesh
0
4K
Member Avatar for Rhijaen

Like zachabesh said, you should take a look at the [I][URL="http://docs.python.org/library/shutil.html"]shutil[/URL][/I] module for more file operation functions. And [URL="http://docs.python.org/library/shutil.html#shutil.copytree"]copytree[/URL] may be of particular interest to you too :P

Member Avatar for shadwickman
0
136
Member Avatar for Arrorn

You can execute it using the [I]os[/I] module. In DOS or GNU/Linux, in the command line you can type [icode]python code.py[/icode] to execute a file. So you can try this: [code=python] import os os.system("python othercode.py") [/code] The one problem would be if the user does not have "python" registered as …

Member Avatar for Arrorn
0
109
Member Avatar for Davide Davin

All I could for SVG support for wxPython is [URL="http://code.google.com/p/wxpsvg/"]wxpsvg[/URL]. They don't have any built downloads so you'd need to grab the source from the trunk and build it yourself. Here's where you can browse the source: [URL="http://wxpsvg.googlecode.com/svn/trunk/"]http://wxpsvg.googlecode.com/svn/trunk/[/URL] Hope it helps! [B]EDIT:[/B] The source in the [I]svg[/I] folder looks incomplete, …

Member Avatar for Davide Davin
0
114
Member Avatar for Clueless86

First, you should change the line where you bind the button to: [icode]button.Bind(wx.EVT_BUTTON, self.onClick)[/icode] or else give the button an id (it's the arg passed second in the button's constructor) and then you can use [icode]self.Bind(wx.EVT_BUTTON, self.onClick, id=BTN_ID)[/icode]. The way you're currently doing it, any button's press will call the …

Member Avatar for shadwickman
0
368
Member Avatar for computerfreak

And as a note, you can get rid of all the extra [I]event.type == pygame.KEYDOWN[/I] by using that as one conditional and sticking everything else under it; something like this: [code] if event.type == pygame.KEYDOWN: if event.key == pygame.ESCAPE: os._exit(1) if event.key == pygame.K_LEFT: slide -= 1 # ETC [/code]

Member Avatar for shadwickman
0
198
Member Avatar for scripter_tmrage

Python is my favourite programming language that I've learned [I]by far[/I]. They all have pros and cons of course, which means some are better suited to projects than others. Python has a simple syntax and is easy to get into, but slower to execute as it's highly interpreted. Whereas C …

Member Avatar for wildgoose
0
220
Member Avatar for sravan953

Try looking into [URL="http://en.wikipedia.org/wiki/Windows_service"]MS Windows' services[/URL]. You could set your program as a service and then have it run automatically on start-up. You may need to look into running Python scripts as services; here's an [URL="http://en.wikipedia.org/wiki/Windows_service"]example[/URL].

Member Avatar for zachabesh
0
278
Member Avatar for teonghan

If the variable userinput is waiting for the user to press a key (like Heftiger implied), then you'd need to use threading in order to process waiting for a keystroke and running a continuous loop side-by-side. That being said, yes, you can use conditional testing each time the loop runs, …

Member Avatar for scru
0
2K
Member Avatar for Menster

I'll definitely check it out. Maybe just as a virtual installation with VirtualBox or something, but I'm still curious what it's got to offer.

Member Avatar for rishabhv
0
297
Member Avatar for SpiritGeek

You'll need to use threading to handle this. One thread calls the function which does the subprocess, and the other calls a function which updates the GUI. Something along the lines of: [code=python] # untested! import thread from time import sleep def myFunc(): while True: print 'Hello world!' sleep(1) def …

Member Avatar for SpiritGeek
0
614
Member Avatar for jephthah

Sir, why are you running? Why are you running? Are you doing this for world peace? Are you doing this for women's right? Or for the environment? Or for animals? Or for nuclear arms? They just couldn't believe that somebody would do all that running for no particular reason. Why …

Member Avatar for Godsp3ed
1
124
Member Avatar for clbembry

What specifically can you not get to work about them? If you're just confused in general about how they work, try reading up on the documentation and examples through Google. Here's [URL="http://www.java2s.com/Tutorial/Python/0380__wxPython/Miniframe.htm"]a quick example[/URL], and the [URL="http://www.wxpython.org/docs/api/wx.MiniFrame-class.html"]API documentation[/URL]. If this isn't it, can you better specify what your exact problem …

Member Avatar for lllllIllIlllI
0
265
Member Avatar for lblazer05

Baki is right. Iterate the lines and split them at the equals sign (but strip it properly!), then take the latter index (the right side of the sign). Strip off the leading and trailing whitespace (of each index), and voila. Here's if you wanted to make sure that the left-side …

Member Avatar for Ene Uran
0
141
Member Avatar for nirav99

Why does your main function accept the keyword [icode]void[/icode] as an argument? EDIT: Wow I'm retarded. Please excuse this.

Member Avatar for Tom Gunn
0
147
Member Avatar for lakshay
Member Avatar for shadwickman
0
91
Member Avatar for arnoldrapid

Well, that's a nice statement in your post. I see no question in there whatsoever! So obviously you don't have a problem. It was awful nice of you to tell us what you need, although I don't think anyone here has any interest in pumping out code for you or …

Member Avatar for shadwickman
0
82
Member Avatar for Darkangelchick

In the code block where the movement of the player gets updated and applied, just run a simple check through it for something like this: Get the position that the player [I]would[/I] be at based on the movement they just pressed a key for, and then, if it's allowable, move …

Member Avatar for shadwickman
0
136
Member Avatar for joe82

Just read the file as-is and then write the output with the lines that aren't blank. Here's an example: [code=python] # Read lines as a list fh = open("myfile", "r") lines = fh.readlines() fh.close() # Weed out blank lines with filter lines = filter(lambda x: not x.isspace(), lines) # Write …

Member Avatar for joe82
0
12K
Member Avatar for Arrorn

You need to use the 'self' keyword. So inside the function variable, you'd say [icode]self.f = 5[/icode]. Then when you call printf, you'd say [icode]print(self.f)[/icode]. By not making the variable a property of the class by using 'self', you're just making it in the local scope of the function. And, …

Member Avatar for Arrorn
0
300
Member Avatar for umair125

So... what have you tried so far? You need to [URL="http://www.daniweb.com/forums/announcement8-2.html"]show effort[/URL] as we're not some sort of request forum that just whips up all the code for you. Post what code you have so far, specifics of what you need help with, etc. [i]Then[/i] I'll consider helping you.

Member Avatar for Ancient Dragon
-1
480
Member Avatar for sharat87

Well if you're using Python 2.x there's the [icode]exec[/icode] expression. I don't know if it still exists in Python 3.0, and I wouldn't normally use it, but it's all I can think of in this case. All you have to do is provide a string that's valid Python and it'll …

Member Avatar for shadwickman
0
112
Member Avatar for dinilkarun

Here's an example of how to get the current date and time (as a string) using the datetime module. [code=python] import datetime timestamp = str(datetime.datetime.now()) """result -> '2009-07-08 01:16:25.968000' """ [/code] Hope that helps!

Member Avatar for baki100
0
164
Member Avatar for Jonx

I personally think (as a side note), that he should: [B]a)[/B] Use a relative path so that he can keep the project in one folder and use a hierarchy of folders within that. This allows him to move the project's folder but keep all the paths in the script valid …

Member Avatar for vegaseat
0
2K

The End.