15,181 Topics
| |
Im pretty new to Python (2.7) and no programming experience before. Anyway Im in the process of learning python but have a mysterious error that I can't figure out. Whenever I put equal sign in print statement, I get syntax error. here's an example code [CODE]def main(): f = open('lines.txt') … | |
from random import randint correct = 0 for i in range(10): n1 = randint(1,10) n2 = randint(1,10) prod = n1 * n2 ans = input('What's %d * %d? ' % (n1,n2)) if ans == prod: print('That's Right! Well done.') correct = correct + 1 else: print('No, I'm afraid the answer … | |
hi friends, can u help me? | |
Hi, I am a beginner in linux . i am using matchbox virtual keyboard for an application now i want to change the layout to another langauge . How to do it? Is there any way to change the layout from terminal . Kindly advice me suggestions. Any help appreciated … | |
Hi everyone! I'm a newbie here. I have a problem: I need to create the address book in python that include name, phone number, email, address, etc...The information in the address book can able to delete or change. I will give more information later! Can you help me? I need … | |
Hello, I'm trying to call a Python module in Java application using JEPP. I'm able to invoke the python modules from java Appl, but i'm not able to call the modules in python class from java appl. Python Code Code: [code] class SampleClass: def [b]callPythonModule[/b](self): print 'The Python Class module … | |
[B][I][U]Introduction[/U][/I][/B] Hey guys today I am writing a tutorial on Lists and tuples in Python.... So lets get started... [B][I][U] Layout:- [/U][/I][/B] 1.What are data sturctures? 2.What are tuples? 3.What are lists? 4.inbuilt functions on lists and tupples [B][I][I][U] What are Data structure?[/U][/I][/I][/B] Anybody familiar with programming or Actually Computers. … | |
Is there any tutorial for Ironpython and Winform out there that's good? A book that's free would be nice. Also if it involves sharpdevelop it would be pretty kickass. | |
I read a lot of car classes on several sites and still can't get mine to work. Any ideas? [CODE]##Car class class Car: def __init__(self, y_model, make, speed): self.y_model = y_model self.make = make self.speed = speed def set_year_model(self, y_model): self.y_model = y_model def set_make(self, make): self.make = make def … | |
Hi! I have used the os.walk function to traverse the many files in the directory. Now the problem is that it is listing same words from different files as different keys. How should I go about it? | |
Hello! I have designed a dialog with a grid widget. I would like to populate it with data from a MySQL table which has 10396 rows and 5 columns, as the grid widget. How can I do it? Then, how can I select a row from the grid widget and … | |
When realising the following operation: [CODE]do = 1.0 - 2.718281828**(-(23**2)/730) print do[/CODE] Python returns 0.632120558766 When you do it on the calculator or when google it, it returns 0.515509538 :-O | |
Hello! I have created a control using the TimeCtrl widget using this code to insert an hour in a 24h format using the HH:MM format [CODE]self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', format = 'HHMM', fmt24hr = True)[/CODE] However, it keeps showing the time as a 12h clock (in the … | |
Hi dears. I want make relation with gsm modem. my first goal and main one is sending and receiving sms. _then I want go front.for example for mms sending and ..._ I want to do it on a linux server. please introduce me a suitable modula with it's tutorial or … | |
The below code works, but the default value for the test method will be None. I'm trying to figure out how to read input from the user, convert that into a list (or whatever), and then based on the number of arguments the user inputs, it will be sent into … | |
Hey everyone, (Hopefully) a rather quick question. I'm currently trying to use regex to search a string for the location of the longest continuous match in a string where the *same* character keeps repeating. It doesn't matter which character it is, as long it is the highest number of consecutive … | |
Hey Guys I'm looking for a full time offshore Python programmer. It is for a gaming (casino) company that produce slot machines and electronic poker machines among many other. So in so many words it is not web based python, but I'm sure someone who is very good with web … | |
[CODE]def nod(n): c,i=0,0 while n>0: c=n%10 if c!=0: i=i+1 n=n//10 print(i)#prints the number of digits in the given integer 'n' [/CODE] how to make it able to count 'zeros'? | |
When I execute the following sql,select id from people, inside python and print the result, I get this: ((11L,), (12L,), (13L,), (14L,), (15L,), (16L,), (17L,), (18L,), (19L,), (20L,)) Why does python print L beside the numbers. Just to indicate Long type? | |
Hey guys, thanks a lot for the help. Here's the code I have for going through each file in a directory I specify: [CODE] for root, dirs, files in os.walk('%s'%(DOSEnvironVar)): for this_file in files: if this_file.find('.csv')>-1: filepath = os.path.join(root, this_file) currentfile=open(filepath,'r') filelines = currentfile.readlines() [/CODE] I would like to add … | |
Hey there everyone, I'm working in windows, writing a python program which runs various programs through command line and pipes the outputs of one into the next program. All the programs accept all instructions in one line then run. I've been using the os.system command to run these. One program … | |
So I created this nice PushButton that has a popmenu. Unlike QToolButton, it does not allow me to hide()/show() the button which I find frustrating. I want to be able to hide/destroy this button while the application is in a certain mode and then show/create it in another. How do … | |
HI All, My name is s0ur and I am not a programmer. Isn't that the first step to recovery? I am hoping that the experts can help a noob. I am trying to write a python script that will run on windows login. it should do the following: 1) ping … | |
Hi all.... How can I create .exe format in python??????? I mean how to change .py to .exe ???? please reply as fast as possible | |
Hi, I can log all information from the application but how can I log client information? i.e. server is running in my machine and if any one in my network using my application, I want to get that information in my logs, please your advice is important to me. | |
Hey Guys! I'm really wanting to start learning a beneficial, but fairly easy-to-use programming language. I've tried to discuss this at other online communities and have also asked this question at a few seminar's I've been to recently. My objective is to create more advanced software that interacts with the … | |
I'm not sure if this is the best place to post this, but I've noticed a large request for pyHook for Python 2.6. I had a solution to this in a recent thread [URL="http://www.daniweb.com/forums/thread203368.html"]here[/URL], but people are most likely going to miss that. I built pyHook's source for use with … | |
Hi everyone! My first post on daniweb, although I've often been helped by reading. :) I have a CGI script that is driving me batty. CGI is in python. If I put any python code ABOVE the HTML printout of the script except for import statements & varable assignments, Firefox … | |
we got a requirement, im new to Python and recently I did python core code and now got to work on HTTPServer. Is this something like web server? Please check for the following req and give me an idea for each * respond to GET requests by serving pages from … | |
Hello... I've been working on a simple server using the sockets module and threads (just for fun btw ;p). I want to be able to connect to it by specifying a "channel" and then anything the client sends is recieved by all clients connected to the same "channel". Now I'm … |
The End.