Search Results

Showing results 1 to 11 of 11
Search took 0.01 seconds.
Search: Posts Made By: slate
Forum: Python 4 Days Ago
Replies: 2
Views: 217
Posted By slate
Hello Democles!

Where is your sword? ;)
Or was that Damocles?

I think it is a difficult question, how someone learns a programming language.
I (and the Somerville book) would say, there are...
Forum: Python Oct 25th, 2009
Replies: 17
Views: 493
Posted By slate
You can use the observer pattern.


class Observed(object):
def register_observer(self,observer):
self.observer=observer
def notify(self):
self.observer.update(self)
...
Forum: Python May 27th, 2009
Replies: 5
Views: 338
Posted By slate
Well. If you have 10**6 lines with the structure of:
number;number;characters;number

Then, if the 10**6+1 th line contains a data like:
1;2;asd;jkle;3

Then your program will most likely crash.
Forum: Python May 22nd, 2009
Replies: 8
Views: 396
Posted By slate
Well, if you want the hard part...

Coming from a financial background I can assure you, that saving entries into a csv file permanently is a a bad idea. Unless the only purpose for this file is to...
Forum: Python Mar 16th, 2009
Replies: 5
Views: 493
Posted By slate
If the input is a "text" file and the replacement values are encoded the same way and has "reasonably" short lines, then the following will suffice.


params={'param1':1, 'param2':2}...
Forum: Python Mar 10th, 2009
Replies: 9
Views: 372
Posted By slate
Maybe I was not clear enough.

instead of this:

for disk in alldisks:
distance=mag((vector(pnewx,pnewy))-disk.pos)


use this
Forum: Python Mar 10th, 2009
Replies: 1
Views: 219
Posted By slate
Google is your friend.
http://www.google.hu/search?q=wxPySimpleApp(&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:hu-HU:unofficial&client=firefox-a

First url I get:...
Forum: Python Aug 18th, 2008
Replies: 3
Views: 526
Posted By slate
You can use subprocess with shell on unix.

http://blog.doughellmann.com/2007/07/pymotw-subprocess.html
And
http://www.python.org/doc/current/lib/module-subprocess.html
Forum: Python Jun 16th, 2008
Replies: 5
Solved: eval() problems
Views: 1,221
Posted By slate
Besides, that you do not have a "primary" module in the code...
Eval evaluates an expression in his own namespace and returns the result.
What you really want imho is to inject code.

Something...
Forum: Python Jun 8th, 2008
Replies: 2
Views: 440
Posted By slate
Well.
There are two kind of problems in the snippet. Is the algorithm good (gives the right result in a reasonable time), the other is if the program implements this algorithm.

The algo would be...
Forum: Python Jun 7th, 2008
Replies: 2
Views: 754
Posted By slate
THe line:

op = input(">")

Takes the input AND evaluates it. That means inputing "1" results in eval("1") which is int("1').
Putting in something like "a" results in the interpreter looking for...
Showing results 1 to 11 of 11

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC