15,190 Topics

Member Avatar for
Member Avatar for pwolf

the scenario is a fitness test and the challenge was to return a string saying either Gold, Silver, Pass or Fail, depending on certain conditions, they were as follows; gold - the candidate scored 4 or more at each station , and had a total of 13 or more points …

Member Avatar for woooee
0
237
Member Avatar for John_Cro

Hello, people I only registered here for this matter (although it is a great forum). I am a ph.d. student and need to investigate eigenvector centrality measure for my homework. I found Phyton code on net and would like to see does it produce the same results as mine, written …

Member Avatar for Gribouillis
0
257
Member Avatar for Gribouillis

This snippet defines a decorator @mixedmethod similar to @classmethod, which allows the method to access the calling instance when it exists. The decorated functions have two implicit arguments [i]self, cls[/i], the former having a None value when there is no instance in the call. Using python's descriptor protocol, the implementation …

Member Avatar for TrustyTony
1
426
Member Avatar for Valex

Please help me! I have to make dictionary in py tkinter and i don't know how to do definition this is my code: from Tkinter import * j=("slo", "ang", "nem") def pretvori(): if(b.get()==j[0] and c.get()==j[1]): slo_v_ang() if(b.get()==j[0] and c.get()==j[2]): slo_v_nem() if(b.get()==j[1] and c.get()==j[0]): ang_v_slo() if(b.get()==j[1] and c.get()==j[2]): ang_v_nem() if(b.get()==j[2] and …

Member Avatar for Valex
0
2K
Member Avatar for debasishgang7

Hi all, I wanna extract a certain link from a web page using python regular expression. The scenario is like this.. The code: blah... ... .... <div class="test" src="[B][url]http://www.test.com/file.ext[/url][/B]" style="top:0px;width:100%;" .... blah blah blah I wanna extract the url "http://www.test.com/file.ext" from the page using python regular expression. Thanks in advance!

Member Avatar for snippsat
0
281
Member Avatar for moroccanplaya

hi created a simple python program that reads the source code of a url and stores into a variable then saves the sourcecode into a file on the computer but the problem that i have that is when python reads the sourcecode it stores it all in one line in …

Member Avatar for moroccanplaya
0
84
Member Avatar for iraj.jelo

hi friends , how to create a popup emoticon widget for a chat client? i found this source : [URL="http://bit.ly/wMZyTQ"]http://bit.ly/wMZyTQ[/URL] , but function reinit() is a bit complicated, can anyoune help me to simplify it? or does anyone have any good idea?

0
64
Member Avatar for iraj.jelo

Hi my friends , i have written a program that in client section in error occures frequntly , i think the error comes from socket function in client . what i have to do? [code] # This is my server code , this code has not problem import asyncore import …

Member Avatar for Gribouillis
0
3K
Member Avatar for apeiron27

[CODE] for i in file: if i == 0: break else: y = i[0] for k in gile: ~~~~ break [/CODE] if i write something like this, which line does the program read after the second break? thanks

Member Avatar for zeroliken
0
82
Member Avatar for telmo96

I'm trying to compile the following pygame code: [CODE]import sys, pygame pygame.init() size = width, height = 320, 240 speed = [2, 2] black = 0, 0, 0 screen = pygame.display.set_mode(size) ball = pygame.image.load("ball.gif") ballrect = ball.get_rect() while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() ballrect = …

0
51
Member Avatar for sun_2588

Hello everyone....... i need to display the html and php page on the tkinter window...is that possible to create a frame or canvas, which work as a php html interpreter.......... to fetch html i can use urllib module, i think... Thanks ....

Member Avatar for sun_2588
0
144
Member Avatar for Cupidvogel

Hi, I was wondering if Perl has a command line interpreter like Python's IDLE, where you can test things readily without having to save them as a program and run them. If not, why? Why is it that Python or Matlab has command line interpreters where you can type 4+3 …

Member Avatar for d5e5
0
310
Member Avatar for draven07

...hello!!!...I need some help in python... ..Im new to Python programming and I need a window form builder that can script it into a python program....can you please give me suggestions.???..I have tried also searching on google but Im afraid the results might not help me well....unlike asking here at …

Member Avatar for vegaseat
0
2K
Member Avatar for pwolf

i finally started having a look at gui yesterday, and tried to do some things with PySide, however i have the following problem; Whats wrong with this code? [CODE] !/usr/bin/python # -*- coding: utf-8 -*- import sys from PySide.QtCore import * from PySide.QtGui import * class Form(QDialog): def __init__(self, parent=None): …

Member Avatar for snippsat
0
297
Member Avatar for Cenchrus

Hey guys, I'm looking for a python library that can. 1. Act as a simple paint editor. 2. calculate top, bottom, left, right most points of a picture I'm trying to make a simple handwriting recognition software based on the number of permutations possible for simple endpoints. Example: psudocode for …

0
121
Member Avatar for Petee.bill

Hi Guys, Can anyone help me redo this, so it'll be a list comprehension instead? def parseAnnotation(annotation): ExonStartAndStop = [] d = annotation.split(',') for i in d: removeparenteses = i[1:-1] numbers = removeparenteses.split('..') ExonStartAndStop.append((int(numbers[0]),int(numbers[1]))) return ExonStartAndStop example usage: print parseAnnotation('(1834..2736)') ---> [(1834, 2736))

