15,190 Topics
![]() | |
Hi... Let's say that we have this: [CODE]somme = raw_input('1 + 1 = ') if somme == 2: print 'Good - Time For Answer: ' else: print 'False - The Right Answer is: 2 -Time For Answer:'[/CODE] So... how can we get the time for writing any things on raw_input() | |
Hi... I want to start with PyQt and I don't from where should I beggin !! I'm using Fedora Linux 14 ! | |
plz see this code [icode] x=raw_input('enter any number :') def adder(d): d=d+1 adder(x) [/icode] in this function when x is passed to function adder ,,is 'x' and 'd' are copy of each other or d is reference of x.. | |
I'm looking for a way to get the first letter of of a string. I already know about the .startswith() but that is for "if" statements I want something like [CODE]print text.startswith() # to give me the left most symbol[/CODE] | |
If I have example code: [CODE]url = "someurl" values = {"username" : USERNAME, "password" : PASSWORD} data = urllib.parse.urlencode(values) req = urllib.request.Request(url, data) urllib.request.urlopen(req)[/CODE] it passes username and password to the url that you request. So I want to post a thread in a forum. When I look at the … | |
Hello, Is it possible to use ctypes for this? I tried a sample code from net but it is not working. [CODE]from ctypes import cdll myDll = ctypes.LoadLibrary('C++dll.dll') mydll.testString()[/CODE] Can u tell me how to load a C++ dll and call the functions from python? | |
I have been trying to learn Django (and Python). I have a form that can have up to [I]n[/I] elements. Each of those elements has 3 parts to it (a TextField, a TagField and a Checkbox). The form init looks like this [CODE] def __init__(self, *args, **kwargs): notesAndTags = kwargs.pop('notesAndTags') … | |
![]() | Hey all, It's been a really really long time since I did any Python programming; upon the launch of the Web Store - I've been interested in developing a basic app myself. So here I am! Anyways, can anyone tell me if its possible to make a Packaged App using … |
How can i make a pyhton calculator that launches on click? Thank You. | |
hi all, im new to python, and i have a problem that needs to be solved. i have the following set: [[5,5,5],[5,5,5,5,5],[]] which needs to end up being: [[5,5,5,5],[],[5,5,5,5]] has anyone got any suggestions? | |
Dear All, I am a total newbie to Python and programming in general. I know I'd find more materials for Python2, but Python3 was a reflected choice. That said, I have gone trough: [URL="http://www.daniweb.com/forums/thread173960-2.html"]http://www.daniweb.com/forums/thread173960-2.html[/URL] and tried to assemble my spell checker, and ended up with the following code: [CODE]#!/usr/bin/python3 # … | |
I have written a client server program in which the server sends a program to the client, and the client executes the received program. In this case it is a line drawing program in OpenGL. The problem is that on running the server and client the whole program i.e. sending … | |
Hello, I recently started writing a small program for reading multiple xls files from one directory. While reading one file like this,works perfectly: [CODE]wb = xlrd.open_workbook("C:\\path\\FileName.xls") sh = wb.sheet_by_index(0)[/CODE] this one doesn't: [CODE]os.chdir("C:\\path") for fileName in os.listdir("."): wb = xlrd.open_workbook(fileName) sh = wb.sheet_by_index(0)[/CODE] I keep getting the same error: [COLOR="Red"]XLRDError: … | |
Hi I want to write some variables into a file to be readable by excel. I used a loop like this to write the calculated "x" variable into the file. It works but the problem is that I get all the numbers in one line. I'm wondering how can I … | |
I have an app that allows my users to pop up a file of any size and look at the top 10 (or more) records, or, offset to any starting point and view a batch of records. I would like to put this app in some sort of Web page, … | |
sorry for the noob question. i'm new to python. i'm trying to learn about classes and def. i created a simple one here called test2.py [CODE]class test: def Test1(T1): T1 = "this is a test"[/CODE] i have another python file, which is the main program called test1.py [CODE]from test2 import … | |
I tried executing a simple line drawing program using exec(). It worked fine. But when I tried to execute the same program by sending it through a tcp/ip network(the server reads the program and sends it to the client which receives it to a variable(b) of string type) and then … | |
hi .. im trying to terminate a process so in python i used os.system("taskkill /IM notepad.exe/T" and os.popen("taskkill /IM notepad.exe /f") neither have worked since the process does close but start up again !! on SOME computers it did work, the process was terminated but on others it did not … | |
hi all......... a1 a2 a3 a4 a5 a6 b1 b2 b3 b4 b5 b6 c1 c2 c3 c4 c5 c6 d1 d2 d3 d4 d5 d6 i want to select a column and i need a output like a1 a4 b1 b4 c1 c4 d1 d4 | |
hai friends i am 5 days old in learning python programming. I know perl for limited usage. I have a doubt regarding getting input in list during run time. is there any other way in python than typing like ["hi","hello"]. why it is not possible to insert value as we … | |
Hi, Is it possible to save the contents of a RichTextCtrl with the formatting? I'm writing a text editor to learn wxpython and when I use the SaveFile method it saves the data as plain text. PrintFile works the same. Doug | |
Hi everyone, I'm working on a website and need some help. I'm really not experienced with this stuff and I'm using wix with some borrowed html snippets. I wanted to use a vectorized image as a background that would scale to fit the browser on any screen as best as … | |
Hello: I am building a UI using Python in Maya, a 3D app. I have a panel in which I want to assign commands to buttons which are created in a loop. The commands have an arg, which is derived from the loop. Using lambda, the button commands all get … | |
I have a string as below [CODE]"i am genie. who are you? we worked together in a hotel called xsis."[/CODE] Normally string like the above is cleaned. Cleaning involves removing whitespaces. Thus the cleaned version of the above string would be [CODE]"iamgenie.whoareyou?weworkedtogetherinahotelcalledxsis."[/CODE] It is divided into kgrams of fixed size. … | |
hi i am a bit of a noob at python but am trying to make a desicsion making game (a bit like zork). i was wondering if anyone knew how i could get the palyer to go to a previouse part of the game without writing it all out again? … | |
While googleing for an answer I came across this thread... [url]http://www.daniweb.com/forums/thread55451.html[/url] ...which is pretty much my question, but I would be doing it in web directories. Would I need to connect with something like urlib2 and then try the os and glob examples. Maybe an example please? :D Thanks. | |
I have string like: 'par1=val1,par2=val2,par3="some text, again some text, again some text",par4="some text",par5=val5' I have to split it to parts like: par1=val1 par2=val2 par3="some text, again some text, again some text" par4="some text" par5=val5' I use this code: [CODE] a = 'par1=val1,par2=val2,par3="some text1, again some text2, again some text3",par4="some text",par5=val5'.split(',') … | |
Hi, this is my first post. I am making my first real text based adventure game in python and I've got an error: unbound method Main() must be called with Game instance as first argument (got nothing instead) But I am no where nere finsihed on the game as of … | |
im trying to create a program that reads a text file and plots the data using matplotlib. however, what i want to do is subdivide the each major y-axis display into 10 smaller segments. ive tried matplotlib.pyplot.yscale but i cant seem to quite get the hang of it. any help … | |
I was just playing around in python trying to get a basic sort of linked list working. I was able to make a simple linked list using an article I read online that looks like this: [CODE] class node: def __init__(self, value = None, next = None): self.value = value … |
The End.