14,947 Topics

Member Avatar for
Member Avatar for Wumbate

Here's a weird one: I have a Tkinter.Text widget that I import data from with inputText.get(1.0,END) However, later in the program I have the text in an array, but the array has values like: 'u\x00s\x00e\x00r\x00' Is there a way to decode this weird string to a normal string? I think …

Member Avatar for D33wakar
0
89
Member Avatar for moonlite25

I have this code: def rollBox(length, numDivisions, count): Angle = 90/numDivisions if count == 0: return elif numDivisions == 0: rollBox(length, numDivisions, count - 1) else: square(length) turtle.right(Angle) rollBox(length, numDivisions - 1, count) Is there any way to still decrease the 'numDivisions' parameter to zero while still keeping its original …

Member Avatar for TrustyTony
0
75
Member Avatar for novice20

could anyone please help me regarding how to add a newline character to the log file created using logging module. All the output is dumped onto a single line, which makes it unreadable. I s there any way to make the log file legible?

Member Avatar for TrustyTony
0
54
Member Avatar for darkwing

Hi all. I'm writing a simple GUI to display some text and update the text as I receive data from a multicast address. What I have is a Frame, and then a wxScrolledWindow that is using the Frame as its parent window. The scrolled window contains a vertical box sizer …

Member Avatar for darkwing
0
419
Member Avatar for ste_a47

I'd like to implement a functionality in an app of mine, but I don't know how to go about it. What I want is this: I have a model class that uses imagekit to save its images, and I'd like to have the users being able to update the images …

0
82
Member Avatar for MrAlshahawy

Hi all, I want to know the last event in log ; in other words , when I use this code below : [code] telephone.incoming_call() # waits for an incoming call telephone.call_state(handle_call) [/code] it calls the handle_call function when there is (Answering - Missed - Dialing - Ringing) events , …

Member Avatar for MrAlshahawy
0
80
Member Avatar for novice20

I am new to python n developing scripts as a part of my project.I need help regarding HOW THE OUTPUT OF THE SCRIPT CAN BE REDIRECTED TO A TEXT FILE(FOR MAINTAINING ERROR LOG), WHILE ALSO PRINTING IT ON CONSOLE?? Thanks for all the help in advance and I am looking …

Member Avatar for novice20
0
157
Member Avatar for Wumbate

Hi, I have a UI built in Tkinter. The user can type in some inputs and hit "Run" When the "Run" occurs, a program executes that could take 30 seconds or more! The problem is that this blocks the graphics updating. At the beginning, I set a Label to "Running …

Member Avatar for D33wakar
0
29K
Member Avatar for dustbunny000

[CODE]import math import random choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\ 37, 38, 39, 40, 41, 42, 43, 44, 45, …

Member Avatar for TrustyTony
0
76
Member Avatar for bettersaid

helo! can anyone help me in automatically saving files with fixed filename in python? the OUTPUT would be like this: FILE- A01.txt FILE- A02.txt FILE- B01.txt File- B02.txt i was hoping that i could save a file automatically after making some changes in the older version. Thank you, Gene

Member Avatar for bettersaid
0
430
Member Avatar for marcom10

I need to write a mortgage calculator program that will find the amount of a monthly mortgage payment for a loan. [CODE] # Get information from user print 'CALCULATOR FOR MORTGAGE LOANS' loan_str = raw_input ("Amount of loan:") loan = eval(loan_str) years_str = raw_input("Number of years:") years = eval(years_str) rate_str …

Member Avatar for woooee
0
109
Member Avatar for lewashby

