15,190 Topics
![]() | |
Hi peoople, My doubt is: how to make a "process" go to "sub-process" ? (in Ctrl+Alt+del) I know that the response this in "import subprocess", but I can't organize this ideia. I need of a help. Thank you patience :icon_wink: | |
I've got a code fragment: [CODE] #!/usr/bin/env python import sys num_lst = [] num_circ = [] while True: print "Type number or [e]nd operation" inpt = sys.stdin.readline() print inpt if inpt == 'e': sys.stdin.flush() print "\n" break else: num_lst.append(inpt) sys.stdin.flush() for i in num_lst: if isinstance(i, int): num_circ.append(i) else: pass … | |
If I am creating an exception class, along with a stack [CODE]class CustomError(Exception): def __init__(self): self.contents=[] print "Stack Created"[/CODE] How can I make it so that if [CODE]x=CustomError()[/CODE], the stack contents will be [code] x.historical.contents [/code], not [code] x.contents[/code]? | |
Hi people, my doubt is it: How I do to a file if "auto-start" with the "Windows" ? I have this it done already: [CODE] aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE) aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run") aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE) SetValueEx(aKey,"name",0, REG_SZ, r"C:\name.extension") CloseKey(aKey) CloseKey(aReg) [/CODE] Thank you patience :icon_wink: | |
grid = [[0,0,0][0,0,0][0,0,0]] user fills the gird simultaneously. Now I want to make a list of empty squaes of the gird. Suppose user has filled: grid [col1][row1] , grid [col3][row1], grid [col3][row2]. Now I need a list with indexes of the empty list i.e. emptyGrid = [1,2,4,5,7,8,9] First I've to … | |
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 … | |
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. … | |
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] | |
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 … | |
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) … | |
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 | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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, … | |
![]() | 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:) |
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 … | |
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 … | |
Hi All, i want to know how to calculate number of sub String available with in a string in python | |
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 … | |
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 … | |
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 … | |
""" 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 … | |
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 … | |
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. | |
( 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 … | |
[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", … |
The End.