15,406 Topics

Member Avatar for
Member Avatar for fingerpainting

Here's what I'd like to do as an exercise to improve my Python and to play with the idea of genetic programming in basic form. From within a script, I'd like to spawn a number (1000?) of additional scripts with randomly generated but grammatically sane Python related to a very …

Member Avatar for TrustyTony
0
198
Member Avatar for Teamo1234

write a piece of code that ask the user to set a password - queries the user for his/her user name - queries the user for his/her password twice, making sure the user enters the same password twice - Allow Only 3 attempts to get a correct password the rules …

Member Avatar for Enalicho
0
253
Member Avatar for aragonnette

hi , i want to sort my two merged iterable with heapq. everything is good but in result which starts with Turkish character locate end of all result. exm: Ö,Ş,İ ... locate end of result how can i solve this problem?

Member Avatar for TrustyTony
0
347
Member Avatar for g_amanu

my excel files have more than a 1000 numbers under the columns that are labeled x, y, z for each excel file. i was trying to print the x, y, and z values for all of the excel files in to a single excel file(Trying_excel.xls)that would have all of the …

Member Avatar for g_amanu
0
2K
Member Avatar for g_amanu

im trying to calculate the average and std for x, y, and z column for about 50 excel files that i saved in a folder. each excel files has x values in the first column, y in the second, and z in the third column. im using this script, but …

Member Avatar for Gribouillis
0
1K
Member Avatar for casper1

I'm new to python ,please tell me the way to write a program using python , to convert any decimal number into octal number(base 8) (using python 2.7)

Member Avatar for casper1
0
234
Member Avatar for Tcll

I'm currently working on a 3D model previewer for another program of mine... I've currently gotten it drawing the verticies and zooming... when zooming, it basically redraws the scene... I've currently got it redrawing using a for loop (clearing the scene before it redraws) this method is a bit slow, …

Member Avatar for Tcll
0
100
Member Avatar for hughesadam_87

Hi all, I have built a small event handler to zoom in on a graph on pyplot figure, and then I use the builtin pickline event handler to select a line. I plot multiple lines from a large dataset of ordered series, so when I choose one, I need my …

0
56
Member Avatar for Ene Uran

Just a simple console blackjack game. The bread and butter code was written with lots of comments, so you can improve on it. Really, the most important part is figuring out when an ace is 11 in value and when it is a 1 in value, so you don't bust.

Member Avatar for s4bb4t
1
8K
Member Avatar for Tomashqooo

[CODE] from tkinter import * ... program ... frame = Frame(width=640,height=480) frame.pack() ...program... #now to change the frame size frame.configure(width=800) [/CODE] doesn`t work ... I tryed from.config() too but it doesnt work

Member Avatar for TrustyTony
0
166
Member Avatar for braveahmat

i am beginer in python my problem is : i wont to use dll written by c# in python,(call dll in python) the name of dll is DllUmorpheme. public string LastSegment(string Input) member of AutoSegToMorph.Umorpheme AutoSegToMorph is namespace Umorpheme is a class LastSegment is method of this class how can …

Member Avatar for TrustyTony
0
51
Member Avatar for Simplicity.

Dear All, When I call the function "G()" which returns two values: p_T and q_T twice but using the same style, that's, P_T, neg = G(); U, Ign = G() and print sums of P_T and U, I get two different answers! Another thing is that both answers are incorrect! …

Member Avatar for TrustyTony
0
135
Member Avatar for Neilzepan

[CODE] Powering the DeLorean You're the proud new owner of a DeLorean sports car. DeLoreans are best known for being able to travel through time. You can't wait to try it out, you've already started listing all the different times you are going to visit. You have written down the …

Member Avatar for TrustyTony
0
122
Member Avatar for sravanthi89

I have to create a list with a menu options for 1. Add, 2. Remove, 3. Check if element exists, 4.Display list, 5. would you like to Continue? 6. Exit I could write the code so far. Pls help me complete it. (ASAP) [CODE]fruits = ['Apple', 'Banana', 'Grapes', 'Peach'] #while …

Member Avatar for sravanthi89
0
78
Member Avatar for Simplicity.

Hi All, I want to make the output "u = u + alpha*d_k" at the very end of this code an input, i.e., as an argument of the function "f(u)" at the beginning of the code, in every iteration. Note that I have posted only part of the code which …

Member Avatar for Simplicity.
0
161
Member Avatar for FutureDev86

I have to make this program track how much fuel I have used. I have tried and tried, but I can't get it to work... I'm not at all looking for a solution... I just need a nudge/hint into the right direction. [CODE] def main(): choice = 0 ammo = …

Member Avatar for TrustyTony
0
323
Member Avatar for NimmyJoby

Hi All, >I am new to using python > By using the below code am not getting the complete path of the file > > <script language="javascript" type="text/javascript"> > function getvaluetxt() > { > var str = > document.getElementById('file').value; > alert(str); > } > </script> > <body> > <form action="/" …

Member Avatar for g_amanu
-1
157
Member Avatar for zachf632

Is it possible to have a python program communicate to a java program over the internet? Like could i send text over sockets from a python program and have a java program receive it.

