15,181 Topics
| |
Hi, i'm running a server in my basement. ubuntu running xampp. And i was wondering if anyone can point me to some good uses of python to use on my server. i'm a bit low on inspiration. I know there's Django and also mod_python. But it doesn't have to be … | |
I have function in my program calls a class which opens a new window [CODE]class TopLevel3: def __init__(self): self.root2 = Toplevel() self.canvas3 = Canvas(self.root2, width=400, height=200) self.canvas3.pack() self.root2.title("ImageDB") r = 0 for c in range(6): Label(relief=RIDGE, width=55).grid(row=r, column=0) Entry(relief=SUNKEN, width=20).grid(row=r, column=1) Button(text='View Image').grid(row=r, column=2) Button(text='Update Tag').grid(row=r, column=3) r = r+1 … | |
I wish to create a program that informs the user whether a given date is a holiday or not - Here is how it should work: The student should be prompted to enter an integer for the month and then prompted to enter an integer for the day. (For example, … | |
Hi, Is it possible to include php file in python? in my application already header and left menu and footer are existing in php. i want to include those files in my new python script. Plz tell me how to do this? Thanks in advance -Shyami | |
I'm having trouble combining tkinter windows/functions, i have simplified my problem down to this which i think seems to be the problem. Both these functions will work on their own, but not together. (at least the way i want them to!) What I am after is to be able to … | |
Hello, I would like to execute a double for-loop in python. I use the python interface with ArcGIS (hence the gp. prefixes and weird functions). Here is my double-for loop attempt but I can't execute the code due to 'invalid syntax.' If I remove the bottom loop, the code runs … | |
Hi, What is the best way to find the process name and owner? Now i use WMI, but this version is too slow. | |
Hi everyone. we have an assignment that asks us to count the number of occurrences in a piped raw input text file and print it, calculate its phi statistic, the expected phi for english and the expected phi for random and then print them all out. also, at the end … | |
OK, so I made a FastScrabble game. My code is currently: [CODE]from random import * from itertools import * scrabbletiles = [] showntiles = [] def drawtile(): nexttile = sample(scrabbletiles, 1) scrabbletiles.remove(nexttile[0]) showntiles += nexttile def possibilities(): possi = [] for i in range(2, len(showntiles)+1): for word in permutations(showntiles, i): … | |
How to delete link in a deque in python?I am using double linked list. | |
Hi, How can i generate recurring dates using python? For example i want to generate recurring date for "Third friday of every 2 month". I want to generate recurring dates for daily,weekly,monthly,yearly that is same as the recurrence function in outlook express..... Thanks in advance. Nimmy | |
i want to make a treelist by using Boa Constructor. first, i make a new frame, and then add a new treelist in the frame, but i can not find any key or table to let me add items in the treelist. so i typed several Python code in the … | |
I would like to construct a neighbour list of multiple atoms. [CODE=python] AllAtoms = {} AllAtoms[0] = [0,[]] AllAtoms[1] = [0,[AllAtoms[0][0]]] AllAtoms[2] = [0,[AllAtoms[0][0]]] [/CODE] Every member of the dictionary is referencing other members of the dictionary. I do not know how to make this reference work so that when … | |
Hi, I use exotic fonts and sometimes the text side-cut corners. How it fix? My code: [code=python] font = ImageFont.truetype(fontfile, fontsize) text_width, text_height = font.getsize(text) img = Image.new('RGBA', (text_width, text_height)) draw = ImageDraw.Draw(img) draw.text((0, 0), text, font=font, fill=(0, 0, 0)) [/code] | |
Hello, I am new to this. What I am trying to do is take a .txt file and write parts of it to different lists. The file contains line sof FCODE,DESCRIPTION such as this: DAAS44,AIRSTRIP region ruin/inactive/abandoned I would like to split each line into FCODE and DESCRIPTION strings and … | |
[CODE]print (yourname1) snum = input('What is your date of birth (YYYYMMDD)?:') birth1 = snum[4:6] + '/' +snum[6:8] + '/' + snum[0:4] y1 = int(snum[0:4]) #year of person 1 m1 = int(snum[4:6]) #month "" d1 = int(snum[6:8]) #day '" print ('\n') print ('\n') sleep(1) print (yourname2) snum = input('What is your … | |
I am new to this website, well posting on here anyway. I've taught myself allot about programming and scripting, so I wanna thank everyone for posting. This isn't my first program, but its the first useful thing I've done. It uses the 'w', 'a', 'd', 's' keys to move the … | |
Good day. I need help from those who know about my problem. How to get the total length of a string. I am trying to code that will get a total length of a string. However, if there one or more that have the same value, then it will not … | |
Hi... Pls, how do i do character occurrence using dictionary in python. I want to count the number of each characters in a poem like this .. A----25 G---10 etc... | |
Hello I'm making an GUI app to open a image and zoom it. This function is used to open the image & display it: [CODE] def file_open(self): filename =askopenfilename(filetypes=imageTypes) image1 = ImageTk.PhotoImage(Image.open(filename)) self.canvas.config(height=image1.height(), width=image1.width()) self.canvas.create_image(2, 2, image=image1, anchor=NW) self.image = image1 self.img_zoom(image1) # passing image1 to img_zoom function[/CODE] The image … | |
Once again, I'm stuck on a wx.python issue with regards to the floatcanvas. So... I have a script that erases and redraws an image in the canvas, based on changes made to two slider widgets (sldMFI, sldIDT). Before it redraws, I'm trying to define the current zoomed view as the … | |
Hello, I have been working on a very simple Python Game so far (Not using pygame atm) and I ran into a problem that is very simple but I just do not know what to use to get it to work. Basically what I have right now is that the … | |
Hello, I am still a newbie in python. I am trying to slice a string, but I don't know how. [code] def start(): exp = "1+2"; string1 = exp.split("+"); print exp; print "Operator 1 is : " , op1; print "Operator 2 is : " , op2; [/code] I want … | |
Has anybody ever used py2exe and wxPython together? I have no idea what i'm doing (as usual) and would appreciate it if anyone could walk me through the process or point me to a tutorial online. All the tutorials I've seen (which isn't many) don't make much sense to me. … | |
Hey all, I'm trying to read through a code written by a colleague last year in which he used the BioPython package. The package is no longer on my computer, and I have to wait for the systems admin to update it; thus, I'm forced to merely read the code. … | |
| Hi there, I want to learn how to log in to websites using python 3.1, I've searched for any info and couldn't find. The closest thing I found was an example for older version of python, which I couldn't learn much from it cause the functions are not used in … |
So I have figured out how to receive output from an application using [CODE]process = subprocess.Popen("my_app", shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE) info = process.communicate() [/CODE] But how do I SEND info TO an app? I have an application that asks for a yes(y) or no(n) confirmation … | |
If I do this code in the command line: [code=python]f = open(fl, 'r') txt = "" for line in f: txt+=line f.close() print txt[/code] I get all the output for the file fl, but if I do: [code=python] def editfl(self, fl): f = open(fl, 'r') txt = "" for line … | |
Hello Folks, I have a data structure that is represented like this [CODE] { 1: { 'A1': [ 3, [ 'Val1' ] ], 'A2': [ 9, [ 'Val2', 'Val3' ] } 2: { 'A3': [ 2, [ 'Val4' ] ], 'A4': [ 1, [ 'Val5', 'Val6' ] ] }, #etc.... … |
The End.