- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 12
- Posts with Upvotes
- 11
- Upvoting Members
- 9
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
- PC Specs
- Lenovo IdeaPad Y460 Intel Core i5 M430 2.2GHz 2GB DDR3 RAM ATI HD 5650 Windows 7 Home Premium
182 Posted Topics
Is it possible to store a certain function as a variable? If not, is it okay to make a class, and define a function. Store the class as the variable and invoke that function? | |
Re: you haven't really shown any effort.. what you are asking is really an AI, which is quite complicated. | |
Re: i know this for a long time. lol I think i had something x 10^500 or 10^5000 at one point. | |
Re: [code]0100100100100111011011010010000001110100011011110110111100100000011011000110000101111010011110010010000001110100011011110010000001110100011100100110000101101110011100110110110001100001011101000110010100100000011101000110100001100101011100110110010100101110001000000100110101100001011110010110001001100101001000000111001101101111011011010110010101101111011011100110010100101111011011010111100101110011011001010110110001100110001010000110111001100001011010000010000001110100011011110110111100100000011000100111010101110011011110010010100100100000011100110110100001101111011101010110110001100100001000000110110101100001011010110110010100100000011000010010000001110011011000110111001001101001011100000111010000111111001000000011110101000100[/code] | |
What are some good JavaScript project for beginners? I have a decent understanding of programming itself, I familiarize myself with JavaScript for the past couple of days, but don't exactly know what I can write for it. Any ideas? | |
Re: Why not regex? [CODE] def validateEmail(address): pattern = "[\.\w]{2,}[@]\w+[.]\w+" if re.match(pattern, address): return True else: return False [/CODE] The problem is that it won't detect test.@test.com as a false one. If anyone has an idea. Please suggest it. | |
Re: I did something similar with login into SMF and a bunch of other things. *cough* | |
How come unittest.TestCase doesn't exist for me? [CODE] Traceback (most recent call last): File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 1, in <module> import unittest File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 4, in <module> class CheckStructureAcceptance(unittest.TestCase): AttributeError: 'module' object has no attribute 'TestCase' [/CODE] | |
Re: First. USE CODE tag Second. You can use these functions [icode] setattr()[/icode] [CODE] >>> class Test: pass >>> t = Test() >>> setattr(t, "foo", True) # Equivilent of t.foo = True >>> t.foo True [/CODE] | |
Are there designer + IDE that's kind of like the Visual Studio suite for PyGTK or PyQT? [B]Again, don't clutter up the sticky with questions. Ask question in the regular forum.[/B] | |
Re: if you're just starting, you could also learn by doing the matrix encryption | |
Re: It's worth noting that dictionaries are not the same as multidimensional array. They are similar, however a dictionary is actually a hash table. | |
Re: This sounds like a contest question I did a couple of months ago for practice. (CCC 2010 Problem J5) Maybe you could take a look at my source code and see if you can salvage anything from there. [code] class KnightPosition: def __init__(self, location, prevLocation=False): self.x = location[0] self.y = … | |
Re: pygtk is the easiest to start with, especially with the help of Glade | |
Re: re.split should save the day =D | |
Re: Simplest form: [CODE] import sys def main(args): pass # your stuff here if __name__ == "__main__": main(sys.argv[1:]) [/CODE] | |
Re: try commenting out the try.. except block. Don't use try except unless absolutely necessary, it might hide a bug. Also.. I've said this a million times.. don't hard code your instructions. It just gets tedious later. | |
Re: make it so that it's [icode]self.but2[/icode] in __init__ This way you can access it from other functions of same object. [icode]self.but2.destroy()[/icode] in your destroybut function should work | |
Re: uh. I strongly discourage the use of if-elif-else structure for text commands. I recommend a language parser, I have one written, you can see if that fits you. Link is in my signature. (TAG Engine) | |
| |
Re: [icode]import humanize[/icode]? | |
Re: need timsort, merge sort to complete it. Also Bogosort for luls :P | |
I currently operate 2 access point with the same SSID to spread wifi coverage. They're both protected via WPA2-PSK. One is a router, the other is a windows 7 laptop running Connectify. DNS IP Address for the router is 192.168.0.1 DNS IP Address for Connectify is 192.168.2.1 My android phone … | |
Re: Text adventure game I see. Developing one from scratch is difficult. I have plenty of experience ;) I've written about it: [url]http://thekks.net/916[/url] Also I've created an engine, click the link in my signature. (Wow I feel shameless and dirty. I think I might take a shower...) | |
Re: Sometimes it's appropriate to use XML. You should consider looking at the xml tutorial in Dive Into Python. | |
Re: I already do that in my text game engine. you can check out some earlier code from the repo. the link is in my signature. It's quite simple actually. especially y our format. It's almost identical to the tag engine format. (shameless plug... :p) | |
Re: Yeah you can use the while True loop around your current loop and use continue and break to control the game. | |
I currently have Win7 64bit installed. I know it's possible to install python 32bit, GTK32bit and PyGTK 32bit and use it, but is there a way to get python 64bit, gtk 64 bit, and pygtk64 bit working on 2.6.6 without compiling myself? | |
Does Anyone know how to add context menu in win explorer on [B]files[/B]? And how do they work? Do they call a command and put the full filename after the command as arguments? | |
Re: You need a localization file that stores all the text in an easy to get format. It could be either XML, or you can store it into a dictionary and import the file. | |
This app will execute and exit right after the process is complete. It will log different things using the logging module. For some reason everytime, no matter if the app execution is a success or a failure, it will tell me an error has occred, and see the log file … | |
Re: Try urllib, urllib2. I've done it. All you need is to POST the data via urllib or urllib2 (can't remember which), and use cookiejar to store the cookie. | |
Re: another good book is think python [url]http://thinkpython.com[/url] | |
Re: Lol nice. Although a n x n determinant will be much more impressive anyhow now make it compatible with my matrix class that i quickly written a couple weeks ago :P [CODE] class Matrix(object): def __init__(self, matrix, numcolumn=-1): self.rows = matrix if numcolumn == -1: numcolumn = len(matrix[0]) for row … | |
I'm curious on how would one accomplish event driven programming from a language like python (or other, but for simplicity sake, python will do.). By that I mean providing a system that allow programmer to hook functions to certain events, and fire those events when triggered. (Basically the APIs behind … | |
Re: Are you kidding? Most applications on ubuntu is written in Python. Python is used extensively in teaching computer science. It's used to write plugins and scripts for applications like blender. It's also used very extensively by web companies as a PHP alternative. Standalone applications written in python also has a … | |
I'm currently in HS and is going to be applying to an university in Fall 2011 (Graduate HS in 2012). I like math and computers, and hope to get into this field. I need to choose between CS and CE. I've been told by people (who definitely do not come … | |
Re: split with regex. Could work, maybe slower, more flexible. | |
Re: As Ray Kurzweil puts it, GNR. Genetics, Nanotechnology, and Robotics. Go read his book, The Singularity is near, those summarize it pretty well. | |
Re: For simplicity, try[URL="http://tagengine.sourceforge.net"] text based games[/URL] to get you behind some concepts. | |
Re: Most platforms and third party libraries out there only support Python 2. You should learn Python 2, and keep an eye on Python 3 and its development to make sure you don't fall behind. | |
Re: You need to put [CODE] {"http" : "http://iptoproxy:port"} [/CODE] inside the proxyhandler's argument | |
Re: .sort sorts the list, returns none. sorted() returns a sorted list/object, but doesn't do anything to the list. | |
| |
Currently I'm working on a microblog just to get familiar with PHP MySQL. I have a pretty big problem though. Here's the php code: [code] function get_all_users(){ $query = "SELECT * FROM ".$this->prefix."users"; if ($stmt = $this->prepare($query)){ $stmt->execute(); … | |
Re: reading Byte of Python? That book's not too friendly to new programmer, more friendly for programmers switching from another language. i suggest Think Python, as it's probably the best programming intro book out there (designed for year 1 college!) | |
Re: Please use (code) button import copy def wordReplace (wordText): wordDict = { "hello" : "avast" , "excuse" : "arrr" , "sir,boy,man" : "matey" , "madam" : "proud beauty" ,"officer" : "foul blaggart" , "the" : " th'" , "my": "me" , "your" : "yer" , "is": "be" , "are" : … |
The End.