15,175 Topics

Member Avatar for
Member Avatar for davethebear10

I have to get three pieces of information from the files i have 1. The name of the owner of the file which appears after the pattern tag <foaf:name> 2. The ID of the owner of the file which is embedded in the filename, e.g., http%3A%2F%2Ftalk.ie%2Fvbulletin%2Ffoaf.php%3Fu%3D12 belongs to user 12. …

Member Avatar for woooee
0
242
Member Avatar for danizzil14

ok I had looked on the internet and found one form of running an exe file from a py script, i goes like this. [CODE]import os os.system("c:/windows/iexplore.exe") # Or wherever it lives[/CODE] Problem is, whenever i run the script with the appropriate path loaded in, i get the following: [CODE]Traceback …

Member Avatar for o0b3600
0
366
Member Avatar for SgtMe

Hi guys! I am in the process of making a game...similar to this one: [url]http://www.miniclip.com/games/nfl-lateral-collateral/en/[/url] I am using the following code to detect key presses: [CODE] pygame.event.pump() key = pygame.key.get_pressed() if key[pygame.K_LEFT]: ... [/CODE] How can I detect if a key is released? I have seen this done with using …

Member Avatar for tbone2sk
0
14K
Member Avatar for foxyenock

Write a python function which takes one argument, which is a word(as a string),and returns true if the word contains the same number of vowels as consonants. Then write a short piece of code to read the above file and print out all such words.For example the words such as …

Member Avatar for foxyenock
0
85
Member Avatar for tkpanther

I have been given an assignment to create a random race program where 2 different lines race. How the lines travel is determined by a random number generator, but that is not the issue I currently have. I am suppose to create a window that is 500x600, with the x- …

Member Avatar for ssmokincamaro
0
191
Member Avatar for camigirl4k3

A non-robot problem (Should be submitted independently). Write a Pyhton program, called Scores.py, which reads a collection of exam scores (integers) ranging from 1 to 100 and counts and prints the number of `A' scores, `B' scores, `C' scores, `D' scores and `F' scores based on the following grading scale: …

0
59
Member Avatar for duomaximus

Good day, any ideas on how to implement edge scrolling for wxPython. Panel used is a wx.ScrolledWindow here's a sample screen shot of the tool. The red areas indicates the edges of the map panel where the scrolling will be triggered. [url]http://i40.tinypic.com/wsmo95.jpg[/url] Thanks in advance!

Member Avatar for duomaximus
0
55
Member Avatar for garyinspringhil

