761 Posted Topics
Re: [QUOTE=dinilkarun;723850]Hi all, How can I split a Progress Bar(wx guage) into two parts?. I want the first part to function normally and in the second part I want to display the percentage. I have attached a snap shot of what I am trying to achieve. Is this possible? Any help … | |
Re: [QUOTE=tyincali;723312]In windows I use notepad++. I've tried that ecplise plugin (the name escapes me) and I liked that also. In *nix, its always vim for me though.[/QUOTE] +1 verbatim | |
Re: Wrap your code in code tags: [noparse][code=python] # Code here [/code][/noparse] | |
Re: [code=python] import wx dir(wx) [/code] Will give you all the attributes, functions, etc. of wx. And if you use the re module or a custom search you can filter out everything that starts with ID_ There's also the [url=http://docs.wxwidgets.org/stable/wx_stdevtid.html#stdevtid]documentation[/url] I don't understand your second question... | |
Re: [QUOTE=tyincali;724739]So, looking at your translation, would you agree with me when I say this code is broken?[/QUOTE] This code isn't broken it's a recursive function | |
Re: When you post code please wrap it in code tags. [noparse][code=python] # Your code here [/code][/noparse] If you want to attach another sheet to response you need to open response as the workbook. You're simply opening an arbitrary workbook here without reference to anything. | |
Re: [QUOTE=shadwickman;723355]Sorry, I don't understand you. What are you trying to say about Python 2.5? It's what I use, even though Python 2.6 is out now (or the early releases for 3.0).[/QUOTE] I believe his question was in regards to the OP. He was asking why he is still using 2.4 … | |
Re: What errors are you getting and where? I've used this in the past for splitting a Status Bar and writing text to the last section (ie [ Index 0 | Index 1 | Index 2 ] ): [code=python] self.sb = self.CreateStatusBar(3) self.sb.SetStatusWidths([-2, -1, 150]) self.SetStatusText('My Text', 2) [/code] SetStatusText is … | |
Re: Yes, you would need to import turtle. Here's a good place to start: [url=http://www.python.org/doc/2.5.2/lib/module-turtle.html]docs[/url]. And an excerpt from that site: [quote="Turtle Docs"]Because [turtle] uses Tkinter for the underlying graphics, it needs a version of python installed with Tk support.[/quote] So make sure you've got a more recent version of python. … | |
Re: [QUOTE=tyincali;723467]Which version of python are you using?[/QUOTE] This is irrelevant. I've never used Vista, but I've heard of other people on this forum complaining about it... I think I remember something about right-clicking the file and choosing "Run as Administrator"... or something similar. Maybe you can see if that is … | |
Re: Wrap code in code tags: [noparse][code=python] # Code here [/code][/noparse] Also, read the forum rules about homework, and about asking questions in general. | |
Re: It helps when you tell us what "doesn't work". Do you get an error, does your computer light on fire, what? | |
Re: Save it to a text file: [code=python] f = open('my_file.txt', 'w') # f.write( '%s\n%s\n' % ( usr_name, usr_number ) ) f.close() [/code] | |
Re: Wrap your code in code tags. It will make it readable for us and it won't lose the indentation. [noparse][code=python] # Code here [/code][/noparse] | |
Re: Explain what you mean by "scans a program". Do you mean communicate with a running program ? Or scan a text file? | |
Re: Refer to this [url=http://www.daniweb.com/code/snippet401.html]post[/url] | |
Re: You can look into [url=http://people.csail.mit.edu/hubert/pyaudio/]pyAudio[/url] HTH | |
Re: I think that when trying to run a python program you should be doing [code=python] os.execv( 'C:\\Python24\\python.exe', 'C:\\Python24\\development\\radar\\nra.py') [/code] ie, you're not actually executing the program, you're executing Python and asking it to interpret your script nra.py HTH | |
Re: If CenterOnParent is centering on the screen that means your dialog isn't being called with the proper parent. You probably have None set for this value when calling the dialog. Double-check your code to make sure you're providing the object with the proper arguments on initialization. HTH | |
Re: Look into [url=http://pyxlreader.sourceforge.net/]pyXLreader[/url]. There are plenty of tutorials and example code on the Googles | |
Re: When you post code it helps the other forum members out if it is readable. In order to make it readable and not lose the indentation and structure, you must wrap your code in code tags like so: [noparse][code=python] # Code goes in here! [/code][/noparse] On initial inspection I see … | |
Re: It's called [url=http://undefined.org/python/py2app.html]py2app[/url] | |
Re: [QUOTE=paulthom12345;715773] [code=python] if prompt == "look around" or prompt == "look": [/code][/QUOTE] Another solution for this problem that will help if you had a third option would be this: [code=python] if prompt in [ 'look around', 'look', 'observe', 'admire' ]: [/code] So if you use the [icode]in[/icode] keyword, it'll match … | |
Re: Yes, studying Python 3.0 or an earlier version (apart from 2.6) will not really make much difference to you. The fundamental changes are really hidden in the advanced features mostly (besides integer division and class creation I believe). If you start with 2.5, you'll still have all the basics and … | |
Re: Perhaps use subprocess to make a system call to [icode]./PythonXX/pythonw.exe <path_to_pygame_program>[/icode]; there's been a number of threads on here about using subprocess to open pipes to perform certain actions. | |
Re: [code=python]fraction1 = float(fraction) * 2 fraction1 = str(fraction1) binfrac1 = fraction1[0] if "1" in binfrac1: fraction1 = float(fraction1) fraction1 - 1 binfrac1 = str(binfrac1)[/code] This logic is flawed. All you're doing is doubling the "fraction" portion of the number, and checking to see if the first number is a 1, … | |
Re: You can't necessarily "add additional keys to existing values", unless you simply meant add additional key/value pairs to the existing dictionary. Here's some examples of adding elements to a dictionary: [code=python] >>> d = {'a':1, 'b':2, 'c':3} >>> d['d'] = 4 >>> d['a'] = [ d['a'], 12, 13 ] >>> … | |
Re: Look through the Demo for those two functions. These each make the respective element. | |
Re: The Dive Into Python book has a great explanation/tutorial/exercises for the re module. NOTE: It appears that diveintopython.org/ is down ?! I don't know what's going on over there but Google will help you find copies of the book elsewhere, if you're so inclined. | |
Re: And don't forget about help() [code=python] >>> help( input ) Help on built-in function input in module __builtin__: input(...) input([prompt]) -> value Equivalent to eval(raw_input(prompt)). >>> [/code] You can use that on most any function to get info on usage, and a short explanation | |
Re: If you make a list of the file names, then use a Throbber and initialize it with the list of filenames, then you can simply set the value of the throbber to the index of the image (this is really easy if it's simply a steady increment of indices. | |
Re: While you don't need to specifically declare variables, you still need to make sure that you've got them in the correct scope. So first thing I notice is that your function us trying to read from data; however data doesn't exist in your function, only in the part that calls … | |
Re: [QUOTE=Gribouillis;713043]companies which use python, from the Nasa to Google.[/QUOTE] Don't forget IBM ;) | |
Re: Please use code tags [noparse][code=python] *Your code goes between these tags [/code][/noparse] Infinite loop= [icode]while True:[/icode] Put the things you want to repeat inside the loop. Initialization goes before the loop. | |
Re: [QUOTE=Gribouillis;713723] (if the path to your file is [icode]C:\aTest\HelloMP1.py[/icode], because \ is the character used by python to escape characters in litteral string, so "\a" does not mean backslash followed by a, but the character whith hexadecimal code \x07. If you want to write a backslash followed by a, you … | |
Re: Also system calls would work: [code=python] import os os.system('chmod 755 /usr/myfile')[/code] | |
Re: [QUOTE=evstevemd;711342]That is: s = "---> Increased" print "Today's stock price: %f %s" % (50.4625, s)[/QUOTE] You got it ;) | |
Re: [QUOTE=dittmarw;709461]I think what you're trying to do is: for item in metlist: data1[2].append(item) To see what you did won't work, try typing data1[2]. It gives you ['Met by']..thus there is only one element, and nothing at position 1.[/QUOTE] While I agree with you that he should be using append instead … | |
Re: you need to use the file handle and not the loaded object when you dump. You should just reopen the file for reading or writing and not worry about a+. [code=python] #User Access for Password.py import cPickle as p import sys my_file = 'systemaccess.txt' file_handle = open( my_file, 'r' ) … | |
Re: [code=python] temp = p.load('systemaccess.txt') [/code] | |
Re: you could just as easily do [icode]s = 'c:\\test.doc'[/icode] | |
Re: you could also do a hard sleep: [code=python] import time time.sleep(1) # 1 second delay in processing[/code] | |
Re: Look [url=http://wiki.python.org/moin/TkInter]here[/url] and follow the instructions under the section titled, "Checking your Tkinter support". That should help you out. | |
Re: Perhaps [url=http://groups.google.com/group/comp.lang.python/browse_frm/thread/f2cb83e948326ff5/d69feabbfc940b01?q=uri.nix&rnum=2&pli=1]this thread[/url] will answer your question Oh and P.S.; [icode]command = "OK" + os.linesep[/icode] is a platform independent way to implement that... | |
Re: Also, have you tried [icode]self.SetAutoLayout(True)[/icode]? | |
Re: I don't know if there's a specific function to do it, but you could do a simple for loop like: [code=python] >>> l = 'hi;your,face.is;on,fire' >>> for c in [';',',','.']: ... l = l.replace( c, '_' ) ... >>> l 'hi_your_face_is_on_fire' >>> [/code] Or roll your own little function ie, … | |
Re: What didn't work about str(row)? What kind of error did you get? The only thing I can think of is that you didn't add any line endings? [code=python] >>> import os >>> os.linesep '\r\n'[/code] This depends on the type of system you're on. [icode]\r\n[/icode] is Windows, [icode]\n[/icode] is Linux, and … | |
Re: So... where's your code? Where are your errors? Please read the posting guidelines, and get to know them. If you follow the posting guidelines we can actually help you. | |
Re: If you look at the top right-hand side of the page you will find this white box contained in a larger green box. It's called a search box and it's very useful... Also, vegaseat gave us all a very nice example of using fancy text and the like in the … | |
Re: Description from the [url=http://www.vpython.org/]vpython homepage[/url]: [QUOTE] [B]VPython is a package that includes:[/B] [LIST] [*]the Python programming language [*]the IDLE interactive development environment [*]"Visual", a Python module that offers real-time 3D output, and is easily usable by novice programmers [*]"Numeric", a Python module for fast processing of arrays [/LIST] [B]VPython is … |
The End.