15,190 Topics
![]() | |
Hi I am wondering how to write a list to an html file from scratch. I am currently writing it to a file using: [icode] def wpubooks(self): for i in booklist: s=str(booklist) f=open('/booklist', 'a') f.write(i + '\n') [/icode] Is there a way I can change that code so that it … | |
I am looking for a xml creator/editor with treeview using Tkinter. I want to be able to load and save changes. Any help would be greatly appreciated or snippets. Thanks! | |
Hey all, I have been reading some older posts on line/list manipulation, but don't quite understand exactly how to implement all of the tools that you guys are using (line.strip() for example) to get what I need. Essentially, I have a working program that iterates through data and outputs it … | |
How to move all only one type of file to another directory? For example, i want to move only all .jpg only file to another folder in Python. I know batch is easier to do it, but i prefer in Python. Anyone can help? | |
Hi! I'm very new to both python and Tkinter and would be thankful for some help. i want to search a text document for a word and print each line that match the searchword in a text widget. [CODE]def ladda(): fts = 'thefile.txt' file = open(fts,"r") text = file.readlines() file.close() … | |
Hi, With this tutorial, I've hit a few questions that I'm not sure what they are asking for. It's in the lesson on lists? Could you please advise what it is they are looking for, because to me it sounds like I'm just filling out the argument as shown when … | |
[CODE=python]>>> mylist = ['bunnies', 'apples', 'animals', 'fruit', 'amsterdam'] >>> for x in mylist: print '--------------' print x if x[0] == 'a': print "Removing ",x mylist.remove(x) -------------- bunnies -------------- apples Removing apples -------------- fruit -------------- amsterdam Removing amsterdam >>> print mylist ['bunnies', 'animals', 'fruit'][/CODE] The output should be bunnies and fruit, … | |
Yeah so I was bored in class cuz I didnt know the test wasn't today, so I made part of a Python game. The battling works so far, and I might need some help later on so if anyone could could help me I'd appreaciate it. Norbert Quest: [code=python]import random … | |
Hi everyone, I'm doing some experiences with python in Windows Vista and I was wondering to know how to eject the tray of CDs. Thanks, Dan. | |
Hi, Im trying to parse a bands myspace page and get the total number of plays for their songs. The problem is that I cannot use urllib2 as the "Total plays" string does not appear in the page source. e.g. [url]http://www.myspace.com/mybloodyvalentine[/url] Any idea of ways around this? Thanks, O | |
Is possible use svg imge in wxpython in a toolbar for example? I've saw libRSVG but run on PyGTK. | |
Sorry for my second newbie question....well now I am dealing with a text file that has the following line: 1e+12 Anyways, so I want to go into the file (named intens.txt) and replace the "e+" so that the line will look like this : 1*(10**12) .....The line will be changing … | |
Hi, I am modifying a script that will be run as a windows scheduled task after hours. This script was written by another programmer previously. The original script includes threading in the code. Should a script that is run as a single job from a scheduler require threading? Thanks. | |
I have used python for awhile, and am quite good with it. But last week I added the wxpython..I wanted to actually make a program and not a script. So I can do this in normal python all day long. But wxpython is alot different, so I need help with … | |
I NEED HELP!!! I am trying to make a program somewhat like keynote or powerpoint in python, and I need to know how to make text evenly spread out from the center on the y-axis, I can do that on the x-axis. If you dont get what I am saying … | |
hey every1, im a noob pythoneer.. i wanted to change the names of all music files using their metadata obtained from mminfo utility. I came up with the following hideous looking code.. [CODE=python] import os os.chdir(raw_input('plz enter directory name: ')) lst=os.listdir(os.getcwd()) class process(): def getmetadata(self,filename): command='mminfo %s|grep artist>temp.txt'%filename;#print command os.system(command) … | |
Hey, I've just joined up here hoping somebody might be able to help me with a project I've got on at work at the moment. I've been learning python using the method, let's just do it and see what happens and I appear to be coming up to conflicts consistently … | |
Hello i have extend wxPanel to create a template like this [CODE] import wx class Age(wx.Panel): """ Template per gestione Anagrafiche""" def __init__(self, parent, id,content,content,size = wx.DefaultSize): wx.Panel.__init__(self, parent, id, wx.Point(0, 0), size, wx.SUNKEN_BORDER) ## Create the vertical sizer for the toolbar and Panel self.box = wx.BoxSizer(wx.VERTICAL) tb = _NavigationTool(self) … | |
I am unable to get scrollbars to work in a wizard I have created. I have a BoxSizer on one of the pages in my wizard. The contents of the BoxSizer are larger than the wizard window so I need to scroll vertically to see the rest of the contents. … | |
Hi, I'm a newbie to python. I'm going through the wonderful 'how to think like a computer scientist tutorial' and I've come up with a question that I'm not sure how to get it to add the results at the end. Here's the question and my working so far :) … | |
Hi everyone I have a question but I don't know if it can be done in python. Ok so this is what I want to do: I have two scripts [code=python] string = "hello world" [/code] and [code=python] def output(): print string [/code] Now what I want to do is … | |
The tut's on the internet are a little complex. All I want to know is how to get 5 threads to open up 2 urls each.(because it's simple) Can somebody show me how to code that? | |
Hi, I have written this code to generate the maximun number from a number of coloumns (say 4 coloumns) in a list. The code is not handling negative number well and so keep generating the negaive number to be greater eg -8 > 5 which is wrong. Why is this … | |
![]() | Hey guys, I have some Java code here, which checks whether a word is present in a sentence or not: [CODE]import java.io.*; class search_arrays { static void search()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter a sentence: "); String s=br.readLine(); s+=" "; String[] x=new String[s.length()]; int a=0,b=0; for(int i=0;i<x.length;i++) { … ![]() |
Hello, Programming/Python newb here looking for some help with arrays. I am trying to write a parsing program that takes a comma delimited csv file, compares entries, and outputs the comparisons in a particular format. The csv file has two columns. Col [0] contains article identifiers, col[1] contains assigned keywords. … | |
hello i have some data which i read in and wish to carry out some functions with it and format it into a new output file. however on my input data i need to do different things dependind were my data is for example def some_function(list): does something does something … | |
My question is :' if my "[2009'07'12 @ 22'49'47] main page.jpg" store in "C:\image folder\", but the timestamp [2009'07'12 @ 22'49'47] will be inconsistent, so i wan use behind "main page.jpg" to find "[2009'07'12 @ 22'49'47] main page.jpg", and print the link like "C:\image folder\[2009'07'12 @ 22'49'47] main page.jpg" as … | |
![]() | Hey guys, I want to make a Python program which I will use to automate certain tasks like opening TweetDeck and Skype everytime I boot up my laptop. The problem is, I know how to open the programs(using subprocess.call), but I don't know how to pass the user ID and … |
![]() | [CODE]import time import subprocess #TweetDeck a=15 print "Opening TweetDeck...\n" while a>=0: print (str(a)+" seconds remaining...") time.sleep(5) a-=5 subprocess.call("C:\Program Files\TweetDeck\TweetDeck.exe") #Rest period print ("\nWaiting...") time.sleep(5) #Firefox a=15 print "\nOpening Mozilla Firefox...\n" while a>=0: print (str(a)+" seconds remaining...") time.sleep(5) a-=5 subprocess.call("C:\Program Files\Mozilla Firefox\firefox.exe") [/CODE] Hey guys, I used the above code to … |
Hello everyone, I try to build a python application based on pygtk. For GUI development I used glade3 with the option translatable strings. I've created all the PO, MO files needed, starting application with different LANG constants in command line gives me expected results. My goal is to be able … |
The End.