I need a qtimer to trigger reading of a file line by line, I have the code working running with the timer trigger but qtimer will just read the first line over and over as it is now. Here is the code so far: self.lcdtimer = QTimer() self.connect(self.pushButton85,SIGNAL("clicked()"),self.update) self.connect(self.lcdtimer, SIGNAL("timeout()"), …

0
59
Member Avatar for GMUPATS

I am a student in my first python programming class in college and I am trying to figure out how to do my latest lab assignment. Could anyone just give my a hint on how to get a file (I know how to import it into the program) into dictionary …

Member Avatar for vegaseat
0
86
Member Avatar for bumsfeld

I am starting to play around with IronPython, but I can't figure out how to convert any code to executable file that will run on Windows. There has got to be some kind of batch file.

Member Avatar for jcao219
0
184
Member Avatar for prashanth s j

Hi all, I ahve got a requirement of searching for a string in a text file and then return that string. I also need to convert that to numerical value Could anyone please tell me how to do it? The requirement is precisely like this: First I need to search …

Member Avatar for bumsfeld
0
96
Member Avatar for jake2891

I am trying to write text into a windows edit control using python. it seems to write to every control i try except the edit box not sure if this is a security measure or not. here is my code any help will be greatly apprciated. [code] import os,sys,subprocess,time from …

Member Avatar for jcao219
0
168
Member Avatar for ccandillo

I am a programming and python beginner and thought this would be a fun exercise. I wrote this script to mine web pages. First it finds all of the hrefs on the page. Then it takes those urls and searches those pages for content. This is by no means perfect. …

1
62
Member Avatar for axa121

Hi, I'm processing a small text file which contains information about the Winter Olympics. However I don't know how to keep the list the same for each country whilst making a new list for a different country. So far I've read in the lines and I have put the data …

Member Avatar for axa121
0
87
Member Avatar for Tech B

My friend gave me 10,000+ ROM's for Sega, SNES, NES, and GBA. They where all individually zipped. I go fed up trying to unzip them one by one, and decided to write a script to do it for me. It unzipped about 5,000 in under a minute. Python's zipfile module …

Member Avatar for Tech B
0
619
Member Avatar for jozz3

Hello In my program I am using a menu that uses a multi-way if statement to do what the user inputs (1 of 3 values). After printing the menu I use a raw input statement to get the user's input. However, is there anyway to define the user's input variable …

Member Avatar for vegaseat
0
108
Member Avatar for pyprog

I am trying to write a program that prints every line of the file until a certain string is found. The file is a plain text file. I put the sample context at the top of the code. But the function gets stuck in an infinite loop. I don't want …

Member Avatar for IsharaComix
0
7K
Member Avatar for minimagician

Hi, the problem is that: I have a text file with some lines of text in it. I have to search for a particular line in the file and then copy the lines after the searched line into another text file. This search string comes only once in the text …

Member Avatar for rohini.vangury
0
7K
Member Avatar for emitan

Hi all. There might be a simple solution to this but I've been googling for quite a while for a solution... I want to get the plots generated by the module matplotlib from Python in an interactive window so I can save the graph. I'm using Ubuntu 9.10 and things …

0
63
Member Avatar for jozz3

Hello I'm writing a python program and need some help. Firstly, is there anyway to include variables in an input prompt? For eg. [variable1 = 4 variable 2= 3 variable= raw_input("Please enter a number between", variable 1, "and", variable2) ] Also, if data is being appended to the end of …

Member Avatar for jozz3
0
111
Member Avatar for ChargrO

hello I was just wondering if anyone knows of a site or someone (or start me off with some code) that could help me with learning about cascade menu's and changing them from a parent into a child, any help would be greatly appreciated. I am making the cascade menu …

Member Avatar for pythonNerd159
0
163
Member Avatar for persianprez

For my extra credit, I'm supposed to generate the longest chain from 1-1000000, I wan't to know if it is correct..here is my code: the caller [CODE] start = 1 end = 1000000 longest, chain = -1, -1 #choiceX(start) for i in range((end-start)+1): if choiceX(start) > longest: longest=start chain=choiceX(start) start+=1 …

Member Avatar for persianprez
0
93
Member Avatar for pythonNerd159

Hey people, i was just wondering if anyone knew the code to make a tkinter button... [CODE]def createExample(self): top=self.winfo_toplevel() top.rowconfigure(0, weight=1) top.columnconfigure(0, weight=1) self.rowconfigure(0, weight=1) self.columnconfigure(0, weight=1) self.Button = Button ( self, text=" Example", font=("Arial", 12), bg="white", fg="magenta", cursor="crosshair") self.Button.grid(row=1, column=0, sticky=N+E+S+W)[/CODE] ...and i wanted to know the code that …

Member Avatar for pythonNerd159
0
141
Member Avatar for Mensa180

Hello all! I was bored and upon my father's challenge I made a program that tells you the 20 day SMA for a specific date, I only have 100 days of data but can up that to over 8000 whenever I get my logic sorted out. The problem is I …

Member Avatar for Mensa180
0
167
Member Avatar for tran0191

I am doing a project where I read in a CSV file and I iterate through each row in the file. I then compare a specific column from each row, if a row with the specified column has the same value as another row with the specified column I would …

-1
53
Member Avatar for Oron123

hi, i have a big exe program that i wrote in c# (big means that i have a lot of class in it), i want to write a script in python that will check the program. what is the right way to check the program, convert the c# program to …

Member Avatar for jcao219
0
138
Member Avatar for Lylywhatever

i want the stars to appear in the night, but it only come out one?? can anyone help me what i should do to make about 50 stars randomly appear in the night?? thank you so much! [CODE]from graphics import * import random def stars(x,y): '''draw white line representing one …

Member Avatar for vegaseat
0
96
Member Avatar for duomaximus

Good day, Hi, I'm trying to develop mapping feature for a tool. It has a wx.ScrolledWindow that contains wx.lib.buttons.GenBitmapTextButton as map nodes. When the number of map nodes reached around 50+ the scrolling becomes too slow. Any ideas on how to improve the performance of the scrolling when there are …

Member Avatar for duomaximus
0
421
Member Avatar for jjrrmm

Hello, for our last assignment we were asked to read an input file then plot this data using a bar chart. we have to make the bar chart using turtle module in python using functions. I really have so little time to do this, if anyone can give me a …

0
62
Member Avatar for persianprez

I have 3 functions working together, but I only have abundant returned every single time, I don't know what is wrong [CODE]def sumDivisors(n): total = 0 for counter in range(1, n): if (isDivisor(n, counter)): total += counter return total def checkForPerfect(n): total = sumDivisors if (total == n): return 'Perfect' …

Member Avatar for persianprez
0
201

The End.