15,181 Topics

Member Avatar for
Member Avatar for Tcll

I actually have 2 Q's the files I'm working with only provide 4x3 inverse bind matrices for bones. what I first need is a function that writes the 4th row of the matrix and then I need to know PyOpenGL's matrix inversion function (since it's faster than my current function) …

Member Avatar for Tcll
0
30
Member Avatar for Malraux

Hello I have a sequence that looks like this: 60211401dc070000 which is a string (it was build through a series of concatenations and conversions) How can i just tell him that it is actually a hex ?? without modifying it's value... Thanks! Have a nice day

Member Avatar for Lucy Four
0
319
Member Avatar for arunpawar

I am learning regex in php but want to try out how the regex in python works. I have not yet moved to the code side of things and for the same reason, i am searching for the regex examples in both php and python. To start somewhere, i decided …

Member Avatar for TrustyTony
0
213
Member Avatar for Malraux

Hello, I'm trying to represent the system date in a sequence such as: dd mm yy yy So far i got: dd mm yyy so, the year is represented on 2 ytes, but I only have 3 characters, i need to split after the first character and then add a …

Member Avatar for TrustyTony
0
228
Member Avatar for pwolf

i was wondering if this was an efficient way to achieve the objective or not, some advice on the matter is much appreciated. the objective is to define a function to determine the standard achieved by a participant taking a physical fitness test. The standard is determined based on the …

Member Avatar for TrustyTony
0
244
Member Avatar for pwolf

Write the function search(word, substring) that takes in a word and a substring as arguments and returns the position (0 indexed) of the substring if it is found in the word. The function returns -1 if the substring is not found. is there a method to do this? i tried; …

Member Avatar for TrustyTony
0
181
Member Avatar for pwolf

How to return the sum of the last digits of the values in a list? i cant think of an efficient way. If it wasn't for being in a list i could do it, but im really lost. Can anyone advise me? im going to look for a way in …

Member Avatar for pwolf
0
4K
Member Avatar for Lingson

hi, i've tried to search any examples to understand more about how to use the urllib in python 3.1, but all the tutorials are for python 2.x i need to do just a simple thing like getting the text (as string) and manipulate it. the code in python 2.x would …

Member Avatar for Rocketdlib
0
2K
Member Avatar for pwolf

Create a function generateNumbers(num) that takes in a positive number as argument and returns a list of number from 0 to that number inclusive. Note: The function range(5) will return a list of number [0, 1, 2, 3, 4]. Examples [CODE] >>> generateNumber(1) [0, 1] >>> generateNumber(10) [0, 1, 2, …

Member Avatar for TrustyTony
0
2K
Member Avatar for apeiron27

my list looks like this: [(nStart, nEnd, nName),(nStart, nEnd, nName)...and so on] how do i sort first based on nStart, then on nEnd? thanks:)

Member Avatar for TrustyTony
0
58
Member Avatar for pwolf

the objective is to create a function to determine, from the three sides of a triangle, whether it is isosceles or not. I wrote the following code, yet its not very efficient, how could i have done this better? and is there anything wrong with this code? i tested it …

Member Avatar for TrustyTony
0
3K
Member Avatar for Joelx

I need to copy a certain line from a text document, this I have done by using a "key-word" in the document. My problem now is that I also want to copy the entire line below this specific line. Help is much appreciated as I am new with programming FILE …

Member Avatar for Joelx
0
178
Member Avatar for hisan

Hi All, i want to know how to calculate number of sub String available with in a string in python

Member Avatar for snippsat
0
154
Member Avatar for monkl

I am trying to get a program to return a coord that increases or decreases in either X or Y given an input of either X, -X, Y, or -Y. It starts at (0 , 0). When I run it however, it always returns (0 , 0). What am I …

Member Avatar for woooee
0
221
Member Avatar for WolfShield

Hey guys, I actually have two questions here. I've made a splitter window with two panels and set the min size to '200'. But how do I make one panel not be allowed to re-size to larger than '200'? And the second question is: if I wanted to put a …

0
86
Member Avatar for Ismatus3

hello friends , i just need to test the Cx_freeze , i have in a folder /home/user/Bureau/testexe/ two files : Hello.py , its code is : [CODE]#!/usr/bin/python # -*- coding: utf-8 -*- myfile = open('testexe.text','a') print >> myfile, "Hello" myfile.close()[/CODE] and a second file : makeexe.py which contain : [CODE]#makeexe.py …

Member Avatar for telmo96
0
242
Member Avatar for pwolf

""" Write a function to convert temperature from Celsius to Fahrenheit scale. oC to oF Conversion: Multipy by 9, then divide by 5, then add 32. Examples >>> Cel2Fah(28.0) '82.40' >>> Cel2Fah(0.00) '32.00' """ so it says, but i couldn't think of an a way to do so efficiently. But …

Member Avatar for TrustyTony
0
1K
Member Avatar for neti1987

I wrote a program which gets a number n ( > 0) and prints all the numbers with n digits. [CODE] def Q(n, index = 0, list = []): if (index == n): print list return startFrom = 0 if (index == 0 and n > 1): startFrom = 1 …

Member Avatar for woooee
0
4K
Member Avatar for TrustyTony

Inspired by discussion in [url]http://www.daniweb.com/tutorials/tutorial238544.html[/url] (test cases are from there) I used my magic pattern matching function transformed from numbers and adding the parts length checking loop. I like my own solution better, I do not know about you.

Member Avatar for TrustyTony
0
2K
Member Avatar for Sinnocence

( old ) sql = """CREATE TABLE (DATABASE1) ( TEXT_BODY CHAR(20) NOT NULL)""" I would like the above to work like the below. [CODE] sql = """CREATE TABLE ('%s') ( TEXT_BODY CHAR(20) NOT NULL)""" % header [/CODE] ( this produces an error ) Does anyone know how I can make …

Member Avatar for StephNicolaou
0
61
Member Avatar for adrain91

[CODE]import urllib.request import sys #'http://www.imdb.com/list/SuSZdwCyHzU/' def savePage(urll,filename): with urllib.request.urlopen(urll)as url: page=url.read() # print(page) sys.argv[0]=filename outfile=open(sys.argv[0],'w') for line in page: outfile.write(line) outfile.close() savePage('http://www.imdb.com/list/SuSZdwCyHzU/','outIMDB.txt')[/CODE] so here is my code .I try to write the original codes into the 'outIMDB.text' but somehow I got this bug: File "C:\Program Files (x86)\Wing IDE 101 4.0\src\debug\tserver\_sandbox.py", …

Member Avatar for richieking
0
434
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
415
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

The End.