- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 24
- Posts with Upvotes
- 24
- Upvoting Members
- 18
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
| Re: By putting "s = d / t" before the conditionals would only calculate speed - but what happens when you give speed and distance for example? It wouldn't calculate time. You have to put each individual case within the appropriate conditional branch like Lardmeister did. P.S. This kind of program … |
Re: Is there a file in the [I]C:\Python25\Lib\site-packages[/I] folder named [I]mechanize.pth[/I] or a folder named [I]mechanize[/I] in that directory? There should be, and the data in [I]mechanize.pth[/I] should simply say "mechanize" (without the quotes). | |
Re: For Python 2.x: People seem to overlook the usefulness of built-in functions for handling common issues with lists. A lot of times, [ICODE]filter[/ICODE], [ICODE]map[/ICODE], and [ICODE]reduce[/ICODE] can easily and efficiently serve typical purposes that most people attempt without these. Here's an example of their usage (I use lambda expressions in … | |
Re: I don't know if this idea has already been added, but beginners can create an address book. That was the first real project I undertook. Ask the user for: name, address, phone, cell, fax, etc. Then store the data in a .txt file. Let the user search people in the … | |
Re: The variable [icode]timesflipped[/icode] used for the while loop is undefined before the comparison [icode]while timesflipped < 100:[/icode]. This script should just return a NameError and not run. Here's a fixed version: [code=python] import random coin_heads, coin_tails, times_flipped = 0, 0, 0 timesflipped = 0 # <-- here's what I added. … | |
Re: I'd say split the string into a list and use the filter method: [code=python] file_Name1 = 'abc123de' # store that string as a list of characters L1 = list(file_Name1) # call filter on it using a lambda expression L1 = filter(lambda x: x in '1234567890', L1) # L1 now = … | |
Re: [URL="http://www.youtube.com/watch?v=T5hOzLUa2IM"]Under The Oak[/URL] by [URL="http://en.wikipedia.org/wiki/Candlemass"]Candlemass[/URL] :D | |
Re: Hooray! I got pyHook working with Python 2.6 for Windows. I just downloaded the source and edited a few things, hacked it together and built. As far as I know, it all works with 2.6 :D You'd just need to manually install it to your Python's site-packages directory if you … | |
Re: Firefox 3! I just can't stand IE for the issues I get with it when writing stuff for the web. It always happens that IE buggers up something by implementing it in a non-standard way, which [I]always[/I] complicates things. And for this reason, I shall never show it any love … | |
| Re: If you mean by "Python OS", an operating system that's built purely on Python, then no. As far as I know, that wouldn't work anyway because the interpreter to run Python needs an OS to run on in the first place (?). Correct me if I'm wrong though... And I'm … |
Re: Trainspotting One Flew Over the Cuckoo's Nest A Clockwork Orange A Scanner Darkly Fear and Loathing in Las Vegas | |
I'm not sure if this is the best place to post this, but I've noticed a large request for pyHook for Python 2.6. I had a solution to this in a recent thread [URL="http://www.daniweb.com/forums/thread203368.html"]here[/URL], but people are most likely going to miss that. I built pyHook's source for use with … | |
Re: [QUOTE=serkan sendur;913335]if my best friends dont get featured i am going to organize them to leave for a better c# forum where their skills are appreciated.[/QUOTE] I'm not trying to start slinging shit here, but is this a mutual agreement or are you just putting words into your friends' mouths? … | |
Re: First, your whole_thing variable should be [icode]text_file.read()[/icode] if you want to return all the contents as a string. Or [icode]text_file.readlines()[/icode] if you want to return all the contents as a list of each line. Change this and see if that fixes any problems with your code. I don't fully understand … | |
Hello, I was wondering how to go about having a redirect of stdout with Python take effect in a C extension. My python script redirects sys.stdout into a file handle created with [i]open(...)[/i], but within the function in my compiled C-extension, any output ([i]printf[/i], [i]puts[/i], etc) is still given to … | |
Re: @Aia You just strike me as an extremist for your beliefs (Conservative right?). And I hate extremists because they only lead to problems, such as the ones caused by religious fanatics, or by those who are too damn bull-headed to try to even [I]consider[/I] a different viewpoint. You fall into … | |
Hello! I have a question in regards to [I]malloc[/I]/[I]calloc[/I] and [I]free[/I] in C. What I'm unsure about is the "depth" (for lack of a better word) that [I]free[/I] operates to. I know that sounds strange so let this example hopefully explain what I mean: [code=c] #include <stdlib.h> int main () … | |
Re: And before anybody makes a comment about either the shades or the colourful bedsheets in the background, they are my ex girlfriend's, hence the feminine tinge to them. | |
Re: Hello EAnder - welcome to DaniWeb. I myself only got into Python about a year ago, after deciding to give up on Java and C++; luckily I found that Python is fast, easy, and most importantly, fun. Anyways, to get back on topic, I created the basis for a sort … | |
Re: C++ is among the top of the widely used languages for games. It retains the quick execution speed of C, and brings in much needed and required things such as objects and class inheritance ([URL="http://en.wikipedia.org/wiki/Object-oriented_programming"]OOP[/URL]). Naturally, you'd be using graphics libraries with this, such as OpenGL or DirectX. Possibly even … | |
Hello, I know you probably get quite a few threads asking this, but the DaniWeb search didn't pull up what I was looking for. So here we go: I have a page that I've made as "private" by including my access control script at the top. The access control script … | |
| |
Re: Sneekula's correct. You're storing each item in the [I]inComments[/I] like so: [icode](lineNumber, lineText)[/icode]. So you just need to access the correct index of the tuple, the same way you would access an item in a list (or Array in Java); just use the square brackets to get the value from … | |
Re: Python is a good choice for easy-going desktop application development. Of course, you're going to want to get adjusted to and familiarized with classes, methods/functions, etc. before starting on GUI projects. And for GUIs, I'd still really suggest wxPython over Tkinter. I personally can't stand the non-native look of Tk's … | |
Re: [QUOTE=Merlin33069;916033]ive looked around for some tutorials and cant find a lot, really all i need is a 2d environment, laid out kind of like a computer desktop, different functionality in different areas of the screen, maybe some layers for different things[/QUOTE] Sorry, what exactly do you mean by this segment? … | |
Hello, I am currently trying to figure out some event stuff with Javascript. I have the page capturing all [I]onkeypress[/I] events by calling my function [I]keyPress[/I], and passing the event as an argument. The key presses get passed to a text field that I have on the page (even if … | |
Re: It would be nice if you explained the code above rather than just plopping it down on the page. | |
For some reason (this hasn't happened to me in the past), any wxPython scripts I package via py2exe crash on my other Windows computer (lacking a Python install). If I try running it on my other machine, I get an error message telling me to look at a log file … | |
Re: I started reading through an article on gamedev about creating a game engine from scratch; a basic game engine, written in C++ and using SDL for the graphics. It's a start, and I think after being able to successfully understand and create one like in this article, you can attempt … | |
Hello, I've just recently tried to make a class template whose constructor should be able to accept a variable amount of arguments of the class passed to the template. I have something like this, with the prototype inside the class definition, and the actual implementation of the constructor defined outside: … |