15,190 Topics

Member Avatar for
Member Avatar for spyhawk

[B]I am trying to return True or False by comparing dimension size(width and heights) of two pictures. so i came up with[/B]import media f = media.choose_file() pic = media.load_picture(f) g = media.choose_file() pic1 = media.load_picture(g) x = pic.get_width() * pic.get_height() y = pic1.get_width() * pic1.get_height() [B]but i have no idea …

Member Avatar for Lucaci Andrew
0
257
Member Avatar for wolf29

I have a lot of backup files with names like Corn-Curl-Server_Backup_2002-02-23.tar.gz that makes sense as [hostname]_[comment]_[date of the backup].tar.gz It is easy to scan it with a human eye and discover the backups older than 28 days so they can be deleted, however the files are in separate folders under …

Member Avatar for TrustyTony
0
164
Member Avatar for ustar

hi everyone, following is a part of my assignment and your help will deeply appreciated. Thank you, I'm a complete newbie at python. q) each month should: 1. Calculate the monthly interest payment by multiplying the monthly interest rate, as a fraction, by the remaining principal. 2. Determine the amount …

Member Avatar for woooee
0
1K
Member Avatar for floatingshed

My very reason for getting involved with Python was to use it as a gui for some command line programs, like eac3to, sox and neroaacenc. Previously I'd been using batch in windows and had become quite proficient. In batch, a line to process audio with sox looks like this: [CODE]"tools\sox.exe" …

Member Avatar for woooee
0
275
Member Avatar for moroccanplaya

i have variable a with binary values then i have variable b with another set of binary values, i want variable b to into variable a and stored into variable c, i hope that not confusing a = "01101000011001010111100100000000000000000000" b = "011000100111100101100101" c = "01100010011110010110010100000000000000000000"

Member Avatar for moroccanplaya
0
119
Member Avatar for ihatehippies

Just wanted to point out for anyone using py2exe that it apparently doesn't always (or maybe ever) raise AssertionErrors. It's been a while since they've updated the program so it's probably just easier to implement a workaround for those of us who use this compiler. I've noticed it not raising …

0
98
Member Avatar for Thropian

I started into a project in Python,Tkinter. I have a button that I have two images for. I know buttons include the "-relief" option so I can get rid of the border. Now I'm trying to get rid of the click animation border, and have the image on the button …

Member Avatar for floatingshed
0
6K
Member Avatar for fatalaccidents

Hey guys, I've been doing python programming as basically my sole programming language for about a year and have learned a lot (obviously still learning more everyday). I do a lot of computational work so I'm forced to do a lot of bash scripting as well, although I have made …

Member Avatar for moroccanplaya
0
362
Member Avatar for hasanatkazmi

Hi, I am struck in a big problem. I am creating a JAVA ME application which requires to consume web services created at my server using SOAPpy. I am using netbeens for creating JAVA mobile application. Netbeans has a web services import feature from where you can simply paste WSDL …

Member Avatar for TrustyTony
0
887
Member Avatar for Cayris

I'm trying to make a simple program that prompts for a password and then continues to a different section of the program, else loops back to the original prompt for the password. I can't find a way to do this other than to use external things - such as text …

Member Avatar for Cayris
0
137
Member Avatar for giancan

Dear all, I built 2 script to manage 2 different frames (which I will then convert to exe with py2exe). Frame 1 (GG1) is like this [CODE]import wx # begin wxGlade: extracode # end wxGlade class MyFrame(wx.Frame): functions here ... if __name__ == "__main__": app = wx.PySimpleApp(0) wx.InitAllImageHandlers() GG1 = …

Member Avatar for woooee
0
313
Member Avatar for jobs

How do I get datalist to string? >>> days = 24/6 >>> print days 4 >>> hours = 45/7 >>> print hours 6 >>> datalist = [] >>> datalist.append(days) >>> datalist.append(" days ") >>> print datalist [4, ' days '] >>> datalist_str = "".join(datalist) Traceback (most recent call last): File …

Member Avatar for cementovoz
0
858
Member Avatar for vlady

Hello! Here is the code, pls have a look fist: [CODE]class Cstudent(): def __init__(self, name): self.name = name self.subjets = [] self.mark = [] def add_subject(self, subject): self.subjets.append(subject) def add_mark_student(self, subject, mark): subject.add_mark(mark) def __str__(self): return 'I am object of student: %s'% \ (self.name) def print_list_of_subjects(self): lst = [] for …

Member Avatar for vlady
0
117
Member Avatar for FALL3N

[CODE] import os; def callAS(cmd): os.system(cmd); def selectFile(): callAS("""osascript -e 'tell application "Finder" to return choose file "Select the file:"'""") def fixPath(raw): arr = raw.split(' '); return(str(arr[1])); thePath = selectFile() thePath = fixPath(thePath); print(thePath); [/CODE] When the above code is run in IDLE, it just gives an error. But, when …

Member Avatar for FALL3N
0
291
Member Avatar for vegaseat

