Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
11
Posts with Upvotes
8
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
~29.9K People Reached
About Me

I am a self-employed travel agent in Namibia who spends a great deal of time developing website, for myself and other, and I have a general interest in programming. I work mainly with Python, and use the Django Web Framework now for all my website work.

Interests
Nature, computers, kids, and I would love to fly
PC Specs
Linux Ubuntu (10.04, sometimes others just for kicks) Windows for website testing
Favorite Tags

47 Posted Topics

Member Avatar for Namibnat

I am still trying to get a grasp on the php/mysql interaction. Why does something like this not work and without all the error catching, can one do something like this? [CODE] $result = mysql_query("SELECT * FROM stadium WHERE gametime = `$_z`;"); $row = mysql_fetch_row($result); $bababa[name] = $row[0]; $bababa[town] = …

Member Avatar for guruparthi
0
725
Member Avatar for laung

Maybe something like this: [CODE]option_input = raw_input(">>> ").upper() if option_input == "V": print "High Scores:\n" saveFile = open("scores.txt", "r") scores = saveFile.readlines() for line in scores: if "," in line: userScore, userName = line.split(',') print "%2s, %s" % (userScore, userName.strip())[/CODE] At the end of the program you're assigning the variables …

Member Avatar for TrustyTony
0
192
Member Avatar for khakilang

I only use Linux. My main work station runs Ubuntu 10.04 (although I'll move up soon - 10.10). I have some old computers around just for playing with and for my kids. On those I play around with other Linux distros - just to learn or see how they work …

Member Avatar for Unbidden Ghost
0
153
Member Avatar for Namibnat

I am new to working with Django, and have found it really fun and interesting to develop with. But I have been trying to upload it to a hosted server and just not getting it to work. I have followed the instructions they give, but just not getting it to …

Member Avatar for Namibnat
0
223
Member Avatar for playonlcd

Okay, I think I have the whole thing working for you. I have left the file paths as I had them on my system (working on Ubuntu Linux). Just change them for your system. I have spent a couple hours figuring this out and so I haven't commented very well. …

Member Avatar for playonlcd
0
174
Member Avatar for germ

Here is how you can approach it: create an empty list: [CODE]newVals = [][/CODE] First of all deal with the file. Open the file, read it to a variable (The hint vegaseat gave you - in the file.readlines()) and then close the file, you have the contents already in 'line' …

Member Avatar for vegaseat
0
158
Member Avatar for PinkStone

If you just want to find the file with the highest value, that should be simple if the files all have the same format. Something like this: [CODE]high = 0 for i in files: if i[2] > high: high = i[2] change_file = i [/CODE] Then you can just append …

Member Avatar for PinkStone
0
124
Member Avatar for Godflesh

There are a couple things to set right with your code first. n = random.randint(0, 99) for i in range(1): First, don't indent the `for i in ....` part. It is a code block itself. Second, why have a code block that loops once. Just drop it. The only loop …

Member Avatar for Godflesh
0
314
Member Avatar for Namibnat

Hello, if I start to distribute some software I have written under a copyright, using a free software license, I would like to know what do the dates of the copyright stand for. If I say (c) 2009-2010 Vernon Swanepoel, what does it mean that I did on those dates. …

Member Avatar for Namibnat
0
233
Member Avatar for ivh90

time.sleep() [CODE]import time x = 1 for it in range(5): x = x*2 time.sleep(x) print "Dude!...."[/CODE]

Member Avatar for Namibnat
0
59
Member Avatar for gangster88

[QUOTE=gangster88;1097025]thx for the help but how could i print the length of whatever the parameters are?.. like length("tree", "computer") and it prints out the string the with length?... this is what i dnt get[/QUOTE] [QUOTE]how could i print the length of whatever the parameters are[/QUOTE] Well, if you tried the …

Member Avatar for vegaseat
0
120
Member Avatar for punter999

I assume that you indented correctly when you tried the code on your own? [CODE]View = wx.Menu() ###the python gives on this line and held my system### self.shtl = view.Append(1, 'Show toolbar', 'Show Toolbar', kind=wx.ITEM_CHECK) view.Check(1, True)[/CODE] 'The Python' gives on this line due to the fact that you have …

Member Avatar for Namibnat
0
180
Member Avatar for Namibnat

One aspect of computers that I just don't find clear learning material on is networking. There seems to be loads of information on 'how to' but I still don't understand the underlying basics. What is meant by a Port? Why are ports numbered so strange (as in, not 1,2,3). I …

Member Avatar for Namibnat
0
124
Member Avatar for Godflesh

> I have a follow up question, i cant get a grip of this random stuff..:) > How do i change this code line > `del data_list[3:5+1]` > > so instead of removing specifik elements i want to remove random ones, amount of elements to be removed as well. > …

