Showing results 1 to 40 of 290
Search took 0.02 seconds.
Posts Made By: paulthom12345
Forum: Networking Hardware Configuration 1 Hour Ago
Replies: 0
Views: 8
Posted By paulthom12345
Unable to detect network computers

Hi Guys,
My setup is as follows, i have a D-Link DI-524 router and four computers. Three of them have windows XP Professional while the other computer has windows XP Home edition.

They are all...
Forum: Python 2 Hours Ago
Replies: 7
Views: 88
Posted By paulthom12345
Re: TextCtrl Woes

Yep, that works a charm. I tried something simillar before but it didnt work. Oh well, that all works now, thanks Chris!
Forum: Python 3 Hours Ago
Replies: 7
Views: 88
Posted By paulthom12345
Re: TextCtrl Woes

Okay both of those did not actually do anything different from my first idea. So i went with the SendKeys module and sent the backpace key once so that the cursor would be taken back to the start...
Forum: Python 16 Hours Ago
Replies: 4
Views: 58
Posted By paulthom12345
Re: Freezing Issues

Just make sure that both things you want are methods. I think you will want to do something like:

import wx #if using wxPython
import thread

class Frame(wx.Frame):
#all the code stuff

def...
Forum: Python 16 Hours Ago
Replies: 4
Views: 58
Posted By paulthom12345
Re: Freezing Issues

Well python only does one thing at a time so perhaps while the images are being done it dosent do the GUI. A way around this is to use the thread module.

Threading is useful if you want two things...
Forum: Python 1 Day Ago
Replies: 7
Views: 88
Posted By paulthom12345
Re: TextCtrl Woes

No i dont think so.

Emulate key press required an event. I think that means somethign like wx.EVT_TEXT or something. Am i wrong? Can you use the backspace character or some kind of ascii key code?
Forum: Python 1 Day Ago
Replies: 7
Views: 88
Posted By paulthom12345
TextCtrl Woes

Hi guys
I am making a program that uses a text control to move messages from one place to another. My program needs to be able to, once the message has been moved, delete what is in the textCtrl. I...
Forum: Python 3 Days Ago
Replies: 6
Views: 106
Posted By paulthom12345
Re: wx.CallAfter()

Woops, should have called them paramaters. If you have any that are needed then you put them as the second paramater but if there are no paramaters needed for the MeWin method then you dont need to...
Forum: Python 3 Days Ago
Replies: 6
Views: 106
Posted By paulthom12345
Re: wx.CallAfter()

you would call wx.CallAfter(self.MeWin,ARGUMENTS) and then that will call the function after the YouWin function is done.
Forum: Python 3 Days Ago
Replies: 6
Views: 106
Posted By paulthom12345
Re: wx.CallAfter()

It is used with events in wxPython. If you have a button lets say that when you press it pops up a dialog box. But there is also something else going on and you want the method that makes that dialog...
Forum: Python 4 Days Ago
Replies: 17
Views: 311
Posted By paulthom12345
Re: Computer picks a random word and player has to guess it.

what does "DictionaryE.txt" look like? I would like to try and run it but i get an error because i have no "DictionaryE.txt" file.
Forum: Python 4 Days Ago
Replies: 17
Views: 311
Posted By paulthom12345
Re: Computer picks a random word and player has to guess it.

you might have an issue with variables not being global. Try putting this at the start of your program.

global file_in
global file_size
Forum: Python 4 Days Ago
Replies: 17
Views: 311
Posted By paulthom12345
Re: Computer picks a random word and player has to guess it.

see the indentation of line 14 and line 13 and line 12 and line 11 do not match the indentation needed to set them all inside the function. You just need to re-write this in a python editor and it...
Forum: Python 4 Days Ago
Replies: 17
Views: 311
Posted By paulthom12345
Re: Computer picks a random word and player has to guess it.

That will mean that the return is not being properly recognised as inside of the function. This could be an indenting problem or just accidentally having a return statement somewhere else in your...
Forum: Python 4 Days Ago
Replies: 1
Views: 90
Posted By paulthom12345
Re: Perfect number - python

you use a range.

for variable in range(n/2):
#do stuff
Forum: Python 6 Days Ago
Replies: 2
Views: 133
Posted By paulthom12345
Re: Python Counterpart?

pickle! *slaps head* gosh, i never knew! I always thought it was just a way to store strings in a file that meant you could take it across any platform no worries. Thanks, thats amazing, it will...
Forum: Python 6 Days Ago
Replies: 4
Views: 129
Posted By paulthom12345
Re: Help With this code

Could we have an example of what stock.txt has in it please?
Forum: Python 6 Days Ago
Replies: 17
Views: 311
Posted By paulthom12345
Re: Computer picks a random word and player has to guess it.

This is not very hard if you use the random module.

import random

words = ['hello','python','monday','tuesday','friday','ice']
choice = random.choice(words)

print "Guess the word!"
guess =...
Forum: Python 7 Days Ago
Replies: 2
Views: 133
Posted By paulthom12345
Python Counterpart?

Yesterday, i was programming a program in Java when i came accross something i though was just amazing. I could read and write complete Obects with just one line of code! They would go to a file and...
Forum: Python 7 Days Ago
Replies: 9
Views: 228
Posted By paulthom12345
Re: wxTreeCtrl - Load Tree structure from file

I think you could also use XML to save it. If you are using wxPython then there is an XML module you can load that makes it nice and easy to load.