Member Avatar for Gribouillis
0
149
Member Avatar for apeiron27

my text file content looks sth like this: -title info~~~~ ~~~~~~~~` ~~~ -tittle info~~~~ `~~~~`` and so on.. the no of line in the info section is not constant. i want to pick the data with the right title and save it in another file i'm guessing i need to …

Member Avatar for ret801
0
62
Member Avatar for vikaram

Hello i made a phonebook script on python. I am quite new and have been only learning for less than a day and i cant get it to save the entered phonenumbers (is resets to default everytime you quit) Please help me with the code please! [CODE]phonebook["test"]=12345678 def searchname(): print …

Member Avatar for vikaram
0
322
Member Avatar for luofeiyu

there is a simple code,which can run locally ,and get three csv file in c:/ #coding:utf-8 import urllib import re import os exchange=['NASDAQ','NYSE','AMEX'] for down in exchange: myfile=open('c:/'+down,'w') url='http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange='+down+'&render=download' file=urllib.urlopen(url).read() myfile.write(file) print 'ok',down myfile.close() i want to upload it onto my google app (i have one google app account)and let …

0
77
Member Avatar for natehome

ive been working on this script as a project, and when i run it and click on the button to sleep(its going to be an rpg game) it loops and sends the command a bunch of times through the function. [CODE] import sys, random, time, pygame from pygame.locals import * …

Member Avatar for ret801
0
258
Member Avatar for sys73r

[CODE]import urllib2 from BeautifulSoup import BeautifulSoup data = urllib2.urlopen('http://www.NotAvalidURL.com').read() soup = BeautifulSoup(data) table = soup("tr", {'class' : 'index_table_in' }) print table[0][/CODE] the result is: <tr id="index_table_12345" class="index_table_in"> <td><a href="/info/12345">string 1</a></td> <td><a href="/info/12345">string 2</a></td> <td><a href="/info/12345">string 3</a></td> <td><a href="/info/12345">string 4</a></td> <!--td></td--> </tr> *the goal is to get only the strings and …

Member Avatar for sys73r
0
24K
Member Avatar for Tcll

just making a thread that will hopefully stick for a while... >_> I just need a little help and need to know a few things before starting on this... the main thing being the need to know how to build a good update system >_> my program will have a …

Member Avatar for Tcll
0
124
Member Avatar for AdampskiB

[CODE]# 619480 import time from random import * def main(): lst = [] result, length = 0, 500000 while result <= 0.50: for i in range(length): lst.append(randint(1, length)) value = randint(1, length) t0 = time.clock() linearSearch(value, lst) result = time.clock() - t0 print("This LINEAR SEARCH took {0:4.2f}seconds with a length …

Member Avatar for AdampskiB
0
156
Member Avatar for TrustyTony

While looking into [URL="http://www.had2know.com/academics/gaussian-prime-factorization-calculator.html?blankone=2&result="]Gaussian primes [/URL]I came to think additional ways to check for is number integer or not, what you think is best way? [CODE]epsilon = 1e-11 def is_integer(n): """ traditional abs, epsilon check for near integer """ return abs(n-round(n)) < epsilon def is_integer2(n): return (float(n)- int(n)).as_integer_ratio()[1] == 1 …

Member Avatar for TrustyTony
0
292
Member Avatar for arunpawar

This is very basic issue with me right now. I don't know how to write a function or class in python. I mean i know the syntax but i don't know how to escape from the indentation while typing on IDLE. For example [CODE]def sum(): var1=10; var2=20; sum=var1+var2; #how to …

Member Avatar for arunpawar
0
359
Member Avatar for Cenchrus

Can someone tell me, step by step, how python interprets this code? [CODE] Numbers = [1,2,3,4,5,6,7,8,9,10] Numbers[8:3:-1] [/CODE] I know that the "-1" is the counting bit of it, and it goes in the negative direction, but I'm lost on everything else... :(

Member Avatar for Cenchrus
0
170
Member Avatar for natehome

can someone please look over this code and see if they can make it run faster. if you make any changes will you comment it so i can see what you did. this is a personal project. thanks you very much [CODE]#Image manipulation library from PIL import Image import datetime, …

Member Avatar for TrustyTony
0
149
Member Avatar for KrazyKitsune

Title says all. I need to make a code that gives the prime factorization of a number and put them in a (this is important) a list.

Member Avatar for TrustyTony
0
178
Member Avatar for Cupidvogel

Hi, I want to iterate over a list, printing each item and subsequently deleting it, so that at the end, the list is empty, while all the numbers are printed out. I have tried two tactics (to me the logic for both is the same, just checked to spot the …

Member Avatar for Cupidvogel
0
88
Member Avatar for wilhelmO

Hello and good afternoon. I'm new to python an Tkinter. My task : a triggered camera writes 12 images every 70 seconds in a specific folder. The newest 12 images should be visible in a frame at 12 labels ( labels are able to display images ? ). I made …

Member Avatar for Gribouillis
0
158

The End.