Member Avatar for Godflesh
0
100
Member Avatar for punter999

Put your code in code tags, and try to boil it down to what is going wrong a little. Your 'View' and 'view' should be the same caps.

Member Avatar for Namibnat
0
112
Member Avatar for deonis

I think it would be more useful to specify where this text is. If you are working with HTML it would be very different, say, from text in a gui app.

Member Avatar for deonis
0
13K
Member Avatar for Namibnat

Is there a way to incorporate a spell checker within a wxPython gui? I would like to be able to check the spelling of wx.TextCtrl values before they get posted to a sqlite3 database. I would imagine that the spell checker would be very os specific, but for me it …

Member Avatar for Namibnat
0
369
Member Avatar for Namibnat

Hi there, I would like to be able to change a button during the runtime of a gui. I can change the value no problem (set Label) but I need to change the size of the button as well. I have managed to change it with SetSize((120, 30)) but then …

Member Avatar for Namibnat
0
278
Member Avatar for mahimahi42

To give you a more simple answer, your problem with the player's score is that you keep resetting it. Why not just pass it in as a function argument. Your coding is a little strange...did you work with C before? I have just cleaned up what you have done a …

Member Avatar for jcao219
0
146
Member Avatar for redyugi

You had a few issues. Most significant, if you used raw_input instead of input you were getting strings instead of ints. You complicate things with the different functions. I would even take out the get_length() function and just pass that as a parameter to make_pass() and deal with it there. …

Member Avatar for redyugi
0
82
Member Avatar for rehber344

[QUOTE]why and where are we usıng None.whats the aım to use that[/QUOTE] Using None as a default value to a function is often useful to give different options. Here is a small example: [CODE]def zed(a, b=None): name = a.capitalize() if b: name = name + " " + str(b).capitalize() print …

Member Avatar for hondros
0
125
Member Avatar for GihanFernando

[URL="http://www.daniweb.com/forums/misc-explaincode.html"]Put your code in code tags[/URL]

Member Avatar for vegaseat
0
107
Member Avatar for fatalblade

Okay, I am on a linux system and so I haven't worried to much about the escape characters, but I think that what you were after is getting the prompt to change from C:\\ to D:\\ What you need to do is take the [icode]initial_drive = r"C:\\"[/icode] out of the …

Member Avatar for fatalblade
0
170
Member Avatar for wildplace

Wildplace, your code is rather strange. I think that you are trying to do something well above your level of knowledge at the moment. Perhaps the best thing you can do is get a good Python tutorial and work through the chapters on functions and object orientation. Anyway, lets look …

Member Avatar for Namibnat
0
105
Member Avatar for Adam2k

[QUOTE]I need your help with a simple program I'm trying to make[/QUOTE] It doesn't sound simple. It would be a fun problem to try to work on. Could you post the gist of your code.

Member Avatar for Adam2k
0
111
Member Avatar for pluring

I have been playing with it and didn't get index() to work, mainly because index always returns the first instance of the string if it occurs multiple times. I assume that normally it would be different values and then it wouldn't matter. But just in case the email is repeated …

Member Avatar for Namibnat
0
110
Member Avatar for El Duke

Is the class in the same file as the function? Otherwise you need to import the module it is in: from langFile import LANGUAGE Or something like that. You shouldn't need to do anything before. It depends on how the rest of the file goes, for example, where is translate._languages …

Member Avatar for El Duke
0
679
Member Avatar for Namibnat

[COLOR="Red"]Note two things: First off, I don't guarantee that it works well. Writing to files, if done wrong can always break things. Be careful. I mostly participate in this forum (the Python part) for fun, and my code is written like that. Second: this script is about copying things. I …

Member Avatar for Namibnat
1
819
Member Avatar for rmatelot

[CODE]#! /usr/bin/python # parse_logfile.py import re class GetMySQLLog: """Search a logfile for mysql entries blocks""" def __init__(self): self.logfile = open('/path/to/test/file/logfile', 'r') # Correct this path self.logLi = self.logfile.readlines() self.logfile.close() self.counter = 0 self.plus = "" self.storeli = {} self.isMysql = [] def getSql(self): """Set each block to a dictionary, and …

Member Avatar for Namibnat
0
2K
Member Avatar for jwxie

Don't let the object paradigm confuse you. It is actually rather easy to understand...maybe tricky to code at first, but it is not a confusing concept. 'object' means different things in different programming languages, and as mentioned before, in python almost everything is an object. An object basically is something …

Member Avatar for jwxie
0
110
Member Avatar for n00bprogrammer
Member Avatar for checker

[CODE]element = {'H':1, "N":6, "F":7, 'Cl':7} i = raw_input('Enter: ') dots = '*' totalDots = element[i]*dots [/CODE]

Member Avatar for jimothy
0
147
Member Avatar for vikramsra