Member Avatar for NormR1
0
74
Member Avatar for Srin

I wanted to install a GUI toolkit for python and pyqt looked good but when I install the complete binary on the pyqt site and run designer, I get this error when I try to go to the code [IMG]http://i167.photobucket.com/albums/u154/Final_04/pyqtdesignererror.png[/IMG] Anyone know how to fix it? And if not, can …

Member Avatar for nabla2
0
570
Member Avatar for hughesadam_87

Hey everyone, I'm in the process of writing a data analysis program with a full GUI. The program is turning out to be quite useful for the spectral analysis we do in our lab, so I'd like to share it with my colleagues. Perhaps if it catches on, I would …

Member Avatar for hughesadam_87
0
405
Member Avatar for Nachodsk

[B]Hello everyone! I'm really un-patience to get started in creating my own game, mean Text-Based game with python language. But first i want to make it simple to don't use much words for this question.. ¿Which is a really REALLY good book to start learning python? I mean, i know …

Member Avatar for Nachodsk
0
236
Member Avatar for fortozs

I am new to Python and I'm trying to make a simple updating window. Most suggest I should use wxtimer for the task. I have tried to get it going but it fails. Here is the code without a timer that works for me. I had been using time.sleep in …

Member Avatar for fortozs
0
951
Member Avatar for kur3k

Hello, I have a question about wx.ListCtrl. How i can add to cell resize image ( 300, 500 for example ).

Member Avatar for snippsat
0
60
Member Avatar for jbrandon52

I'm having a hard time figuring out the best way to approach this problem. Security is not much of a concern in this particular setup, but performance is. I have a script that will Telnet to a telecommunications switch and run a series of commands, display the output, and logout …

Member Avatar for Gribouillis
0
469
Member Avatar for vmars

Greetings, I am stepping thru the "Changing a PythonCard Application" @ [url]http://pythoncard.sourceforge.net/walkthrough1.html[/url] With NO changes, pgm runs fine. But when I make the change and run it program just Flashes a Console screen and immediately ends. Can someone spot the error? #!/usr/bin/python """ __version__ = "$Revision: 1.8 $" __date__ = …

0
102
Member Avatar for Cyph0n

Hello everyone. Today I decided to write a little Caesar cipher script in Python. After tweaking the code and testing it, I shot up my browser and had a look at other snippets on the web. I was shocked at what I saw. All of the Python solutions I went …

Member Avatar for lrh9
0
246
Member Avatar for simulacrx

Hi all ; [ICODE]ask=raw_input("type the query: ") [/ICODE] when i type [ICODE]23+9[/ICODE] after this; i wanna get '32' result.. like ; [ICODE]>>>type the query: 3+5 >>>result : 8[/ICODE] this is what i want.. thank you..

Member Avatar for Gribouillis
0
248
Member Avatar for JoshuaBurleson

So I've finally fixed up the functionality of an address book I've been writing (not on to utilizing a GUI yet of course though.)However to save or reclaim the data from the last use of the address book I, obviously, need to write and reclaim it from a .txt file, …

Member Avatar for JoshuaBurleson
0
252
Member Avatar for g_amanu

i have about a 1000 excel files that have data sets.it was collected from about a 20 patients. so i have a script that reads data sets for each patient from all of the excel files. im having trouble printing the values in separate excel files that each file represents …

Member Avatar for peter_budo
0
463
Member Avatar for Niles64

Hi OK, so I am reading on OOP in Python, and I am an old C/C++ programmer so I have somewhat high expectations :). My question is regarding private/public variables. Per default, all class data members are public, but if we precede them with a double underscore, they become private. …

Member Avatar for TrustyTony
0
208
Member Avatar for Caraka

I am having trouble structuring an sqlite update statement that has multiple parameters. The following code does not raise an exception, but nor does it update my table. After extensive googling and searching Daniweb, I think I'm looking right at the blindingly obvious and missing it. I have a list …

Member Avatar for Caraka
0
4K
Member Avatar for Niles64

Hi Everything in Python is treated as an object, so [CODE] i=5 i.imag [/CODE] makes sense, i.e. the variable [I]i[/I] has some associated methods. But why doesn't the following example work? [CODE] 5.imag #error [/CODE] One would think that it should work, since the integer "5" is an object just …

Member Avatar for Niles64
1
117
Member Avatar for TrustyTony

As [URL="http://www.daniweb.com/software-development/c/threads/377568/1625821#post1625821"]Goddess Narues' C code in C forum[/URL] was over my head and her critique of simplistic solution maybe overflowing the integer range was valid in C, I worked out a recursive solution more suitable to my brain in my preferable language. Maybe one day I put in C, now …

0
270
Member Avatar for jkrueger

Thought all of the following was handled and not: 1) python runs script which opens file and prints to screen OK 2) when cx_freeze distilled script is run it reports file to open is not there, when it is 3) the distilled script can be run from a term with …

Member Avatar for jkrueger
0
186
Member Avatar for Kleiner

