15,190 Topics

Member Avatar for
Member Avatar for gridder

Hi, Wonder if anyone here can help with this: I'm trying to split each line of data from a text file into a list or tuple. The lines contain a mixture of ints, floats, and strings (with spaces). I can do it easily enough using split() twice - once by …

Member Avatar for gridder
0
122
Member Avatar for chavanak

Hi, I have written a python script that acts as a wrapper around an executable. Here is the code: [CODE] import os import sys import string import csv usage = "usage: Specify the directories for files and the RDOCK cut-off value" if len(sys.argv) < 4: print usage sys.exit() else: first_folder …

0
67
Member Avatar for iloveannaw

Hi, we started doing programing at uni and i got interested so am learning some python at home. just started on generators and thought i'd write a function to generate prime numbers, as you do: [CODE] def primes(p=2): while True: for n in range(2,p): if p % n == 0: …

Member Avatar for Gribouillis
0
65
Member Avatar for 1988asso

hello! I am working with the libraries WX-Python ... I wonder if you can create a button that can be selected and then dragged into a panel?? Can someone help me make this thing or give me some suggestions to do it?? Help! thanks!

Member Avatar for 1988asso
0
29
Member Avatar for edy_sze

Hey Guys I've got a Python function that is slowing the efficiency of my program down and was wondering if anyone could give me some pointers on how I could make this function more efficient ? The function is used for converting a integer to a base 16 number. [CODE]def …

Member Avatar for edy_sze
0
135
Member Avatar for firstimer04

Evaluation of formula G =((p→q) ^p)→q and the output display the result of true false' conclusion if it is a valid, invalid or inconsistent.. thank you for any response its a big help to my study her's my unfinished code [code] import sys p=(True,True,False,False) q=(True,False,True,False) def p_AND_q(p,q): print p,"\t", q, …

0
42
Member Avatar for SoulMazer

Hi, so in essence I have two little scripts: a server side script and a client side script. My client script sends a request to the server, and the server sends a string to the client. Once I get the string back into the client, I set it to the …

Member Avatar for SoulMazer
0
2K
Member Avatar for kfancy

Does anybody have an example of how to split or double down in a blackjack program?

0
47
Member Avatar for germ

Hi I am new at python, so say I have a text folder with many number records in a single column how would I go about extracting only numbers that begin with zero and is either 10 or 7 digits long creating a new txt file for the 7 digit …

Member Avatar for vegaseat
0
153
Member Avatar for mathijs

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 …

0
81
Member Avatar for bharatk

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 …

Member Avatar for bharatk
0
115
Member Avatar for Purnima12

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, …

Member Avatar for woooee
0
160
Member Avatar for shyami

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

Member Avatar for slate
0
75
Member Avatar for Logi.

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 …

Member Avatar for bharatk
0
8K
Member Avatar for AnnetteM

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 …

Member Avatar for AnnetteM
0
1K
Member Avatar for gloris

Hi, What is the best way to find the process name and owner? Now i use WMI, but this version is too slow.

Member Avatar for woooee
0
61
Member Avatar for jjrrmm

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 …

Member Avatar for woooee
-1
239
Member Avatar for PixelHead777

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): …

Member Avatar for Gribouillis
0
146
Member Avatar for RatulSaha
Member Avatar for vegaseat
0
144
Member Avatar for nimmyliji

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

Member Avatar for vegaseat
0
142
Member Avatar for lsy_19830908

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 …

Member Avatar for vegaseat
0
457
Member Avatar for Andy_Ballard

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 …

Member Avatar for Andy_Ballard
0
229
Member Avatar for Lolalola

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]

Member Avatar for woooee
-1
70
Member Avatar for Tenzing

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 …

Member Avatar for Tenzing
0
127
Member Avatar for Purnima12

[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 …

Member Avatar for Purnima12
0
2K
Member Avatar for Tech B

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 …

Member Avatar for Tech B
0
271
Member Avatar for letlet_pogs

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 …

Member Avatar for lrh9
0
117
Member Avatar for Tops

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...

Member Avatar for d5e5
-1
112
Member Avatar for bharatk

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 …

Member Avatar for bharatk
0
382
Member Avatar for rwbarrette

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 …

Member Avatar for rwbarrette
0
341

The End.