15,190 Topics
![]() | |
![]() | Okay, I thought I had this code solved: please help me..My code is not closing out..please point me to the right direction..very newbie to python # initialization phase count = 0 totalGrade = 0.0 toContinue = "yes" while toContinue != "no": moreStudents = "y" #processing phase moreGrades = "y" while … |
I want to be able to write a Python script to send a text message to a user's phone using an email client. I have tried the following code: import smtplib from email.mime.text import MIMEText msg = MIMEText('message') msg['Subject'] = 'The contents of %s' % textfile msg['From'] = 'example@mail.examplecompany.net' msg['To'] … | |
Hi guys, This feels like something that should be possible in Python, and something that I feel like I should know how to do. Image I have a list of numbers: items=[10,20,30] Let's say I wanted iterate over them and define two new variables, a and b. a=[] b=[] for … | |
hello ive been working on a small project and im a bit stuck. import subprocess path = "/var/log" #i wanna be able to do something like subprocess.call("nano path") # but i noticed that using nano like that wont work because path is just a python string any help | |
Hi all, I am looking at neat ways of re writing this code below, especially the for loops as I would have over 50 of these statements if I did this the manual way shown below. n = 50 files = [open("files%i.txt" % i, "w") for i in range (n)] … | |
![]() | I am having problem with my python homework. My homework is asking to create a Python program to calculate a student test averages regardless of how many tests will be averaged. Also, it is asking to allow the teacher to continue averaging grades for any number of students. This is … ![]() |
Thank you for looking at my issue. I am a beginner in school and we have an excercise that asks us to write a program that uses nestes loos to draw this patter: ******* ****** ***** **** *** ** * and ** * * * * * * * * … | |
While at work i had nothing to do so i wrote this simple python script that uses the dbm module to store user information its not perfect but im sure someone will find it helpful. | |
I'm creating a python rest api wrapper to a website, i created a file called api.py, then used called the api using [requests](http://docs.python-requests.org/en/latest/), like so: `requests.get('http://example.com/api', auth=('username','apikey'))` How to create a class nammed Class1, then put the url in it using [urlparse](http://docs.python.org/library/urlparse.html), then create another file called example.py, call the … | |
Hi guys, I'm pretty new to Python and having some issues. I have some data points in first and second column. First column is elapsed time. I am trying to implement a differential interval condition which goes as following: ln(t_i+j)-ln(t_i) >= exp(0.2) ln(t_i)-ln(t_i-k) >= exp(0.2) My code so far:P So … | |
How to change font size in win32print module? Win32print works but the font size in virtual printer or local printer is too small (maybe size is 9), but required size maybe 14. Or alternative for win32print? | |
I am very new to python. I have developed a program using the GUI of python. My development is almost done but i am stuck with a point. I have designed my gui using Listbox to read data from a file and show it. All i need to add a … | |
New to Python and programming. I want to start with a txt file with different names per line Output a program that will create a directory for each entry in txt file I'm having problems getting txt file values into Python list, and using that as input for directory name, … | |
Hi, Cote here, and I'm very pleased to announce that I've ported ALL my sl4a apps to eclipse apk, it embeds with the python interpreter, no need to install anything but the app off google play! I have completed: A) Android Eye (Computer Vision), that takes a picture and tells … | |
Installing Eric4 on Windows 7, 32 Bit; using MS VS C++ 2010 After much ado and trial-and-error I was able to get it installed, via the following steps: Command-prompt run as administrator in all cases All packages installed in the root of C:\ After changing each environment variable, update command-prompt … | |
Hey guys, I'm trying to move data by clicking on a QPushButton from one QTreeView in the second QTreeView. Do you know how to do this. I know that I have to connect the QPushButton with a method which makes this possible. I don't really know how this method looks … | |
Write a function called blackAndWhite that has as input argument the file name of an image file (example: bluefish.gif), then transforms the image in black and white and displays it. In order to create a black and white image, do: 1. Prepare the image file: (i.e open the image file … | |
Hi, I need to create a function using **recursion** to find out if two lists have the same shape. For example, if nest1 = [4, [ [3,6], [] ,7] ,[8] ] nest2 = [ [ [3] ] , 7 , [ [5 , [9 , 2] , [ [ [ … | |
I have a nested list, named env, created in the constructor and another method to populate an element of the grid defined as below: ... class Environment(object): def __init__(self,rowCount,columnCount): env = [[ None for i in range(columnCount)] for j in range(rowCount) ] return env def addElement(self, row, column): self[row][column] = … | |
Hi all: I'm building a game (text-based rpg) and i need to learn how to add a checkpoint-like system into it, but i want it to be able to fit in my script | |
Hello, I need a little help with the correct implementantion of the bisection search algorithm in the following exercise: - with 2 given variables, balance and annual interest rate, calculate the smallest monthly payment so that we can pay off the balance within a year test case: balance = 320000 … | |
I'am trying to undestand how I can use the csv module in python to open a csv file in the same folder as the python script - and then create a .shp (shape file) using the shapefile module pyshp. The csv file looks like this, but can have a couple … | |
what is wrong with this code #This is not free source #Don't cheat by looking @ this #If you do you ruin the game #A Towel Production # APOC #------- global ammo1 global ammo2 global ammo3 global health global tech_parts global exp global radio_parts ammo1=10 ammo2=0 ammo3=0 health=100 tech_parts=0 exp=0 … | |
Hi guys, i'm pretty much new to python, this might be simple for some of u. But i appreciate if help is given. Here's my sample code: import random animal = ['duck', 'chicken', 'horse'] drinks = ['coke', 'tea', 'coffee'] test = animal + drinks print(test) word = random.choice(test) print(word) print() … | |
Hello everyone. I am in a programming fundamentals class which we are using python. I am working on a Lab problem and really am not 100% sure how to do it. The Problem: A shipping company (Fast Freight Shipping Company) wants a program that asks the user to enter the … | |
good day all, i was having a little difficulty in trying to code an application in python to read sms i do something like this import inbox import sms but i still dont know where to go from there. The main objective of the code is to intercept sms messages … | |
This snippet defines a `dir()` function which extends python's builtin `dir()` function by adding options to filter the returned sequence of strings by the means of regular expressions. The main use case is live inspection of python objects and modules during an interactive session with the python interpreter. The idea … | |
Hi, I am currently undertaking an assignment for university. I've having quite a bit of trouble with this seemingly simple task, which is to import the data from 2 .txt files into 2 tables within an sql database via python. Here is what I've done so far. This subject is … | |
Hi, I've just started learning Python and for my first script I wanted to make something that would make life easier and that I would actually use, so starting small I've began working on a Torrent Search script that uses the ISOHunt API. However I've ran into a problem in … | |
hello, iam a newbie to python, i am trying to execute a shell command within python code and need the output of the shell command to be passed to the same python code for subsequent use. Here i need the value of the string "ListenPort" from the text file /tmp/file.txt … |
The End.