- Upvotes Received
- 3
- Posts with Upvotes
- 1
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
11 Posted Topics
Generally, type checking in Python is frowned upon. If you really feel like you need to do it, though, there are a couple ways you can do this. You could use the isinstance() function to check the type, and raise an exception if the argument of the correct type. For …
Well, first of all the True and False boolean values already exist in Python. Second, strings are immutable in Python. This means they cannot be changed. You could on the other hand do something like this: [code=python] for i in range(len(someList)): if someList[i].count('0') > someList[i].count('1'): someList[i] = False else: someList[i] …
A simple way to do this would be to try to send or recv information. If the client is no longer connected, you will get a socket.error with the message: [quote] socket.error: [Errno 107] Transport endpoint is not connected [/quote] You can catch this in an except clause to work …
I had been working on this program for a while. It was inspired by the slowness of Windows' search feature. I made it so I could simply look for files to see if/where they existed quickly. I eventually added in the feature to delete files. It was no major extension …
I am looking for some ways to have my Python code access a video stream on ustream and have the program create a user account by entering a username, password, and email address, and then have it then send a message to be entered into the chat. Does anyone know …
Not really, unless it is provided by the OS. In order to do something like this, I would think you would have to have access to the input stream, to monitor it before anything is actually flushed, which Python doesn't really give you.
If you are just programming specifically for Linux, I think using os.system() would satisfy your needs. You would just have to get the string and call the function as such: [code=python]import os url = raw_input('Enter a URL: ') # this would be input() in 3.X os.system('wget ' + url) [/code]
Are you allowed to use strings? If you can, you could get input in the form of a string and cycle through that, comparing each character along the way, and then convert it to a number afterwards (if necessary at all). The only other thing I can think of working …
I believe wxPython is just an applications interface framework. What you want to build websites is HTML, JavaScript, perhaps PHP and other such web-related things. Other approaches for web development would include Django for Python, Ruby on Rails, and AJAX. Ultimately, however, websites are initially created with HTML (and CSS …
[QUOTE=omGac0W;1283356]So this is part of the code in one of my functions, and whenever I enter either yes, no, or something else, no matter what the response the do loop will loop again. I don't think my "if(response == "yes")" is working. Help please? :D [CODE] char response[10]; int answer; …
The End.