15,175 Topics
| |
first of all my apoligies if i asked something irrelevant, i am new to programming ad also new in python, my question is: i have to write a simple program in which i have to ask for the number of employee in the company and then i have to create … | |
I'm following a tutorial for making tiled maps in pygame and on the very first piece of code I'm getting an error. (http://qq.readthedocs.org/en/latest/tiles.html) On this line "for tile_x in range(0, image_width/width):" it's raising this error: "'float' object cannot be interpreted as an integer". The image dimensions I'm loading are 96x64. … | |
Hi, there's a list with tuples. lst = [('Meat', 'Milk'), ('Cake - Cookie',), ('Apple', 'Orange')] For each tuple of `len == 1` I want to split it at ` - ` so it results with: lst = [('Meat', 'Milk'), ('Cake', 'Cookie'), ('Apple', 'Orange')] I tried [tuple(x.split(' - ') for x … | |
how should i get going with testing, I have never used unitest before, however I tried nosetest a while back, but i want to get my hand on unitest, can anyone suggest me examples | |
hello, i was only wondering if there were other ways of making a quadratic formula calculator in python. i recently made one my self by making a module i named quadratic which is shown below: def get_coefficients(): a = float(raw_input('a = ')) b = float(raw_input('b = ')) c = float(raw_input('c … | |
def binary_search(data,key): found=False low=0 high=len(data)-1 while(not found and low<=high): guess=(high+low)//2 if (key==data[guess]): found=True else: if (key<data[guess]): high=guess-1 else: low=guess+1 if(not found): guess=-1 return guess def test(): seq = [] for i in range(1,1001): seq.append(i) for j in range(1,100): is_pass = (binary_search(seq,j)==j-1) assert is_pass == True, "fail the test when key … | |
I have this email program but it doestn seem to work, the emaik never arive at the reciever, not even in his spam folder from email.mime.text import MIMEText from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from smtplib import SMTP msg = MIMEMultipart() msg['Subject'] = 'Email From Python jajaja' msg['From'] … | |
I am trying this example from Byte of Python, Chapter 10. I can't seem to get this zip to work. I am not sure if the syntax for windows is written correctly or not. I have tried running from interpreter and as a script and both return Backup FAILED. Anyone … | |
Python for Pentesters! I study computer forensics and IT security in university. I would like to know how to use python for penetration testing. Is there any courses or site to teach you how to create own tools for penetration testing? We study more Perl for IT forensics but I … | |
**Reading two files?** I will be very grateful to get help about this script. Apython script which can be used to have a convenient format to print the bill in a store. Your script is reading two files: The first one is containing a list of lines and each line … | |
'"No, thanks, Mom," I said, "I don't know how long it will take."' | |
i am having problems creating multiple frames and getting them in the right place. i want to put 4 frames on my display so i can have a display like the first attachments but this its not working and the 2 frame is going straight to the middle when i … | |
hi guys im stuck in this question would anyone care to help me(its a csv file)?? How many times does the least common string appear in the field [gemstone]? valid gemstone owing mark channels code No Diamond 26.06 20 218 (KJQ:10E)2 Yes Diamond 15.43 25 36 (DRX:25H)7 No Sapphire 11.44 … | |
hi i wrote a Gui program in python3.2. i want to convert my .py program into a windows executable file(.exe). i googled for it and found py2exe but it only supports 2.7 . is there anyway i can convert my program. | |
There used to be an open source initiative called sla2pdf which used a python script to convert Scribus sla files to pdf. Unfortunately downloading the programs from https://code.google.com/p/sla2pdf/ is no longer possible. Is there anyone who knows where to find the programs and preferably some documentation ? Many thanks, P | |
from __future__ import print_function, division #requested per VPython import time from visual import * #make sure this is asterisk char, copy/paste no go ## constants mzofp = 1e-7 L = 2.5 q = 2*1.6e-19 scalefactor = 7e-9 deltat = 9e-20 #objects & initial conditions particle = sphere(pos=vector(0,0,-4e-10), radius=1e-11, color=color.red) velocity … | |
I've been looking around for an answer to this but have had no luck. I need to take two files and print the top most frequent words they have in common as well as their combined(sum) frequencies. This might be simple but I'm pretty new to programming. Any help? def … | |
class BTNode(object): """A node in a binary tree.""" def __init__(self, item, left=None, right=None): """(BTNode, object, BTNode, BTNode) -> NoneType Initialize this node to store item and have children left and right, as well as depth 0. """ self.item = item self.left = left self.right = right self.depth = 0 # … | |
I have numpy type array, array[x][y], 16bit, little endian. How to save this to a tiff file as an image?. | |
Let's say I have a user input a string. string = input("enter a string") and that string ends up being something like "hello world!" but with a lot more whitespace. string = "hello world!" I want to condense this user's input so that instead of all that whitespace I only … | |
Hi Friends, I want to connect to a linux machine using a private key login as password from another linux machine. I want to connect this using a python script. Thanks in Advance, Omkar | |
So I have a code that prints out the `sys.argv` when the program is ran. How can I parse $ python ./arch.py install * to show `["./arch.py","install","*"]` Instead of `["./arch.py","install",#other files in directory]`? | |
Hi Friends, I had a issue with telnet conncection in python. Can you send me a working module to connect to telnet windows from a linux machine using python scripting.. Thanks in Adwance, Omkar | |
Anybody out there that used Python on an Android system? Something like the subset on http://pygame.renpy.org/ | |
Hi Guys, I am kind of new to python and started working on python from February2013. I have a script which run on linux machine. It captures the available RAM from the system and then tries to eat it up. I am using subprocess.Popen('free',...) command and for first loop it … | |
So, quick question, (has to be just something I'm missing), if I want to concantate a string and integers in a url, is there a way to do so? I'm sure there is...I mean this IS python! from urllib2 import urlopen width = input("Please enter a width specification here: ") … | |
import matplotlib.pyplot as plt plt.plot(x, y, 'b-') plot.legend ( ... ) 'put legend on left, i do not have the actual code with me. plt.show() How can I resize the plot window to show the legend on the left side?. Also, I like for program Not to stop when calling … | |
So I'm writing a personal bank tracker for myself, and I'm having a bit of trouble with a line of code. The ID_Pin method below is equal to 0000, however when i try to create an instance (any instance of the Account class), it returns the "Access Denied" bit that … | |
i have a problem im trying to solve in python but I'm not sure if its possible ive got lists of data one line that is the full name Eg. name:John Doe and the line below is a the user ID Eg. userID:jdoe i have both of those being made … | |
how can i add data to a label that i have and keep updating it based on the folder selected here my code so far def listDir(): dirname = tkFileDialog.askdirectory(parent=root,initialdir="/",title='Please select the file you would like to scan') myvar.set('Current Folder Selected is: ') label = Label(root, width = 30, height … |
The End.