The module is wx.xrc, it can load a panel, a frame...
Forum: Python 7 Days Ago
Replies: 3
Views: 116
Posted By paulthom12345
Re: Adding info to a variable

If you want to do that to an int and you just want to add it on the end then you could go:

>>> adam = 123
>>> john = 456
>>> #if you just add them together they don't add on to the end,
>>> print...
Forum: Python 9 Days Ago
Replies: 5
Views: 214
Posted By paulthom12345
Re: Data Log

I would also reccomend that when you write to the file you have a new line after each item. To do this then just go:

datalog.write(data+'\n')

Hope that helps
Forum: Python 9 Days Ago
Replies: 5
Views: 214
Posted By paulthom12345
Re: Data Log

Just take the comma off the end of line 20. Adding the comma makes it a tuple.
Forum: Python 9 Days Ago
Replies: 4
Views: 182
Posted By paulthom12345
Re: generating "infinite" words

Python would be easy to do this in. You could use a mixture of the random module as well as the String module and combining them together to get something that does it for you. In fact i will show...
Forum: Python 10 Days Ago
Replies: 3
Views: 146
Posted By paulthom12345
Re: executing scripts via command line

Your problem is that sys.argv is what you supply on the command line after starting the script. So you would go

python mycode.py arg1 arg2

For yours to work you need at least 2 arguments for there...
Forum: Python 10 Days Ago
Replies: 4
Views: 182
Posted By paulthom12345
Re: Classes vs Functions

I find functions still a great thing to have if you want to have something unrelated to either class. Personally i like to only have related functions in a class and if i want a function and there is...
Forum: Python 10 Days Ago
Replies: 4
Views: 231
Posted By paulthom12345
Re: Ask user for binary number

You could use list comprehension as well

binary = raw_input()
if False in [f == '0' or f == '1' for f in binary]:
print "Not Binary"
else:
print "Is Binary"
Forum: Python 10 Days Ago
Replies: 9
Views: 276
Posted By paulthom12345
Re: Passing varyables through a text file

For starters you shouldnt use the word "file" as a variable. That is a keyword in python.
Forum: Python 13 Days Ago
Replies: 4
Views: 167
Posted By paulthom12345
Re: Why doesnt my calculator script work! <----newb alert

Okay, you have to use your TextCtrl and then you have use something like:

t = wx.TextCtrl(arguments)
#... later
t.GetValue()

the GetValue() method fetches the current value of the textCtrl
Forum: Python 14 Days Ago
Replies: 4
Views: 167
Posted By paulthom12345
Re: Why doesnt my calculator script work! <----newb alert

You have a lot of errors your code. First of all let me say that you can really only use self when you are in a class. A lot of your code in your program should be in the __init__ method.

Also in...
Forum: Python 16 Days Ago
Replies: 7
Views: 167
Posted By paulthom12345
Re: Very Frustrated

Okay. Im glad it works. Well done on fixing it yourself.
Forum: Python 16 Days Ago
Replies: 7
Views: 167
Posted By paulthom12345
Re: Very Frustrated

That means somewhere in your code. Perhaps in a bit that i cant see. There is a bit that makes balance not an int any more. So try and look for places where balance is changed.
Forum: Python 16 Days Ago
Replies: 7
Views: 167
Posted By paulthom12345
Re: Very Frustrated

Well this is working for me:

def process(balance):
trans_type= raw_input("Enter Deposit(d), withdrawal(w), print(p), or quit(q):")
amount=input("Enter the amount:")
if amount<0:
...
Forum: Python 16 Days Ago
Replies: 7
Views: 167
Posted By paulthom12345
Re: Very Frustrated

Can you please give us examples of numbers which stuff up the program and the FULL error statement because that will help even more. Also tell us wether you are doing a withdrawal, deposit or...
Forum: Python 16 Days Ago
Replies: 9
Views: 276
Posted By paulthom12345
Re: Passing varyables through a text file

you can also use eval or exec on the text file if it was like this:

if you had this in your program

f = open('variables.txt')
for line in f:
eval(line)
#or exec(line)

That will then set up...
Forum: Python 16 Days Ago
Replies: 5
Views: 147
Posted By paulthom12345
Re: Screen Scraping - part deux

Ah i have had this problem before. I found it really really useful to use Threading.
So maybe you could make a function or class that uses Threading and then you can have it wait for user input...
Forum: Python 17 Days Ago
Replies: 3
Views: 239
Posted By paulthom12345
Re: Global variables

So i take it your making you own module and importing it right? Well if you import a module you can access its variables by going

module.variable

If you have imported the module then the module is...
Forum: Python 18 Days Ago
Replies: 28
Views: 944
Posted By paulthom12345
Re: Python and Linux

if you want to print a variable in the middle of a print statement there are two ways to do it.

grade = 0
print "Final grade is",grade,"out of 100"

OR

grade = 0
print "Final grade is %i out of...
Forum: Python 19 Days Ago
Replies: 40
Views: 800
Posted By paulthom12345
Re: Text games are frustrating!

Congradulations, you have done very well.
:)
Forum: Python 20 Days Ago
Replies: 3
Views: 201
Posted By paulthom12345
Re: create interface with python

Can i just say, it was my fault, i have an error in my code. Woops.
Please add

frame.Show(True)

just before the app.MainLoop() statement.

That will make the frame show.

Sorry for the error :P
Showing results 1 to 40 of 290

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:27 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC