15,181 Topics
| |
Hi All, I am very much new to python.I need an application to generate password protected pdf. Can anyone help me out? Thanx in advance Dushyant Joshi | |
Hi, I've got about 10 functions that all share a bit of code. They all look something like this: [code=python] def func(arg): statement1 statement2 statement3 unique code statement4 statement5 [/code] Each function does similar statements at the beginning and end, but has unique stuff in the middle. Is there a … | |
Hi, My problem is that I have a large function with hundreds of lines. I want to break it apart into smaller functions. The issue is that if I make a module level function, the scope changes and I have to pass the necessary variables to it. This can be … | |
Hi I'm new in python and i'm do not understand why my code is not working. I want to generated random figures with this code: import random import division a1 = '' a2 = '' def zufallsZahl(a1,a2): a1 = random.randint(1,10) a2 = random.randint(1,10) print a1, a2 s1 = [a1, a2] … | |
what is the best language-related python library, with support for spell checking (aspell?)? | |
Hi all, I added a new script to the code snippets page. This time, it's a logic puzzle called "Petals Around the Rose." The goal is for you to infer what algorithm is being used to "score" rolls of five colored dice without peeking at the code. The snippet is … | |
Hi. I'm thinking about making a "gauge" to place in front of the taskbar (on windows) that measures RAM memory. How can I do that with python? It would be like some kind of "widget" but VERY small. about 44x32 pixels. I don't want no titlebars nor anything. Just like … | |
hi..... i want to make a simulation where it start with 1 dot and its continues to propagate like the figure below. [B] . inital dot ... ...... ........ [/B] can anyone please tel me how to do it or give me the pieces of codes needed to do this … | |
I am a begginer at python and only know the very basics. I was wondereing if anyone was experienced at Python and had any time to help a begginer. As far as first projects go I wanna make a program that can generate random numbers, letters, or words (in 3 … | |
I have just started using python and am stuck on a particular project. I have been stuck staring at my computer not knowing what to do. I will post details below. What I am trying to do is use a CSV file named country.csv in which information about countries is … | |
I am new to python. Infact started yesterday and feeling out of place. I need to write a program which would transfer files under one folder structure (there are sub folders) to a single folder. I was going through COPYTREE in shutil. But some how I am not able to … | |
I want to make a program that prints how long it has been running. I tried this [CODE] import time b = time.tick() print b[/CODE] Even if this did work it wouldnt do what I want it to do. I basically want it to tell me how long the program … | |
Hello, I'm using a askdialog box from tkinter with a form. My problem is when I use "print" or "return" to get the selected directory it prints it to the terminal (if open) and I would like it to print to an Entry textbox. For example: [code=Python] from Tkinter import … | |
I'm using MySQLdb. Alright, I'm doing [code=python]import MySQLdb as mysql db = mysql.connect("localhost", "root", "password", "database") cu = db.cursor() rows = cu.execute("INSERT INTO users (user, pass) VALUES ('test', 'test')") print "rows affected:", rows cu.close();db.close()[/code] Well, what happens is, it gets executed and prints "rows affected: 1" BUT when I check … | |
I am a mew user of python.And I want to run following command in python perl test.pl -testconfig <config file> > test.log 2>&1 Can anybody help me. | |
The code will read in a file and build a table with the ctn_no and seq_no which works fine. I want to change it so that when I find a break mark I build a table of ctn_no + 1 and seq_no + 1 rather than a table of ctn_no … | |
Hey guys, im trying to extract the top 10 links from a yahoo search results page. i can get all the links using the code below.. but that could be 70 links. Any idea how i could get just those top 10 ranked ones? and not the adverts etc. ie … | |
How can I make my pygtk windows switch to another workspace. I'm working on a box-oriented task selector and I need my boxes to follow windows to their new workspaces when they change workspace. This is my code thus far: [code] import wnck import pygtk pygtk.require('2.0') import gtk import gobject … | |
I am trying to make a box-oriented task selector similar to the style of nextstep. I am currently having problems painting the box background and application icon onto my window. If I just use a normal gtk.Image widget it works fine, but that won't let me have both the box … | |
Hi, I would like to know whether linux installed as default in all flavors of linux (redhat,suse) or in customized linux distributions. is not so is there any other script to be supported in all linux distributions? thanks | |
Hi , Currently i am writing telnet python script for connecting remote server. I would like to save the telnet session activites in a file. Is there any better way to grap the remote output in a local machine file. example Login: --------- Password: ********* Login successful --> show port … | |
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()) … |
The End.