Program 1 [CODE]import math class Vectory2(object): def __init__(self, x = 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(cls, P1, P2): return cls( P2[0] - P1[0], P2[1] - P1[1] ) def get_magnitude(self): return math.sqrt(self.x**2 + self.y**2) def normalize(self): …

Member Avatar for snippsat
0
95
Member Avatar for moonlite25

Hi, I am coding a program to make a rolling box function using turtle graphics. The box is supposed to appear to be rolling across a floor to the right like this: [url]http://img194.imageshack.us/img194/2944/rollingbox.png[/url] There are supposed to be three function parameters: length for the length of a side, numDivisions for …

0
44
Member Avatar for dustbunny000

This might be dumb... but I'm having problems raising e to a negative number and I can't figure out what is going on. [CODE]>>> math.exp(((-23*(23-1))/730)) 0.36787944117144233 >>> math.exp(-506/730) 0.36787944117144233 >>> math.exp(-.69) 0.5015760690660556 >>> math.exp(-(506/730)) 1.0[/CODE] For some reason I keep getting different answers when they should all be the same... …

Member Avatar for dustbunny000
0
82
Member Avatar for lewashby

[CODE]import math class Vector2(object): def __init__(self, x = 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(P1, P2): return Vector2(P2[0] - P1[0], P2[1] - P1[1]) def get_magnitude(self): return math.sqrt(self.x**2 + self.y**2) def normalize(self): magnitude = self.get_magnitude() self.x /= …

Member Avatar for lewashby
0
108
Member Avatar for dragonflame17

I wrote this program for a class, the only problem is that it returns the anwser for assessmentValue twice. I can't figure out what to do to fix it...please help!! [code=php] def main(): #Get the actual value for the property. actualValue = input ("Enter the actual value of the property:$") …

Member Avatar for TrustyTony
0
105
Member Avatar for Monster Killer

Hello. I was wondering if there was a way to use python to convert a video to flash and add controls online. Like youtube, a user uploads a video and it gets converted and controls get added. I have looked online and everyone says "Use this extension blah blah blah" …

Member Avatar for Monster Killer
0
117
Member Avatar for mamdooh26

Hi every one I am facing a problem in deleting items from a list <<< Could any help me !!! [CODE]b=['a', 'b', 'r', 'g'] for c in b: b.remove(c) [/CODE] but when I check b the result is ['b', 'g'] how can I delet all items using for loop thanks

Member Avatar for cghtkh
0
82
Member Avatar for kumar_k

Hi, I want to convert a string to numbers ... i tried a lot of codes.. iam a beginner... Kindly help... Ex: a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 input value -->abc output value --> 123 input value -->abcj output value -->12310 I mean i want to …

Member Avatar for kumar_k
0
88
Member Avatar for ←Guybrush→

Ahoy Sailors! So I'm making a Python built application with the Twisted engine, Where size is a slight issue, Currently compiled under Python26 using Py2Exe, The file stands at 1.8MB (With trimmings), Now my script should work using Python 2.4 which also should decrease the file size considerably, However the …

0
49
Member Avatar for WildBamaBoy

I'm attempting to write a game server and I need it to continue on with the code while listening for a connection. I know this is done with the threading module but I don't know how exactly to do this. Python documentation didn't work for me. [CODE] #[LISTENER] print "Initializing …

Member Avatar for lrh9
0
173
Member Avatar for emorjon2

hi there! i'm have a biiig trouble. I've make a simple chatbot, as can learning. The problem is, that I can't insert data into the dictionary without a error. here is the code: [CODE] codes = {} def arraycompare(array1, array2): l = 0 for i in array1: for j in …

Member Avatar for griswolf
0
132
Member Avatar for Synthuir

So I'm writing a bit of code for use in an IRC bot. I tried to use scheduler to get around the barbaric-ness of calling time.sleep() every time I want the bot to delay for a few seconds. In scheduler you can choose the delay function "for example time.sleep()"-- but …

Member Avatar for lllllIllIlllI
0
233
Member Avatar for aspro648

I really must have a general misunderstanding of import and global. I'm trying to call a function in an imported file and reference a variable. file1.py [code] from file2 import * x = 6 file2Funct() [/code] file2.py [code] def file2Function(): print x [/code] executing file1 give the following error at …

Member Avatar for woooee
0
185
Member Avatar for Sky Choi

I'm trying to make program using Google 5gram data to compare with one of English exam called TOEIC. There are 118 files for 4grams and each size of 4grams are approximately 300MB and each files has 10,000,000 lines. So, here is the point. It requires about 4 or 5 seconds …

Member Avatar for TrustyTony
0
626
Member Avatar for cbowen12345

I am using python code to transmit data collected (Wii Nunchuck) via I2C wirelessly to another wireless node and then display the information about button press and also roll, yaw and pitch (X,Y,Z) data. The code uses Wx python for frame/window display. Part of the code was copied from the …

Member Avatar for snippsat
0
107
Member Avatar for MrAlshahawy

Hi all, How can we load contact thumbnail ?? I want to fetch it and preview it on canvas . thanks in advance.

0
95
Member Avatar for cleve23

Hi all, What tool can i use or what ways can i deploy to allow me to combine c# with python or vice-versa. Please let me know of any tools or way which you all had done it before because i had serch quite alot but i still cannot make …

Member Avatar for snippsat
0
397
Member Avatar for Naynah

I'm stuck on the fifth stage of my assignment, the question is; 'Add in code to the key-press event handler so that the 'person' is constrained to move within the array and cant' walk through a wall.' I'm not sure how i'm supposed to update the curindex, i really need …

Member Avatar for TrustyTony
0
210
Member Avatar for freddypyther

Hi! I've searching for python IDE's and I've not found anything like NetBeans for java. I downloaded Dr Python but was too simple, I tried to install PyDev on Eclipse but I got some errors. I saw some screenshots about SPE and I said whoa! that seems good, but I …

Member Avatar for brandonrunyon
0
981

The End.