15,175 Topics
| |
So, i am trying to have an explosion when the asteroid and house collides. And i think i have the code written down, but something might me be missing. Please help me figure this out. Thanks a lot. [CODE]# Fresh Start # Classes: House; Asteroid; Explosion from livewires import games … | |
im supposed to be writing a python script that enables receiving SMS (GSM), on the hyper terminal i used the same AT commands i wrote in the script and they worked just fine, but when i download the script on the GSM module ( GT863-PY ) i get nothing at … | |
Hi all, This is my first post here so please bear with me. I am trying to get my QGraphicsView widget to output as an image. I have the following code. [CODE] def outputImg(self,dir=None): if dir == None: dir = os.getcwd() img = QtGui.QImage(self.size()) print img.isNull() # This == True … | |
Edit: The title could have been more descriptive, I am sorry for that! Hello! First time poster, frequent reader. I am very green to both programming and python, trying my best and this board has been helpful just by reading. Now, I have a problem of my own that I … | |
Hey guys, my name is Robert Scubelek, I've been lurking around these forums for a couple of weeks now, and have found more answers here than anywhere else on the internet, so I figured that its about time to become a member and try to contribute something. I'm in the … | |
how can we use the same condition by using the iteration for the numbers automatically? Like 1 after 2. 2 after 3. till 50? | |
Hi Can anyone share Python Study material slides.. It will be really helpful for me ,Plz | |
How to create a png image containing a fragment of source code ? Well, don't do it yourself, the [url=http://pygments.org]pygments module[/url] contains all the necessary tools. The example below shows how to produce a png image from python code, but pygments supports lexers for many other languages and its formatter … | |
Hi I have made a python code for running an operation on a csv file ,But when i am getting error ie:the csv file not found, where should i save the csv file | |
I'd like to change a Python shortcut icon, to make it custom in my standalone applications. Any ideas? Thank you in anticipation. | |
Hi I have a CSV file with column headings as [Serial Number,Reader Name,Book name,Author,Publisher] I want 1)To filter all books with Book name :'Aristotle' 2)to remove duplicates in books with same author name ie.Different Publishers 3)To take a sample of 30 books for Each Reader and copy it to a … | |
| Hey guys, I've been fiddling around with Tkinter for a bit and can't for the love of me figure out why this code won't work. I'm making a GUI that outputs the price of a product depending on what buttons the user pressed. I have three calculations that revolve around … |
1.[url]http://www.renren.com/Login.do[/url] it is ok,my code: import cookielib, urllib2, urllib cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) exheaders = [("User-Agent","Mozilla/4.0 (compatible; MSIE 7.1; Windows NT 5.1; SV1)"),] opener.addheaders=exheaders url_login = 'http://www.renren.com/Login.do' body = (('email',' '), ('password', ')) req1 = opener.open(url_login, urllib.urlencode(body)) file=open('/tmp/sample','w') file.write(req1.read()) file.close() 2.[url]https://passport.baidu.com/?login[/url] can't login,my code: import cookielib, urllib2, urllib … | |
Hi. I am having a problem in creating of one simple program in Python. Here is code. [CODE]import wx class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "Testing erea", size=(280,400)) panel = wx.Panel(self) food = wx.Button(panel,label='Food',pos=(10,10),size=(80,40)) pets = wx.Button(panel, label='Pets', pos=(100,10), size=(80,40)) self.Bind(wx.EVT_BUTTON, self.food, food ) def food(self, event): … | |
I am new to Django. When I tried creating a template, I got the following error. Please help. [CODE]>>> from django.template import Template, Context >>> t = Template("The name is {{name}}") Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> t = Template("The name is {{name}}") File "C:\Python27\lib\site-packages\django\template\base.py", … | |
The first problem: I have 12500+ emails stored as text files. The majority of these text files contain quoted text from previous emails which I need to remove for the subsequent analysis of the data. (Example of a standard email text file:) From: … To: … Subject line: … Text … | |
Here is my code: [CODE] #------------------------------------------------------------------------------- # Name: Mocha Rotoscoping Via Blender # Purpose: Make rotoscoping more efficient # # Author: Jeff Owens # # Created: 11/07/2011 # Copyright: (c) jeff.owens 2011 # Licence: Grasshorse #------------------------------------------------------------------------------- #!/usr/bin/env python import sys import os import parser sys.path.append('Z:\_protomotion\Prog\HelperScripts') import GetDir sys.path.append('Z:/Blender_Roto') filename = … | |
so I recently wrote a function that sorted using the last value in a tuple. Obviously this couldn't be done simply say sorted(tuples, key=tuples[-1]) because that is not a "legal" call. However I did run across, while trying to figure out how to make things like this work, the utilization … | |
Hi all! I try to install PyBluez on my python 2.6 in Windows 7, so a can communicate with my NXT brick, but it seens like there's a file in the library that dosn't work. When I installed PyBluez, it was impossible to import the library into code because then … | |
if I wanted to remove all of the strings within a given list that met a certain criteria, such as having the str'a' in them, how would I go about doing that? the only way that's intuitive to me a for/in loop, but that can't be done. any ideas? Using … | |
Hello everyone , as you can see i'm very beginer in python programming 1 mounth ago , i'm teaching my self from a python and tkinter book i'm trying to write a program that opens the main window after entring the username and password Problem 1: The usernames and passwords … | |
I'm doing the google code U python class and came across a problem trying the following problem, which is the commented out region, the solution needs to be a function. I'm on the second part and trying to find a way to count the values which meet the requirement,i[0:2]==i[-2:]. I … | |
I got this snippet out of my text book but it's giving me a type error, I'll just give you the whole code, tell me if you get it too, if you would. [CODE]import urllib.request import math whips=int(0) rate=float(4) while rate <= float(20): improve= rate*float(.15)+rate rate= improve whips=whips+1 print(whips) def … | |
This is related to [url]http://www.daniweb.com/software-development/python/threads/111526[/url] However, in this case, I don't necessarily know the value of the var from which I am getting the name using vars(). Is there a way to get it? [CODE]prefix = 'char' lidControls = [] lidControls2Make = ['uprLid', 'lwrLid','lwrLidTrack', 'uprLidTrack','uprLidRef','lidRig'] for control in lidControls2Make: objTmp … | |
Is it even possible...I am not sure. Here is my code so far when I click on the Prog_1_Database buttons I want a window to pop up with more button widgets in. Currently the button widget unfortunately gets added to the top level Here is the code so far: [CODE] … | |
I am required to create a function that returns a list of all instances of single characters in 'text' that immediately follow 'last'. For example... def follow_char(text,last): """ >>> follow_char('as we consider the operations', 'co') ['n'] """ I think I am required to solve this using linked lists but am … | |
Currently running python 2.7 on windows 7. I have an app created with wx python and compiled with py2exe. This app has an update utility that polls an update server at startup. If an update is found it downloads the new executable file (approx. 7mb) and makes the switch. It … | |
when the user hits enter it will display Price must be a valid positive number product_price=input("Please enter product price:") while product_price <=0 or product_price=="": print"Price must be a valid positive number" product_price=input("Enter product price:") but it get the following error when the user hits enter SyntaxError: unexpected EOF while parsing | |
[url=http://www.daniweb.com/software-development/python/threads/375271/1621485#post1621485]Sample code credited to Enalicho[/url] In this example, we count the number of appearances of the number 1 through a range of pages using while loops. First off, notice how easy it is to tell what the variables in this method are doing. I did not write this method, but … | |
Hello, I would like to stress that this is for personal practice and nothing school or assignment related. The question: Create a function countPages(x) that takes the number of pages of a book as an argument and counts the number of times the digit '1' appears in the page number. … |
The End.