15,181 Topics
| |
Hello I can't understand OOP in python I am looking to good tutorial , i am looking to good tutorial , about OOP in python from zero Thank you | |
Hi all, I'm new to python. I am developing a text to speech application using python. So, I'm using a package named "pyTTS" version 3, compatible with python 2.5. Using an existing example, I wrote the following orders: [CODE] import pyTTS tts = pyTTS.Create() [/CODE] [B]Before this, I've installed the … | |
I am trying to write a program that collects gas receipt information. I only want it to ask one time for how many receipts there are and then I want it go ask the loop of questions. How do I do this? I'm guessing I can't declare multiple variables in … | |
Hi I keep on getting data altered when I receive it example: [CODE] SAM:~ SamarthAgarwal$ telnet 192.168.1.39 8888 Trying 192.168.1.39... Connected to 192.168.1.39. Escape character is '^]'. --Welcome To HACKNET-- Username: Admin Password: pass --INCORRECT IDENTIFICATION--Connection closed by foreign host. SAM:~ SamarthAgarwal$ [/CODE] the data on the server side: [CODE] … | |
This snippet defines a decorator to automate attributes setting in class instances at creation time. It can be seen as a gadget feature but it can also be handy especially for fast class prototyping. | |
I've created an image with PIL, and I'm trying to get it show on a Tkinter GUI, but I get a blank window. Any ideas? [CODE]import Tkinter import Image, ImageTk, ImageDraw #create an image image = Image.new('RGBA', (100, 100)) i = 0 draw = ImageDraw.Draw(image) ## draw some lines for … | |
For a given digitally signed file I need to extract the 1024 bit(RSA) public sign key that is shown in the attachment. Can someone tell me how to do that through python. Is there a specific python module that can extract the digital signature details? If that is not possible … | |
I would like to share some python tutorials I found and thought are quite useful for those who just started to learn python: python basic tutorial video: [url]http://developresource.weebly.com/5/post/2011/10/python-basic-tutorial-video.html[/url] python game tutorial video:: [url]http://developresource.weebly.com/5/post/2011/10/python-game-develop-tutorial-video.html[/url] wxpython develop tutorial video: [url]http://developresource.weebly.com/5/post/2011/10/wxpython-develop-tutorial-video.html[/url] | |
Im a beginner at Python and I have written a program consisting of three functions and now Im stuck when I need to 'call' on them at the bottom of the program. In the 1st and 2nd functions I get some information and saving it to a file, but the … | |
Your program should calculate and output (to the screen) the following information about the file of text: 1. The total number of lines in the file, including blank lines. 2. The number of blank lines in the file. 3. The number of periods in the file. 4. The number of … | |
[CODE]def windchill(V,T): wc = 35.74 + .6215*T-35.75*(V**.16)+.4275*(V**.16) we = round(wc,2) return we def main(): print(" Temperature \n") print("Speed \n") print("---- -20 70 10 0 10 20 30 40 50 60 ") for V in range(0,55,5): print(V) for T in range(-20,70,10): wc = windchill(V,T) print(V, "{0:1.1f}".format(wc), end="") main()[/CODE] Its python 3, … | |
i need some help with this code please :) when i run this code the output after each time the nested loop runs should look like this: {'gender': 'Female', 'age': 9, 'fur': 'Brown', 'name': 'Savannah'} {'gender': 'Male', 'age': 9, 'fur': 'White', 'name': 'Thumper'} {'gender': 'Male', 'age': 8, 'fur': 'Brown', 'name': … | |
Hi, I am using Python 2.4 on Windows. I'm trying to save the contents of the debug window. I managed to redirect all print statements so that it prints on the debug window as well as saves a copy into a text file. The code is shpwn below: [CODE] import … | |
Hi, I'm working on Python 2.4 and use tkinter to build my GUI. I want to display content(line) from the listbox only when it is selected. [CODE] def get_list(event): # get selected line index index = Listbox.curselection()[0] # get the line's text seltext = Listbox.get(index) print seltext Listbox.bind('<ButtonRelease-1>', get_list) [/CODE] … | |
i need a example or sample code about text.dump (???) input values -> automatic text ---> automatic tags --> save (.doc , .txt) but when i save the text, the file dont get the tags.... like this example: input in text widget: I [B]love[/B] you [U]girl[/U] the output in (.doc … | |
Hi..me again. I am trying to incorporate this function which counts the periods into the code..however, I can not get the code to output both the line count, blank line count, and period count at the same time. This is my 3rd or 4th try at adding this into the … | |
program that will read an unknown number of bowlers and their bowling scores (with possible values from 1 to 300) from an external file called "bowlingscores.txt". The file will look similar to the following: David 102 Hector 300 Mary 195 Jane 160 Sam 210 Output the bowlers’ names to an … | |
[CODE]#!/usr/bin/python import smtplib sender = 'from@fromdomain.com' receivers = ['to@todomain.com'] message = """From: From Person <from@fromdomain.com> To: To Person <to@todomain.com> Subject: SMTP e-mail test This is a test e-mail message. """ try: smtpObj = smtplib.SMTP('smtp.gmail.com') smtpObj.sendmail(sender, receivers, message) print "Successfully sent email" except smtplib.SMTPException: print "Error: unable to send email" [/CODE] … | |
Any sequence of python strings can be disguised to look like a file opened for reading, which can then be passed on the fly to functions expecting such an input file. This code snippet defines the necessary adapter class. The obtained file-like objects store only one string of the sequence … | |
i want the proper working code of python to parse the NMEA gps data of the android plz help me | |
I am trying to write my dictionary to a csv and i am getting errors, was wondering if someone could tell me what i am doing wrong this is my function [CODE] n = open(file.csv,"w") for item in my_dict.items(): f.write(item) f.close() [/CODE] my my_dict is for example {john ['25']} when … | |
I know how to write to an existing txt file via Py function, but can you create the file itself from the function, or MUST the txt file already exist? | |
Hi all, I'm not a Python expert (I've only dabbled a little). A user has asked me to help with a short webcrawling script they have written. They are making use of Dale Hunscher's UrlNet library in the script. They basically want to have the script ignore overly repetitive URLS … | |
Hi guys, trying to write a function that reads a text file and counts the periods in it and prints the answer. I keep getting an error saying that UnboundLocalError: local variable 'periods' referenced before assignment. I am not sure how to fix this. We must use a function to … | |
Hey guys. I'm having some trouble with this error. [CODE] class App(): i = 0 def updateCount(self): i = i +1 app = App() app.updateCount() input('Enter') [/CODE] I have tried global i but get an error 'global name i is not defined'. Can someone clue me in? Cheers :D | |
I'm new to python and I'm trying to count punctuation in a string input by user, and I"ve been able to do it w/ out a loop, but would like to emply a more efficiant method. I've been able to loop through and grabb the characters, but they are'nt being … | |
Hey guys, hope I'm in the right section here, I presume Pygame falls under python. I'm trying to make a circle move left,right,up or down depending on the users input (e.g if the user presses the "a" key then the circle will move left by itself, rebound off the edge … | |
Hey there, everyone. My friend and I are looking into writing a very simple game in Python. We're gonna use PyGame for it as well. It's a top-down view 2D game where you play as a guy with an ax who kills zombies. There are not different levels; it's all … | |
ok well this is my first thread that im asking 2 questions, im new here, these are from my high school college computer science class, one is newer and one is older, i went back to the older one because I still want to finish it and try and extend … | |
| So im making a anagram detector that reads all the words in a string. I already have the anagram funktion working (returning true if it is a anagram, and false otherwise) But i am having trouble making a loop that reads all the words in the string, and returning the … |
The End.