15,175 Topics

Member Avatar for
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
306
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
13K
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
169
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
163
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
210
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
188
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
660
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
328
Member Avatar for pwolf

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

Member Avatar for TrustyTony
0
212
Member Avatar for joryrferrell

I'm sort of on the way, but my current method will require me to save the converted array first, then display it. What are a few ways I could use wxPython, numpy, and scipy to efficiently display the changes realtime, without saving every damned time? I don't need actual code, …

Member Avatar for Gribouillis
0
96
Member Avatar for apeiron27

if i have a dictionary like this {ric:24, ric1:46, ric2:23, mike:1, mike1:47} and have a list that has 'ric' and 'mike' how do i get all the values whose key contains 'ric' or 'mike'? i want to ignore the last numbers

Member Avatar for snippsat
0
72
Member Avatar for ron126

a=1 b=2 x="ab" How do I "print x[0]" and get a result of "1" (int), instead of letter "a"? (make the string use global variable) Please help me, thanks.

Member Avatar for snippsat
0
239
Member Avatar for scott_liddle

I'm creating a program that carrys out certain things dependent on the user input. One function is to read text from a text file, another is to add text to the same text file. I'm unsure about how to add an exception handler to make sure the text input is …

Member Avatar for ihatehippies
0
219
Member Avatar for MasterHacker110

I got this code, when i compile it it shows this error: Traceback (most recent call last): File "C:\Users\User\Desktop\Server2.py", line 13, in <module> UDPSock.bind(addr) File "C:\Python27\lib\socket.py", line 224, in meth return getattr(self._sock,name)(*args) error: [Errno 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted If you can …

Member Avatar for ihatehippies
0
5K
Member Avatar for Ismatus3

Hello all friends , i'm biginner in scripting , i just wanted to send i folder to a distant machine ising scp , without writing the password of the distant machine in terminal .For that , i found a script which is : [CODE]#!/usr/bin/expect -f # effectue le transfert par …

Member Avatar for Ismatus3
0
191
Member Avatar for Noufal0247

hi all, i am new to python programming.i need to develop one client server program. here once the client and the server start at the first time, the client automatically send one message to the server . this is a random message, here after the client is waiting for a …

0
84
Member Avatar for SmokeOp

I would like to use the front end to send info to a program built in python 2.7/3.2(not sure which yet but most likely 2.7). That program would then send data back over to the front end and create new buttons (the number of buttons will be arbitrary). I have …

Member Avatar for jackbauer24
0
79
Member Avatar for Aung Myat

Hi all, I just started learning Python and Beautiful Soup. I am developing a script to look for particular text "Running" in the HTML. If that text "Running" exits, I would like to print out the keyword "QSAJK". Please see the attached image to visualize. If there is one or …

Member Avatar for tomstratton
0
4K
Member Avatar for MBPFAN

I'm using python IDLE v. 2.7.2 and I get the same error report with my program. [CODE]>>> def menu(list, question): for entry in list: print 1 + list.index(entry), print ") " + entry return input(question) - 1 [B]items[/B] = ["Cup","Vase","Table","Lamp","Bowl","Door"] keylocation = 3 keyfound = 0 loop = 1 print …

Member Avatar for MBPFAN
0
1K
Member Avatar for ron126

Hi, please help me. Say I have 2 lines of code below. I want to "print ranking" and have result of "1" (force string to use global variable) instead of the letter "a". What are the methods available? a=1 ranking = "a" Can you please help me out? I'm noob …

Member Avatar for ron126
0
237
Member Avatar for manisha

hi guys, I have been using python since last 1yr. For my work I have to use large data that are at least of size 3000 to 30000 or even more quite a time. Since many months I have been using matrices. But when the size of the Matrix is …

Member Avatar for manisha
0
232
Member Avatar for floatingshed

My first gui application is working fine. Fine, that is until the user forgets to select the output directory. I have set up an error message that, when clicked, directs the script to the open directory dialog. This works but I would prefer the user selected the open directory option …

Member Avatar for Gribouillis
0
270
Member Avatar for hamidvosugh

In this string "13 12", I like to find if there is an occurrence of '3', but I am not interested in char '3' which is part of "13". In other word I am looking for number 3 not 13. By using the following code in python I always get …

Member Avatar for Gribouillis
0
158
Member Avatar for Thisisnotanid

I need advice. I'm writing a calculator; I've got the basic functionality of it down, and have finally moved to having it process functions. In this regard, I find the standard library of mathematical functions provided by Python unsatisfactory. While the more commonly used functions are defined, some of the …

Member Avatar for Thisisnotanid
0
381

The End.