15,181 Topics
| |
hi all, im new to python, and i have a problem that needs to be solved. i have the following set: [[5,5,5],[5,5,5,5,5],[]] which needs to end up being: [[5,5,5,5],[],[5,5,5,5]] has anyone got any suggestions? | |
Dear All, I am a total newbie to Python and programming in general. I know I'd find more materials for Python2, but Python3 was a reflected choice. That said, I have gone trough: [URL="http://www.daniweb.com/forums/thread173960-2.html"]http://www.daniweb.com/forums/thread173960-2.html[/URL] and tried to assemble my spell checker, and ended up with the following code: [CODE]#!/usr/bin/python3 # … | |
I have written a client server program in which the server sends a program to the client, and the client executes the received program. In this case it is a line drawing program in OpenGL. The problem is that on running the server and client the whole program i.e. sending … | |
Hello, I recently started writing a small program for reading multiple xls files from one directory. While reading one file like this,works perfectly: [CODE]wb = xlrd.open_workbook("C:\\path\\FileName.xls") sh = wb.sheet_by_index(0)[/CODE] this one doesn't: [CODE]os.chdir("C:\\path") for fileName in os.listdir("."): wb = xlrd.open_workbook(fileName) sh = wb.sheet_by_index(0)[/CODE] I keep getting the same error: [COLOR="Red"]XLRDError: … | |
Hi I want to write some variables into a file to be readable by excel. I used a loop like this to write the calculated "x" variable into the file. It works but the problem is that I get all the numbers in one line. I'm wondering how can I … | |
I have an app that allows my users to pop up a file of any size and look at the top 10 (or more) records, or, offset to any starting point and view a batch of records. I would like to put this app in some sort of Web page, … | |
sorry for the noob question. i'm new to python. i'm trying to learn about classes and def. i created a simple one here called test2.py [CODE]class test: def Test1(T1): T1 = "this is a test"[/CODE] i have another python file, which is the main program called test1.py [CODE]from test2 import … | |
I tried executing a simple line drawing program using exec(). It worked fine. But when I tried to execute the same program by sending it through a tcp/ip network(the server reads the program and sends it to the client which receives it to a variable(b) of string type) and then … | |
hi .. im trying to terminate a process so in python i used os.system("taskkill /IM notepad.exe/T" and os.popen("taskkill /IM notepad.exe /f") neither have worked since the process does close but start up again !! on SOME computers it did work, the process was terminated but on others it did not … | |
hi all......... a1 a2 a3 a4 a5 a6 b1 b2 b3 b4 b5 b6 c1 c2 c3 c4 c5 c6 d1 d2 d3 d4 d5 d6 i want to select a column and i need a output like a1 a4 b1 b4 c1 c4 d1 d4 | |
hai friends i am 5 days old in learning python programming. I know perl for limited usage. I have a doubt regarding getting input in list during run time. is there any other way in python than typing like ["hi","hello"]. why it is not possible to insert value as we … | |
Hi, Is it possible to save the contents of a RichTextCtrl with the formatting? I'm writing a text editor to learn wxpython and when I use the SaveFile method it saves the data as plain text. PrintFile works the same. Doug | |
Hi everyone, I'm working on a website and need some help. I'm really not experienced with this stuff and I'm using wix with some borrowed html snippets. I wanted to use a vectorized image as a background that would scale to fit the browser on any screen as best as … | |
Hello: I am building a UI using Python in Maya, a 3D app. I have a panel in which I want to assign commands to buttons which are created in a loop. The commands have an arg, which is derived from the loop. Using lambda, the button commands all get … | |
I have a string as below [CODE]"i am genie. who are you? we worked together in a hotel called xsis."[/CODE] Normally string like the above is cleaned. Cleaning involves removing whitespaces. Thus the cleaned version of the above string would be [CODE]"iamgenie.whoareyou?weworkedtogetherinahotelcalledxsis."[/CODE] It is divided into kgrams of fixed size. … | |
hi i am a bit of a noob at python but am trying to make a desicsion making game (a bit like zork). i was wondering if anyone knew how i could get the palyer to go to a previouse part of the game without writing it all out again? … | |
While googleing for an answer I came across this thread... [url]http://www.daniweb.com/forums/thread55451.html[/url] ...which is pretty much my question, but I would be doing it in web directories. Would I need to connect with something like urlib2 and then try the os and glob examples. Maybe an example please? :D Thanks. | |
I have string like: 'par1=val1,par2=val2,par3="some text, again some text, again some text",par4="some text",par5=val5' I have to split it to parts like: par1=val1 par2=val2 par3="some text, again some text, again some text" par4="some text" par5=val5' I use this code: [CODE] a = 'par1=val1,par2=val2,par3="some text1, again some text2, again some text3",par4="some text",par5=val5'.split(',') … | |
Hi, this is my first post. I am making my first real text based adventure game in python and I've got an error: unbound method Main() must be called with Game instance as first argument (got nothing instead) But I am no where nere finsihed on the game as of … | |
im trying to create a program that reads a text file and plots the data using matplotlib. however, what i want to do is subdivide the each major y-axis display into 10 smaller segments. ive tried matplotlib.pyplot.yscale but i cant seem to quite get the hang of it. any help … | |
I was just playing around in python trying to get a basic sort of linked list working. I was able to make a simple linked list using an article I read online that looks like this: [CODE] class node: def __init__(self, value = None, next = None): self.value = value … | |
Hi, im quite new to python and I am trying to extract some data from a csv file and put it into a new file, this is the first line of the data: 1,3,0,1,2,2,1,13,19,30,13,10,20,+1 I have managed to get it to print a new line per column, but i need … | |
How can i get the content of a pop-up(that has no adress) from a specific website? | |
Hey guys, i have a problem with reading csv files. I have a csv file which i would like to read and save to a dictionary. Preview of the file: mpg;engine;horse;weight;accel;year;origin;cylinder 18;307;130;3504;12;70;1;8 15;350;165;3693;11,5;70;1;8 18;318;150;3436;11;70;1;8 16;304;150;3433;12;70;1;8 and so on.. The way that i would like it to save is basically for … | |
movies = [ "The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91, [INDENT]["Graham Chapman",[/INDENT] [INDENT][INDENT]["Michael Palin", "John Cleese", "Terry Gilliam", "Eric Idle", "Terry Jones"]]][/INDENT][/INDENT] print(movies[4][1][3] = Eric Idle Could Someone please explain how it counts from the outer loops through the inner loops With the number 4, 1, & … | |
Hi All, after almost a year, I'm back to Pythoning again! Now I want to setup my Ubuntu Box with LAMPP to work with Django. In PHP I just put my files in www folder and there it is! Please help me setup Django sites. Thanks and Happy new year … | |
Hi cannot get images to load any help would be gratefully recieved... [CODE] import pygame import sys from pygame.locals import * sys.path.append ("C:\\Python26\Bits\player.png") ###Will not Load saved image #triedC:\Python26\Bits\player.png # and tried C:\Python26\Bits #confusing or what!!! #Whole program not here # set up the window WINDOWWIDTH = 400 WINDOWHEIGHT = … | |
[CODE]from copy import deepcopy sis = file("teedtest.01.sis", "r") val = file("rp.val", "wt") N, K = map(int, sis.readline().strip().split()) alist = [] for i in range(0, K): t = [] for i in range(0, K): t.append(0) alist.append(t) for i in range(K): a, b, c = map(int, sis.readline().strip().split()) alist[a][b] = alist[b][a] = c … | |
Hi All, Been coding Python on and off for a year now, but only just started looking at wx. Got a problem in a larger project I'm working on, trying to remove all items from a GridSizer - I've created the following test code to demonstrate the problem, but to … | |
The End.