15,181 Topics

Member Avatar for
Member Avatar for skaliam

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?

Member Avatar for griswolf
0
102
Member Avatar for yeticannotski

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

Member Avatar for yeticannotski
0
289
Member Avatar for woofers

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 …

Member Avatar for woofers
0
142
Member Avatar for Evicake

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

Member Avatar for Evicake
0
373
Member Avatar for nima3188

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 …

Member Avatar for nima3188
0
128
Member Avatar for Tommymac501

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

0
54
Member Avatar for altXerror

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 …

Member Avatar for richieking
0
116
Member Avatar for woofers

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 …

Member Avatar for woofers
0
152
Member Avatar for ddndd

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 …

Member Avatar for Gribouillis
0
16K
Member Avatar for rssk

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

Member Avatar for snippsat
0
129
Member Avatar for hema dhevi.N

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for dougn

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

Member Avatar for dougn
0
161
Member Avatar for Thisisnotanid

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 …

Member Avatar for teedoff
0
602
Member Avatar for pixeldroid

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 …

Member Avatar for richieking
0
156
Member Avatar for kailashbuki

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

Member Avatar for TrustyTony
0
188
Member Avatar for fredfredfred

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

Member Avatar for TrustyTony
0
138
Member Avatar for r3bol

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.

Member Avatar for richieking
0
77
Member Avatar for _neo_

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

Member Avatar for Gribouillis
0
10K
Member Avatar for Hoff123

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 …

Member Avatar for Hoff123
0
105
Member Avatar for iwanttolearnc

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 …

Member Avatar for shibby
0
927
Member Avatar for JJHT7439

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 …

Member Avatar for JJHT7439
0
146
Member Avatar for skaliam

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 …

Member Avatar for TrustyTony
0
201
Member Avatar for vbx_wx

How can i get the content of a pop-up(that has no adress) from a specific website?

Member Avatar for group256
0
70
Member Avatar for Hodir

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 …

Member Avatar for TrustyTony
0
168
Member Avatar for lewashby

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, & …

Member Avatar for richieking
0
78
Member Avatar for Stefano Mtangoo

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 …

0
55
Member Avatar for FAITH2011

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

Member Avatar for richieking
0
150
Member Avatar for -ordi-

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

Member Avatar for TrustyTony
0
178
Member Avatar for inamabilis

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 …

Member Avatar for inamabilis
0
2K
Member Avatar for FAITH2011

The End.