15,175 Topics

Member Avatar for
Member Avatar for Begjinner

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 …

Member Avatar for Begjinner
0
148
Member Avatar for sneekula

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]

Member Avatar for Stefano Mtangoo
0
559
Member Avatar for sandorlev

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 …

Member Avatar for Stefano Mtangoo
0
99
Member Avatar for Godflesh

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 …

Member Avatar for Stefano Mtangoo
0
248
Member Avatar for dynamicman

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 …

Member Avatar for dynamicman
0
115
Member Avatar for charlottetemp

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 …

Member Avatar for charlottetemp
0
122
Member Avatar for DGXI

i have created lines in graphwin but i did it the long way is there a simpler way using loops ? cheers

Member Avatar for vegaseat
0
181
Member Avatar for lifeworks

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 …

Member Avatar for vegaseat
0
124
Member Avatar for twoshots

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 …

Member Avatar for twoshots
0
164
Member Avatar for shrikant.rails

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 …

Member Avatar for shrikant.rails
0
139
Member Avatar for RandV80

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 …

Member Avatar for RandV80
0
7K
Member Avatar for vlady

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 …

Member Avatar for vlady
0
126
Member Avatar for SgtMe

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 …

Member Avatar for SgtMe
0
966
Member Avatar for charlottetemp

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 …

Member Avatar for charlottetemp
0
103
Member Avatar for lewashby

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 …

Member Avatar for vegaseat
0
146
Member Avatar for Godflesh

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() …

Member Avatar for jcao219
0
379
Member Avatar for breakbone

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 …

Member Avatar for breakbone
0
101
Member Avatar for Godflesh

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]

Member Avatar for Godflesh
0
308
Member Avatar for gangster88

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 …

Member Avatar for charlottetemp
0
1K
Member Avatar for Tech B

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 …

Member Avatar for Tech B
0
2K
Member Avatar for subhan222

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 …

0
106
Member Avatar for sandeep.m

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 …

Member Avatar for Pupo
0
842
Member Avatar for Dembi

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 …

Member Avatar for msprayb
0
133
Member Avatar for sandorlev

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 …

0
238
Member Avatar for mahela007

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?

Member Avatar for mahela007
0
93
Member Avatar for explorepython

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.. …

Member Avatar for explorepython
0
1K
Member Avatar for Godflesh

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 …

Member Avatar for Gribouillis
0
97
Member Avatar for Godflesh

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.

Member Avatar for Godflesh
0
16K
Member Avatar for Krstevski

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...

Member Avatar for Krstevski
0
99
Member Avatar for lewashby

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) …

Member Avatar for Firewolf
0
834

The End.