The code shows a fast prime number generator using a sieve algorithm. It looks at only odd numbers. Technically 1 and 2 are prime numbers too, since they are only divisible by unity and themselves, exceptions are made for 1 and 2. Zero and negative numbers return an empty list. …

Member Avatar for Mavericks
1
3K
Member Avatar for arindam31

Hi All . I am trying to make a Frame to which we add dynamically Add panels. Also I want to remove panel dynamically . The dynamic Addition is working perfect. Please see the code below: # panels.py #self.Fit() causes the whole frame to shrink.So we are using self.Layout instead …

Member Avatar for arindam31
0
307
Member Avatar for maddocspace

I have written this short code [CODE] import os import os.path import string import shutil import difflib Path = 'C:/RESULT/BATCH/SimpleInputParser/' SecPoint = [] FullList = [] newFile = [] for fileName in os.listdir(Path): if fileName.endswith(".inp"): f=open(Path + fileName, 'r') files = f.readlines() f.close() fp_clean = open(Path + "tempClean.inp", "w") fp_newFile …

Member Avatar for maddocspace
0
296
Member Avatar for Pybegginer

Hi there, i'm learning python by reading a book and i am stuck in one of its examples: i created succesfully a file with a basic script in it (i run it with the GUI) and it works fine, the file is named script1.py and i saved it in [B]C:\Users\username\doocuments\varios …

Member Avatar for askandstudy
0
131
Member Avatar for Vkitor

hi, is there any way to restart Tkinter program while running. I would like to put some button that will when pressed put everything as it was in moment I started program thx

Member Avatar for woooee
0
14K
Member Avatar for zazga

Okay, Im not sure how to put this. So here is my first try, and if it aint clear enough I'll try to explain better. I have made a few scripts that work perfectly fine, but now my client prefers it to come with a GUI. My script needs 2 …

Member Avatar for askandstudy
0
170
Member Avatar for pxalpine

Hello, I'm manipulating large quantities of HTML files (about 2000). I'm new with Python, and would appreciate any help. For example, I want to delete the lines that contain "embed_music" in all the files, or change all instances of the word "Paragraph" to "Absatz". This is my pseudo-code: [CODE] open …

Member Avatar for ihatehippies
0
164
Member Avatar for floatingshed

I've used Pythoncard to create my gui. Here it is in heavily condensed form: [CODE] import os import sys import os.path import Tkinter import wx import subprocess import subprocess as sp from subprocess import Popen from tkFileDialog import askopenfilenames from tkFileDialog import askdirectory import tkMessageBox from Tkinter import * from …

Member Avatar for woooee
0
187
Member Avatar for floatingshed

I'm just starting out with Python and like the way pythoncard handles the graphics for me. However I cannot work out how to get the data from the radio buttons. The radiobutton.html page is missing from the docs! I've exhausted google (its 4.30am!) and have had no luck. Please somebody …

Member Avatar for woooee
0
61
Member Avatar for rzufelt

Hi All, If i copy/paste line for line the below code into IDLE (v2.5 or v2.6) it works perfectly and sends me the email message. [CODE]import smtplib fromadd = "arcazy@foo.com" toadd = "meufelt@wfoo.com" msg = "Insert message body here" server = smtplib.SMTP('exchange01.foo.com') server.sendmail(fromadd, toadd, msg) server.quit()[/CODE] However, If I try …

Member Avatar for Gribouillis
0
211
Member Avatar for floatingshed

I cannot understand why this doesn't do as I expect... [CODE] if (os.path.exists(ofile)): os.unlink(ofile) print "it existed, but I've deleted it!" print "It didn't exist so I'm creating it" ---Here we have a subprocess command--- [/CODE] The print statements print as you'd expect but the command only runs if "ofile" …

Member Avatar for snippsat
0
162
Member Avatar for oiwah
Member Avatar for TrustyTony
0
189
Member Avatar for kiddo39

Hi, I'm trying to run code that asks a yes or no question. If a yes or no isn't entered, then the question will continue to re-ask say every 3 seconds until a yes or no is entered. Here's the basics of it: [code] while True: response = raw_input(" Are …

Member Avatar for jeugtsy
0
664
Member Avatar for vlady

Hello, I am learning classes, and find it a bit difficult... :-( Mine intention is to add subject(predmet) and mark to the objet janko but if I search in self.predmety, I get False, means that it can't recognise predmet in self.predmety list State of self.predmety is as folloving: [<__main__.Cpredmet instance …

Member Avatar for vlady
0
90
Member Avatar for VinceW

#Guess my number #The computer picks a random number between 1 and 100 #the player tries to guess it an dhte computer lets #the player know if the guess is too hight, too low #or right on the money import random print "\tWelcome to 'Guess My Number'!" print "\nI'm thinking …

Member Avatar for themoviegeek
0
330
Member Avatar for pwolf

Hello, could someone explain recursion to me? It would be much appreciated!

Member Avatar for TrustyTony
0
212

The End.