15,175 Topics
| |
Hi, Sorry if this is already asked, but I couldn't find it. I got a text file with 100010101001000010000011111001010 and it is 8bit, now I would like it to decimal. With the int(file,2) function it does not work. I get a very large number. Is there an extra command I … | |
How would you make a simple bar graph from a list of data? [code]data = [20, 15, 10, 7, 5, 4, 3, 2, 1, 1, 0] [/code] | |
Hello, I'd like to get help for a database engine in Python. I know that there are loads of databases out there and I cannot create one which would be even near as good as SQL but I'd like to do it for getting a good understanding of databases and … | |
How do i reach a class from within another class? I have Class A and Class B How can i activate or run class A from Class B? example, if class A and class B work toward the same resource, one create data the other consume data. How can i … | |
Hello my name is Mikal. I am working on some python code, and it is now at the point where it does what I want, but its not quite fast enough for my liking. Here is my current code that works: [code=python] self.timersVS = {'combat':0,'regen':0} ... # Tick Timers and … | |
Hi guys i was wondering how in python you invert this line as I have indicated. I have tried all sorts of mathemtical functions. I am using zelle graphics module. Currnetly I have produced lines going in one direction im trying to produce the same lines again but in the … | |
i have created lines in graphwin but i did it the long way is there a simpler way using loops ? cheers | |
im completely new to python and not particularly experienced with anything that isnt running off of a web server... Im reading 'A byte of Python' and while my first shell script worked, which was just the 'Hello world', but if I create a separate file and have saved it within … | |
I've been writing a Python module which contains a few classes. As I have come to use the module in earnest it has become clear that I need to create a _very_ large number of instances of these classes. This is using more memory than I would like. Speed is … | |
Hi, Below is the snippet from my script which is working fine [CODE=python]if system is 'Conferences': assignedtomatrix[system]['Third'] = 'name'[/CODE] I have to now introduce one more loop checking, but could not find a way to do this. I have tried: [CODE]if system is 'Conferences': person = ['person1', 'person2', 'person3'] community … | |
I'm completely new to Python, just started going through the tutorial at python.org but am getting compile errors in places that should not be errors. I've installed Python version 3.1 on a Windows 7 machine, but I don't see any documented compatability issues. For an example, here's some simple sample … | |
hello, Pls can anybody help me with a folloving exercise? (I must say that I am really beginer in this field, learning by myself and with daniweb (if sb gives me help)) Pompt the user to enter a string of forbidden letters and also to enter a words. Make a … | |
Hi everyone! I would like to make an Air Hockey game in pygame. I was wondering if it was possible to have 'proper' bouncing (ie. the puck goes in a direction relative to the angle the paddle hit it in). I can easily write the rest of the code. Thank … | |
Not sure what I've done wrong here tried lots of alternative combinations and not sure why this logic doesn't work! Im pretty sure it has something to do with the parameter not reading as the results inputted aren't going through the loop. Any help would be appreciated! The idea of … | |
I posted a thread labeled pygame, global name "glob" but am unable to resolve the issue so I was just going to ask a few question about the code. Well first of all, I ran it on Windows Vista, python 2.6 and pygame, but I'M not sure what version of … | |
I have a problem again :) I try to use this code: [code] import time from threading import Thread from threading import Lock def main(): for i in range(3): my_thread = MyThread(i) my_thread.start() class MyThread(Thread): lock = Lock() def __init__(self, i): Thread.__init__(self) self.i = i def run(self): while True: self.lock.acquire() … | |
hi all I'm writing a application which uses Opencv and wxWidgets and sends camera frames via a socket connection. But it seems i'm doing something wrong: after starting a server on my machine, i can't connect my application to the socket the server is listening on...why is that? [CODE=python] import … | |
How do i make this code to store data in a global variable, it create random number of elements. [code] n = random.randint(0, 99) for i in range(1): print "-"*60 print "Here is some new elements! " while n >= 0: data_list = random.randint(0,99) print data_list, time.sleep(.10) n= n-1[/code] | |
I need to have 4 functions which asks the user how many times to flip the coin and then displays the number of heads and the number of tails as a decimal? [code] def getInputs(): times=input("please enter the number of times the coin should be flipped: ") def simulateFlips(): for … | |
I've seen a program called Devcon ([url]http://en.kioskea.net/faq/sujet-1886-enable-disable-a-device-from-the-command-line[/url]) used for enabling and disabling hardware devices. I want to do the same hopefully with python. I want to turn the internet connection off with a script. I can already do it with popen('ipconfig /release') but I want something more robust. Is there … | |
Hi, I am trying to embed python in c++. everything is working fine apart from couple of issue. what exactly i am doing is creating an API for C++ functions in my application to be accessible using python script. When i run a script its runs fine and when i … | |
Hi, I am facing a problem when i am trying to run the django server using python manage.py runserver.The problem is that the server is not starting because it gives the following error: Traceback (most recent call last): File "manage.py", line 12, in <module> execute_manager(settings) File "/usr/local/lib/python2.5/site-packages/django/core/management/__init__.py", line 340, in … | |
Hi All I have installed Python 2.6.2 When I use function of 'import Sybase,' I always received the following error: Traceback (most recent call last): File "export_alpha.py", line 3, in <module> import Sybase, sys ImportError: No module named Sybase Please gevi me your advice how I should correctly to add … | |
Hello, I've been working on this self-made database. What do you think about it? What features should I create for it? I'd also like to get help in a select method, because I don't have the foggiest idea how it could be done. And what about making it a database … | |
Is there someway I can parse badly written HTML code in python? I want to get some info from a web page which uses HTML tables for it's formatting and I found numerous flaws in the code using w3cs validator. can I parse this code in python? | |
Hello all, After googling around for a few hours i can't find any example for passing arguments to an user-defined method in pyqt.. The only link i found related to this is [URL="http://www.commandprompt.com/community/pyqt/x1408"]http://www.commandprompt.com/community/pyqt/x1408[/URL] . In this example we have to make it to emit the signal and pass the argument.. … | |
Hello! I have more questions :) Is it possibe to create a "threadlock", "lock" if you use a file as a common resource? If you have a class that create data and put the data into a file and you have another class that will take data from the same … | |
Hello i have a big problem, i want to import queue but i get this message, somehow it dont exist. Traceback (most recent call last): File "D:\Python26\test.py", line 9, in <module> import queue ImportError: No module named queue isnt that strange. | |
I have created upload script and worked great, but I don't know how do I check the size of the file before upload because I want to limited on 10mb per file... So, mu question is: How do I check the size of the file before upload ? Thanks... | |
I'M reading "Beginning Game Develpment with Python and Pygame". In the following code, I'M gettin this error in sysfont.py [COLOR="Red"]NameError: global name 'glob' is not defined[/COLOR] [CODE]import pygame from pygame.locals import * from sys import exit pygame.init() SCREEN_SIZE = (800, 600) screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32) font = pygame.font.SysFont("arial", 16) … |
The End.