15,190 Topics

Member Avatar for
Member Avatar for d.devendran

hi expert, i'm newbie for python, anywhere i'm learning from internet sample, i got doubt here, i found below sample for thread import threading def hello(): print "Hello" t = threading.Timer(2, hello).start() t = threading.Timer(2, hello) t.start() this working fine when run manually ( python thread.py) but i try to …

Member Avatar for jcao219
0
158
Member Avatar for Ntsoaki

Hi i am new at python,i am getting problem in the above code,the problem reads as follows: Having several accounts on several servers, one has to remember many passwords. You can imagine a situation where someone forgets one of them and he or she only remembers that it consisted of …

-1
332
Member Avatar for ultimatebuster

The directory layout looks like this [CODE] base -- + parcer -- + parcer.py log -- + log.py [/CODE] I want to import log.py from parcer.py. How would I do that?

Member Avatar for TrustyTony
0
95
Member Avatar for cyon

Can someone help me resolve the following error or point me in the right direction? An incomplete value is returned if ' is in the list value. Thanks for any help. [CODE] def FindName(self,name,list1): """ searches for a patten in the list, returns the complete list entry. Is case sensitive. …

Member Avatar for d5e5
0
160
Member Avatar for amadain

Hi Folks I have the following code in one of my classes along with checks when the code does not eval: [code]filterParam="self.recipientMSISDN==tmpBPSS.split('_')[3].split('#')[0] and self.recipientIMSI==tmpBPSS.split('_')[3].split('#')[1]" if eval(filterParam): print "Evalled" else: print "Not Evalled\nfilterParam\n'%s'\ntmpBPSS\n'%s'\nself.recipientMSISDN\n'%s'\nself.recipientIMSI\n'%s'" % (filterParam, tmpBPSS, self.recipientMSISDN, self.recipientIMSI)[/code] I am not getting anything to 'eval'. Here are the results: [code] Not …

Member Avatar for TrustyTony
0
79
Member Avatar for olofom

I'm writing a slideshow program with Tkinter, but I don't know how to go to the next image without binding a key. [CODE=python]import os, sys import Tkinter import Image, ImageTk import time root = Tkinter.Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, h)) root.focus_set() root.bind("<Escape>", lambda e: e.widget.quit()) …

Member Avatar for olofom
0
307
Member Avatar for DayneD89

I'm fairly sure this will be my second thread to make me facepalm when I realise what I've missed, but oh well. If I have a list, for example L=[0,1,2,3,4], can I take the values out so that, again for example, t1 = 0, t2=1, etc.? The easy way would …

Member Avatar for vegaseat
0
154
Member Avatar for camigirl4k3

the program I had looks like this: def wordToNumber(word): if word == "one": return 1 elif word == "two": return 2 elif word == "three": return 3 elif word == "four": return 4 elif word == "five": return 5 elif word == "six": return 6 elif word == "seven": return …

Member Avatar for TrustyTony
0
130
Member Avatar for lmn_k

Hi all. I'm taking a beginner python course and have an assignment to write code using a 'for loop' + 'named variable' + 'branching logic' Trouble is, I have no idea what 'branching logic' is - if anyone has the time to respond, I'd really appreciate it!

Member Avatar for lmn_k
0
102
Member Avatar for jaferic

Hi, i am currently developing a standalone aplication in python, i am very new in this language so i don't know much of it... I need your help, i need to know a way to communicate python and AS3 so i can move the animations with some data that comes …

Member Avatar for jaferic
0
183
Member Avatar for johnnyd1986

I need to know what the command is for setting a specific set of decimal places in an answer, somewhat like the PHP number_format command. Here is what I got coming up in my answer.... 0.7893948 I need it so it says: .789 Anyone have an idea of what the …

Member Avatar for snippsat
0
168
Member Avatar for HiHe

I am using Python 3.1.2 What is the best way to get numeric (float or int) user input?

Member Avatar for TrustyTony
0
4K
Member Avatar for player1977

Hi all. I'm a newbie here so excuse my question if it's a bit dumb. I'm a C programmer but needed to do some text file stripping so was told Pythin would be good for this. I have been messing about with this for about a week now and have …

Member Avatar for TrustyTony
0
84
Member Avatar for thepond

I am learning Python 3 I have several pieces of code that compares dates. The problem is I don't understand how to read a date from a text file and then use it in my code so I can compare it with todays date. I get errors like - int …

Member Avatar for TrustyTony
0
109
Member Avatar for ultimatebuster

I know I can accomplish this with Regex, however, being not familiar with RegEX (yet to find a good howto/reference), I was wondering if there's other simple ways to parce XML files, or if there's a tutorial for regex somewhere For example, I want to get the Hello World! from …

Member Avatar for ultimatebuster
0
196
Member Avatar for Archenemie

This one has got me completely, i cant see why the notebook doesnt show, i wanted the gui interface i have already built to show on page 2 of the notebook, but for some wierd reason the page just comes up empty, and it is really baffeling me. Can anyone …