If the file is a Microsoft Excel file, why not work on it in Excel. Otherwise you have to deal with the formating that Excel adds to it. Otherwise if you could change it to a database, text file or xml file you would find it much easier to manage.

Member Avatar for vikramsra
0
204
Member Avatar for lisedaton

This is how I got it to work: [CODE]def pullNumbers(data): NumData, total, x_full = ([], 0, "") for x in data: try: int(x) x_full = x_full + x except: if x_full is not "": NumData.append(x_full) x_full = "" if x_full is not "": NumData.append(x_full) OutNumData = " + ".join(NumData) for …

Member Avatar for Namibnat
0
92
Member Avatar for santosh.ssit

If you have one file and want to see what buttons are in that .py file without reading it, why not go to your python ide and open the file, read it through and search for buttons by the test used to create the buttons. If that doesn't answer your …

Member Avatar for lllllIllIlllI
0
82
Member Avatar for Judgment

My answer to your first question: [CODE]stripped = [] print "Input the file, including it's full path, to strip" a = raw_input("--> ") stripper = open(a, 'r') st_lines = stripper.readlines() stripper.close() for lines in st_lines: stripped_line = " ".join(lines.split()) stripped.append(stripped_line) print "\n".join(stripped)[/CODE] I don't know how to answer the second …

Member Avatar for Namibnat
0
183
Member Avatar for andrewktmeikle

Please could you clearly say what you are trying to do, I don't really understand. Your code looks really messy. I am going to try to clearly ask you a few questions and then you could perhaps rephrase your question. [QUOTE]I proceed to convert every item in the list, one …

Member Avatar for andrewktmeikle
0
2K
Member Avatar for fuston05

You need to put your code in the code tags. I have not worked with Tkinter and don't understand how the program you are working on should work. What is [QUOTE]menu_widget_test.pyw[/QUOTE] If you want to run a different module you need to import it at some point or if you …

Member Avatar for fuston05
0
162
Member Avatar for sentinel123

I couldn't resist having a go as well. The way I have done it makes it easy to change, say to every forth value and add three letters in. You also have no issue of over running the values: [CODE]string_thing , di, Fi, z = (raw_input("Enter a string thing\n-->"),[], [], …

Member Avatar for sentinel123
-2
4K
Member Avatar for hondros

"string".lower() is simple and you could do it in various places. Here is a really simple way to handle the whole thing: [CODE](letters, alph, di) = (list(raw_input('Enter your string -->').lower()), " abcdefghijklmnopqrstuvwxyz", []) for lets in letters: if lets in alph: di.append(alf.index(lets))[/CODE]

Member Avatar for jlm699
0
149
Member Avatar for Namibnat

I am trying to create an RSS feed dynamically with php, and for the most part it seems to work out right. When I try to validate, it gives me an error with this line: [CODE]<link><a href='index.php?tt=Getting it all together&m=1'>Getting it all together</a></link>[/CODE] And it points to the = between …

Member Avatar for Elbudster
0
142
Member Avatar for Namibnat

If I have a function included within a page, and that function is in it's own file, in a different directory (/scripts/thefunction.php) how would I go about writing a file path to another file that is in a different directory. In a nutshell, a file in /index.php includes a file …

Member Avatar for CFROG
0
115
Member Avatar for network18

[QUOTE=pritaeas;1024321]If you really need to do this this way, then creating a msqli_multi_query could help. That way the server gets all queries at once, and does not need to handle each query separately. [url]http://php.net/manual/en/mysqli.multi-query.php[/url][/QUOTE] Thank you. I am not sure that I need to do it that way? I am …

Member Avatar for network18
0
704
Member Avatar for Namibnat

Please could someone just clear up, or point me to the right thing to read regarding mysql and php. Once you have made a query and saved it to results, I understand that the query accessed with a number of functions to extract that, such as mysql_fetch_array() and so on. …

Member Avatar for somedude3488
0
135
Member Avatar for Namibnat

I am busy with a project for fun and I am finding it tricky to set balues for mysql queries. If I do the following: [CODE]function CalcPostByTime(){ include 'DB_connection.php'; $result = mysql_query("SELECT ztime FROM blogpost;");[/CODE] What is the simplest way to set an array, which will be a return value …

Member Avatar for kekkaishi
0
136
Member Avatar for Namibnat

I am sorry to ask such a beginner question: I am just learning to use classes and objects in php and would like to know one simple thing - how to you reference one function (or should I call them methods?) from another within the class. When I specify a …

Member Avatar for omoabobade
0
162
Member Avatar for Namibnat

I have been working on a site for a while now, and finally wanted to load it up to the server. I have been working on my own computer with xampplite. Everything was working just fine. When I uploaded it, after a few little things to resolve, I got most …

Member Avatar for Josh Connerty
0
102

The End.