15,194 Topics
![]() | |
Hi guys, I have a friend at school and she's taken Unix 2. She gave me a copy of her work assignment so that I could improve my scripting skills (Still a begginner at python and programming). This is the assignment: Write a script that will prompt the user to … | |
Hi, I am new to python and new to this forum. So how are you all? What I am trying to do is create a script editor, with syntax highlight and unicdoe support. It doesnt need to link to ANY compiler, it simply have to display my script with highlights, … | |
I am working to increment lists in such a way that each item in the list is incremented incrementally, it sounds confusing but its not: If the user inputs: [CODE]list = [1, 2, 3, 4] [/CODE] I want the output to be: [CODE]2, 4, 6, 8[/CODE] in essence, the first … | |
does anybody knows why this function doesn´t work very well: f=lambda n: reduce(lambda x,y:x**2+y**2, map(int,str(n))) I want that this function add the square of the digits of a number an example of what i want: f(442)=4**2+4**2+2**2=36 and it's giving me f(442)=1028!!!:S However fou numbers with 2 digits the function works! | |
I have a string that loks like "u'mystring'". i'm wondering if ther is a easy way to remove the u'' part of the string? | |
[B] Have someone ever implement game of life without using cell??? just using a plain interface like tkinter and rectangle. [/B] | |
Hi Guys, I have a nested dictionary that i would like to be populated from a file at the start of my prog and put back into the file at the end of the prog. Could anyone direct me to somewhere where i could get info on how to do … | |
Hi, I am using Python 2.4.4 and: from numpy import * from MA import * I am using masked data in arrays and functions: average, min and max. When the last item of an array is masked, I am getting "masked" results for min and max functions, even if there … | |
Hi All, Currently Iam writing python ftp script to upload a file to FTP Server. The server where iam going to download a file expects the upload command in this format "put <filename> flash" I dont know how to send this same command in ftp session after login. I have … | |
Well I got past most of the problems with my boxlets application. I wanted to hear what people think of the functionality and if they have any input/suggestions. Known issues: * When you already have applications open, their boxlets pile up on top of each other. Remember, this software requires … | |
I have a server with access to 9 different IP addresses that I want to use for different purposes and I wish to keep them separated. I am going to be doing my work using UrlLib2, is there a way I can specify which IP address I am using through … | |
I am trying to manipulate user input strings using the ord() funtion. This effectively allows me to identify the decimal value of each character in the string. I have been able to return the value of the characters, but what I need to understand is how to store each value … | |
Hey guys, sorry for this, what im sure is simple, but i just cant get it! i have a dictionary for restaurants.. then i have nested dictionaries holding information like when these restaurants open and close. [CODE] Restaurants = { 'Italian' : {"OpenTime" : "11:30", "CloseTime" : "20:30"}, 'Mexican' : … | |
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 … |
The End.