15,190 Topics
![]() | |
Hi everybody. Maybe I was able to write a script which takes an input file, strips off part of the anchor tag(<a ....>) and returns a new file. I'd like to know your opinion about the script; it works, but I have the feeling that there is something that can … | |
Hi folks, I wonder if anyone out there could help me with something. I have a folder containing many html files that look like this: Astronomical Applications Dept. U.S. Naval Observatory Washington, DC 20392-5420 ST. PETER'S NOVA SCOTIA o , o , W 60 52, N45 39 Altitude and Azimuth … | |
Hi! I'm trying to program a monthly calendar.... but I can't get the weekdays for the nth day of the year right... my problem is written further down in the code... [CODE]from time import * class Calendar: '''Skapar en kalender för varje månad''' def __init__(self, year, month): self.year = year … | |
Hello, I have written some python extensions and it seems to be causing a TypeError with numpy. Here is my code: [code=python] import Image, os, sys, gc, numpy, math sys.path.append("/home/halon/pyxtn") import spam2 def LoadImages(start, y_stop): """Open .tif images, append data to list.""" global image_data_list, number_of_channels for i in range(0, number_of_channels): … | |
I am fairly new to python.I am currently using python scripting.My problem is,I have some txt files from which i need to extract only words(characters) and remove digits,new lines and special characters(like ----, []) and store it in a another txt file with a different name. Please help. | |
Hi. I'm new user in ubuntu and I like very much the glade interface designer. I designed my first app and tryed to run it from python with this script: [CODE] #!/usr/bin/env python import sys import pygtk import gtk import gtk.glade class MainWindow: """ This is the main window """ … | |
Hi, Iam look looking some standalone python package for both in windows and linux. In windows py2exe tool serving my purpose,is there any similar tool i can find in linux.? Though most of linux machine having python installation,but some customized linux machines are not having python.If some body suggest me … | |
Hi I am a new user of python and I want to use command.getoutput as follows: val="/usr1/test/hello/ " date1 =commands.getoutput('ls -lrt $val | grep "LATEST" | cut -d ">" -f2 | tr -d " "') My problem is that I want to use "/usr1/test/hello/ " inside the command using variable … | |
i get to down as far as the tax equation and it won't run, any ideas?? from graphics import * def main(): win=GraphWin("Taxation Calculator",300,240) win.setCoords(0.0,0.0,3.0,4.0) #draw interactive entry boxes Text(Point(1,3),"Salary: ").draw(win) input=Entry(Point(2,3),5) input.setText("0000") Output=Text(Point(2,1)," ") Output.draw(win) Button=Text(Point(1.5,2.0), "Calculate Tax") Button.draw(win) Rectangle(Point(1,1.5),Point(2,2.5)).draw(win) #wait for mouse click win.getMouse() #convert Tax amount= eval(input.getText()) … | |
I'm planning on creating a simple password manager program. For the program I'm going to have an encrypted file which will the store the user's passwords. What is the most secure and best encryption module? cheers :) | |
im trying to use the .get() method to get all the text from a tkinter text widget. the code im using is [ICODE]text = root.textwidget.get(1,end)[/ICODE] i get the error "name error: global name 'end' is not defined" is there a word specficly for the end of the text or am … | |
Hello, I'm doing (post) #2 of 'Projects for the Beginner' and I used for making this the 'The Address Book Revisited' example on this [URL="http://www.freenetpages.co.uk/hp/alan.gauld/tutor2/tutfiles.htm"]page[/URL] The author says he even put in two errors on purpose. I have re-written the code and changed it more to a Code Library like … | |
Does Python have a built-in GUI kit? Meaning without using Tcl/Tk. Because, I'm developing for the iPod touch / iPhone, and I don't want to have the user need to install the Python and Tcl runtimes. | |
I'm new to GUI's and have has some trouble with the wx.lib.plot.py module. I can insert the graph panel into an app, but I can not get the panel to expand when the window is resized. I've read about the need to set the initial size, but... is this plotting … | |
Hi All, Newbie here - I am trying to write a program that will list out all the URL's from a webpage which I was able to successfully complete using the following script: [CODE] import urllib, urllister urladdr = raw_input("Enter URL here: ") usock = urllib.urlopen(urladdr) parser = urllister.URLLister() parser.feed(usock.read()) … | |
Hi, my friends, I have a question to ask you. I am dealing with thousands of csv files in one directory. Some of csv files are empty with file size 0. How can I skip those empty files when I open csv files otherwise it causes execution error? I have … | |
Hi Currently iam looking for one common script to work both in linux and windows target machines. The script what i going to write need to be loaded in CD and will be used both in Linux & Windows Machines. If I choose python as the script for my requirement … | |
Hi everybody. Mi first post: I'm trying to learn some python From CLI I run: python file.py [ICODE]import sys lines = 0 words = 0 chars = 0 for line in sys.stdin: lines = lines +1 words = words +1 chars = chars + 1 print lines, words, chars[/ICODE] I … | |
OK, so heres my code, check it out, let me know what you think, I'm trying to embed a serpenski triangle into it, and the program isn't crashing but it isn't displaying and I'm not sure why, if you can tell me it would be greatly appreciated. Also, I need … | |
I've made a program that can scan through a plain text document for the string "SA001:" and if it's not there, it ads it in at the top. But the problem comes with the saving to the document: It adds some things to the document that I don't know how … | |
I have a program that i need to start when my computer boots up. Is there any way to do this? Any and all suggestions would be great. | |
Hi, Im a novice in Python, using Tkinter for the GUI developement. I am trying to figure out how to create my frame such that you cannot exit using the title little 'x' in the corner. In fact I dont want it at all! I did try overriding it by … | |
Greetings I want to take part of a word remove it and then append something new. Here is my xml [inlinecode] <Symbols> <Item> <Symbol>UPS2008</Symbol> <Order>usg_05Y</Order> </Item> </Symbols> [/inlinecode] My python code should remove the 2008 in UPS and change it to 2009 (basically write to file with elementtree), except I … | |
What is the easiest or most elegant way to let the user input a list in a console program? | |
hi ..... i'm designing a simulator and initially i have to click on the Tkinter interface to place a small oval(dot).That is the initial point where i want the simulation to start. can anyone please help me or if possible give me the piece of codes here is my code.... … | |
Hi!! Actually,i am doing a simulation and i want a dot (small oval) to pop up when i click(by mouse) on the canvas. can anyone please help me or if possible give me the piece of codes to perform this. thanks in advance... | |
My first attempt at programming using Python was to make a calculator for an online game I play called AstroEmpires. The user can input the number of bases they have, the shipyards on each base and the base's production value. They then tell the program which ship they wish to … | |
hi everybody...can anyone please help me on this...i have a gui in wxpython. it works perfectly on windows (i've a dual boot comp). but when i run the same code on ubuntu-gutsy it crashes with the followin msg... /gui$ python App2.py python: /build/buildd/libcairo-1.4.10/src/cairo-surface.c:990: _cairo_surface_release_dest_image: Assertion `!surface->finished' failed. Aborted (core dumped) … | |
I need to write a program that runs in the background without a gui window or a console window. It also needs to recognize when a key is pressed. Is there any way to do that? And if yes, then how? Any and all suggestions would be great. thanks. | |
Hey guys, recently I started playing around with pygame. Right now im making a little orb move when you hit a key. But its stuck with the image loading! [CODE]background_image_filename = 'C:\\orb\\backroundorb.jpeg' sprite_image_filename = 'C:\\orb\\orbsprite.jpeg' import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), … |
The End.