No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
10 Posted Topics
Hi Liam How about this: [CODE=python] #!/usr/bin/python xmlfile = open("your.xml", 'r') string_len = 5 # say your string is 5 characters long for line in xmlfile: anchor = line.find('your string here') string = line[anchor + 1:anchor + string_len] print string [/CODE] This would find the string you want and then …
Hi All I have a simple quick question: does anyone have any recommendations on a graphing with C? I've done some graphing in the past with Python using Matplotlib and rather than re-invent the wheel I was hoping that someone might be able to point me in the right direction …
Hi All I'm learning C at the moment using Code::Blocks running on Windows 7 (64-bit) and I'm having a bit of a problem with code that I've compiled. This code works and compiles just fine: [CODE]#include <stdio.h> int main() { char cards[] = "JQK"; char a_card = cards[2]; /* "K" …
Hello all I'm having a few issues with a Python program in that I am performing decimal calculations on and most values come up as desired, however every so often, when there is a very small decimal, the number is represented like "6.80E-7" rather than the desired "0.000000680". Here's a …
Have you tried these commands manually? Perhaps there is a pause, so you could try adding in the following: [CODE]import time # your code... time.sleep(5)[/CODE] The above will pause for 5 seconds. I've found this is a problem sometimes with telnet... Post your source code (as richieking says...) and we …
Can't you just use: [CODE]newlist = list.sort()[/CODE]
Hi All I was hoping for some advice based on the pool of experience here at Daniweb. I've been teaching myself to program in Python and I'm starting to get the hang of it, now I'm able to write small programs to automate administrative tasks as well as some complex …
[QUOTE=tk-421;1405591]Monday morning, our final exam is to write a Python program according to whatever the teacher will throw at us. Any ideas as to how or WHAT to study to be ready for anything? (Most of the class expects to fail this, btw. I don't want to be among those …
Hi All I'm getting very odd behaviour when using file.write(variable) - what happens is that if I print out the variable using the print function I get this: [ICODE]4CE1FFC64101843801[/ICODE] ... which is what I expect. However, when I try to write this to a file (using the variable 'valid' to …
Hello all Just joined the site - mainly due to the fact that 7/10 times I Google a problem this site comes up :) Not looking for an easy ride, but can someone point me in the direction of a site/tutorial that shows how to run a loop periodically? What …
The End.