15,181 Topics

Member Avatar for
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
136
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
312
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
855
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
116
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
290
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
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
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
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
661
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

The End.