15,181 Topics

Member Avatar for
Member Avatar for php.mca

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

Member Avatar for php.mca
0
74
Member Avatar for trihaitran

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 …

Member Avatar for G-Do
0
114
Member Avatar for trihaitran

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 …

Member Avatar for woooee
0
97
Member Avatar for roelandt

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

Member Avatar for woooee
0
98
Member Avatar for pythoxine

what is the best language-related python library, with support for spell checking (aspell?)?

Member Avatar for vegaseat
0
77
Member Avatar for G-Do

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 …

Member Avatar for jrcagle
0
195
Member Avatar for wolih

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 …

0
62
Member Avatar for nish88

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 …

Member Avatar for BearofNH
0
106
Member Avatar for Delta424

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 …

Member Avatar for Delta424
0
80
Member Avatar for zclevenger

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 …

Member Avatar for jrcagle
0
167
Member Avatar for lkk2116

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 …

Member Avatar for jrcagle
0
98
Member Avatar for rysin

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 …

Member Avatar for aot
0
182
Member Avatar for +--RagS--+

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 …

Member Avatar for +--RagS--+
0
106
Member Avatar for hacker9801

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 …

0
75
Member Avatar for abhinemo

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.

Member Avatar for woooee
0
72
Member Avatar for dagray

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 …

Member Avatar for woooee
0
79
Member Avatar for StepIre

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 …

Member Avatar for StepIre
0
198
Member Avatar for mmxbass

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 …

0
179
Member Avatar for mmxbass

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 …

Member Avatar for mmxbass
0
103
Member Avatar for nirmalarasu

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

Member Avatar for Duoas
0
148
Member Avatar for nirmalarasu

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 …

Member Avatar for nirmalarasu
0
1K
Member Avatar for gawain_

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 …

0
61
Member Avatar for turnerca902

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 …

Member Avatar for turnerca902
0
730
Member Avatar for KomodoM

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 …

Member Avatar for KomodoM
0
114
Member Avatar for arkane

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

0
56
Member Avatar for enigmaenigma

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.

Member Avatar for enigmaenigma
0
83
Member Avatar for wolih

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

Member Avatar for wolih
0
131
Member Avatar for nirmalarasu

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 …

Member Avatar for G-Do
0
2K
Member Avatar for abhinemo

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 …

Member Avatar for abhinemo
0
89
Member Avatar for gusbear

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

Member Avatar for jrcagle
0
113

The End.