15,185 Topics

Member Avatar for
Member Avatar for Luxifour

Hey everyone, How would you go about creating a loop for taking user input without knowing beforehand exactly how many times it will run - as I can't seem to work out how to generate a unique name each time. So, for instance, say you want to take user input …

Member Avatar for Luxifour
0
186
Member Avatar for roshurwill

Hi everyone, recentley new to programming and the language python. So ive learned an amount of python, i decided to start a projct. My project is to make a game, which the user plays using only commands, like walk foward, open the door etc, you are in the bedroom... whatever. …

Member Avatar for woooee
0
509
Member Avatar for moroccanplaya

hi i got a a Tkinter text widget and a string i want to know how to display the string in the text widget ?? [CODE] abc = "hello world" text = Text(app, width=80,height=40, wrap='none').grid(row=2, column=2) [/CODE]

Member Avatar for bumsfeld
0
221
Member Avatar for suravi99

Dear Sir, I want to import PyTango library but it gives this error,please help me >>> import PyTango Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\PyTango\__init__.py", line 90, in <module> raise ie ImportError: DLL load failed: The specified module could not be found. my platform …

Member Avatar for woooee
0
172
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
182
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
243
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
424
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

The End.