15,190 Topics
![]() | |
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 … | |
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 … | |
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? | |
![]() | 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. … |
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 … | |
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()) … | |
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 … | |
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 … | |
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! | |
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 … | |
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 … | |
I am using Python 3.1.2 What is the best way to get numeric (float or int) user input? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
[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 … | |
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 … | |
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] … | |
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 … | |
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 … | |
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: … | |
![]() | 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 … ![]() |
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 … |
The End.