Hi. I am working on improvement of my program. Here is it's code. [CODE]import wx class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "Testing erea", size=(280,400)) panel = wx.Panel(self) food = wx.Button(panel,label='Food',pos=(10,10),size=(80,40)) drink= wx.Button(panel,label='Drink',pos=(100,10), size=(80,40)) self.Bind(wx.EVT_BUTTON, self.drink, drink) self.Bind(wx.EVT_BUTTON, self.food, food) def food(self, event): box = wx.TextEntryDialog(None, 'What is …

Member Avatar for darkmikey
0
693
Member Avatar for saransh60

[code] class List(): def __init__(self,values=0): self.numb=values self.linker=self def add(self,values): self=self.linker self.numb=values self.linker=List() def show(self): while self!=self.linker: print self.numb self=self.linker [/code] In main call i want some thing like this [code] list1=List() list1.add(43) #i want to add numbers to liked list node like this list1.add(22) list1.add(938) list1.show()#Then retrieve it from the …

Member Avatar for jLocke
0
285
Member Avatar for justin96b

So, i am trying to have an explosion when the asteroid and house collides. And i think i have the code written down, but something might me be missing. Please help me figure this out. Thanks a lot. [CODE]# Fresh Start # Classes: House; Asteroid; Explosion from livewires import games …

Member Avatar for TrustyTony
0
273
Member Avatar for noony4

im supposed to be writing a python script that enables receiving SMS (GSM), on the hyper terminal i used the same AT commands i wrote in the script and they worked just fine, but when i download the script on the GSM module ( GT863-PY ) i get nothing at …

0
78
Member Avatar for rogersjw

Hi all, This is my first post here so please bear with me. I am trying to get my QGraphicsView widget to output as an image. I have the following code. [CODE] def outputImg(self,dir=None): if dir == None: dir = os.getcwd() img = QtGui.QImage(self.size()) print img.isNull() # This == True …

Member Avatar for rogersjw
0
172
Member Avatar for Lebowski

Edit: The title could have been more descriptive, I am sorry for that! Hello! First time poster, frequent reader. I am very green to both programming and python, trying my best and this board has been helpful just by reading. Now, I have a problem of my own that I …

Member Avatar for TrustyTony
0
411
Member Avatar for rscubelek

Hey guys, my name is Robert Scubelek, I've been lurking around these forums for a couple of weeks now, and have found more answers here than anywhere else on the internet, so I figured that its about time to become a member and try to contribute something. I'm in the …

Member Avatar for happygeek
0
309
Member Avatar for samuel16

how can we use the same condition by using the iteration for the numbers automatically? Like 1 after 2. 2 after 3. till 50?

Member Avatar for Enalicho
0
122
Member Avatar for rahulroshan

Hi Can anyone share Python Study material slides.. It will be really helpful for me ,Plz

0
61
Member Avatar for Gribouillis

How to create a png image containing a fragment of source code ? Well, don't do it yourself, the [url=http://pygments.org]pygments module[/url] contains all the necessary tools. The example below shows how to produce a png image from python code, but pygments supports lexers for many other languages and its formatter …

1
517
Member Avatar for rahulroshan

Hi I have made a python code for running an operation on a csv file ,But when i am getting error ie:the csv file not found, where should i save the csv file

Member Avatar for TrustyTony
0
98
Member Avatar for holloway

I'd like to change a Python shortcut icon, to make it custom in my standalone applications. Any ideas? Thank you in anticipation.

Member Avatar for rahulvramesh
0
117
Member Avatar for rahulroshan

Hi I have a CSV file with column headings as [Serial Number,Reader Name,Book name,Author,Publisher] I want 1)To filter all books with Book name :'Aristotle' 2)to remove duplicates in books with same author name ie.Different Publishers 3)To take a sample of 30 books for Each Reader and copy it to a …

Member Avatar for rahulroshan
0
115
Member Avatar for user45949219

Hey guys, I've been fiddling around with Tkinter for a bit and can't for the love of me figure out why this code won't work. I'm making a GUI that outputs the price of a product depending on what buttons the user pressed. I have three calculations that revolve around …

Member Avatar for Gribouillis
0
158
Member Avatar for luofeiyu

1.[url]http://www.renren.com/Login.do[/url] it is ok,my code: import cookielib, urllib2, urllib cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) exheaders = [("User-Agent","Mozilla/4.0 (compatible; MSIE 7.1; Windows NT 5.1; SV1)"),] opener.addheaders=exheaders url_login = 'http://www.renren.com/Login.do' body = (('email',' '), ('password', ')) req1 = opener.open(url_login, urllib.urlencode(body)) file=open('/tmp/sample','w') file.write(req1.read()) file.close() 2.[url]https://passport.baidu.com/?login[/url] can't login,my code: import cookielib, urllib2, urllib …

-1
89
Member Avatar for Kleiner

Hi. I am having a problem in creating of one simple program in Python. Here is code. [CODE]import wx class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "Testing erea", size=(280,400)) panel = wx.Panel(self) food = wx.Button(panel,label='Food',pos=(10,10),size=(80,40)) pets = wx.Button(panel, label='Pets', pos=(100,10), size=(80,40)) self.Bind(wx.EVT_BUTTON, self.food, food ) def food(self, event): …

Member Avatar for Kleiner
0
284

The End.