Member Avatar for Archenemie
0
285
Member Avatar for narfman0

Hello all, I am trying to automate my builds so that when I commit a branch with a particular url to my svn repository, my python script (which runs twice daily) will pick up on it, do a build, and upload it to a new trac downloads page. Right now …

Member Avatar for narfman0
0
179
Member Avatar for dbphydb

Hi, I am basically from QA. What we testers do each day is 1. Open a web browser. Type in [url]http://hostname:8080/cruisecontrol[/url] (since we are in a particular network, only we can access this) 2. Check if the latest nightly build has been successful. If it is successful, deploy it on …

Member Avatar for TrustyTony
0
83
Member Avatar for daviddoria

I am trying to parse the content of a wiki page. In a string like this: [code] ==Heading1== <test> some text here </test> ==Heading2== <test> even more text </test> [/code] I need to obtain "Heading1", "some text here", "Heading2" and "even more text". I got this to work: [code] import …

Member Avatar for daviddoria
0
15K
Member Avatar for DayneD89

OK, I'm new to python. I'm writing data to a file, but it won't write that data to a new line. I'm ending up with a single line file that reads as [QUOTE]2.0/n3.0/n2.0/n3.0/n2.0/n3.0/n2.0/n3.0/n2.0/n3.0/n2.0/n3.0/n2.0/n3.0/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[2.0, 2.0]/n[3.0, 3.0]/n[/QUOTE] When …

Member Avatar for DayneD89
0
5K
Member Avatar for freakn_style

[U][B]Explanation on why program must maintain simplicity:[/B][/U]I am a peer tutor of a computer programming class and my teacher has asked me to develop a few simple games to teach the class. This is the first year the school has taught Python (thanks to my final project last semester, and …

Member Avatar for freakn_style
0
1K
Member Avatar for notuserfriendly

Hello, i am currently writing an assembler for the theoretical SIC/xe machine and i decided to do it in python. Very new to python but i thought it would be fund to do it in and willing to learn. So far i know what to do and have the diea …

Member Avatar for woooee
0
505
Member Avatar for Ntsoaki

[code] import sys import random sys.setrecursionlimit(1500) def prime(n): """ Generate all prime numbers less than n. """ yield 2 primes = [] for m in range(3,n,2): if all(m%p for p in primes): primes.append(m) yield m n=int(raw_input()) i=0 j=0 while(n!=-1): p=list(prime(n)) sun=0 while(sun!=n and i<1000000000000000000000000000000): F=random.sample(p,4) sun=sum(F) i+=1 if(sun==n): for i …

Member Avatar for TrustyTony
0
140
Member Avatar for Ntsoaki

Hi i am new in python,i have just got a question below A friend of yours has just bought a new computer. Until now, the most powerful computer he had ever used was a pocket calculator. Now, looking at his new computer, he is a bit disappointed, because he liked …

Member Avatar for TrustyTony
0
288
Member Avatar for JJBallanger

I have recently been given quite a complex piece of work to do by my computer science supervisor. The idea is that the function:- [def shape_resistivity(shape,R):] allows the user to input a shape and resistance value like so: [CODE] [shape=[\ ' ', '++++', 'xxxx', 'xxxx', 'xxxx', '----', ' '] [/CODE] …

Member Avatar for JJBallanger
0
625
Member Avatar for Arfarf

Howdy! I'm trying to get my head around some simple pattern matching or regular expressions using python. Basically I want to be able to match "Failed 0.00/100.00", where 0.00 could be any decimal number. I know using perl it would be something along the lines of "\d+\.\d+\/100\.0", but could anybody …

Member Avatar for Arfarf
0
119
Member Avatar for peppermints

So I'm trying to get it to update the score by 30 each time a fly is hit. I've tried this a number of ways, but none of them seem to be working. Here is my code (I've commented out some unneeded things so I didn't have to upload so …

Member Avatar for vegaseat
0
1K
Member Avatar for carpenoctem

Haha, still not getting the hang of this, I am afraid. I have written a script: [CODE]#!/usr/bin/env python print ("Hello, world!") name = input("What is your name? ") print ("Hello, " + name + "!")[/CODE] I have saved it as hello.py. And I try to make it executable in terminal: …

Member Avatar for vegaseat
0
311
Member Avatar for DancingDana

Hello, I've got this directory with files that contain a number in their file name. I need to check what the number is and then I need to move the file to a different directory. Right now I'm using shutil to do this, but for some reason it copies the …

Member Avatar for DancingDana
0
221
Member Avatar for sarfrazashfaq

Hi there I am translating PERL code into PYTHON Code My PERL code is if ( my $client = $dealing_clients->{ $data->{fundId} } ) And i translated it into python as if (client = dealing_clients[data["fundId"]]): But it is giving my following Error "Syntax Error While detecting Tuple" Any one know how …

Member Avatar for sarfrazashfaq
0
691

The End.