Applying a patch from a diff in python (if possible)

2012-05-23 Thread Astan
Hi, I'm trying to synch up two databases that are very far from each other using diff and patch. Currently, what happens is a mysqldump on database A (which is linux) which is sent over to database B and over time the diff of this mysql is sent over to database B. The database B lives on a NAS serv

Re: Applying a patch from a diff in python (if possible)

2012-05-23 Thread Astan
On May 24, 1:24 pm, Astan wrote: > Hi, > I'm trying to synch up two databases that are very far from each other > using diff and patch. Currently, what happens is a mysqldump on > database A (which is linux) which is sent over to database B and over > time the diff of this m

simple rsa from javascript to python

2012-04-02 Thread Astan Chee
Hi, I've got a simple javascript that looks like this: var public_key_mod = "B99808B881F3D8A620F043D70B89674C0A120417FBD3690B3472589C641AD5D422502D0B26CADF97E2CB618DDDBD06CA0619EBBFB328A2FA31BD0F272FE3791810546E04BF42F05DB620FC7B4D0A2EAA17C18FF30C84D93341205C1D6EAD6ACBF2F08E334049DEBF31555CF164AD5

most efficient way of populating a combobox (in maya)

2012-05-03 Thread astan.chee Astan
Hi, I'm making a GUI in maya using python only and I'm trying to see which is more efficient. I'm trying to populate an optionMenuGrp / combo box whose contents come from os.listdir(folder). Now this is fine if the folder isn't that full but the folder has a few hundred items (almost in the thousan

Fitting polynomial curve

2011-03-16 Thread Astan Chee
Hi, I have 2 points in 3D space and a bunch of points in-between them. I'm trying to fit a polynomial curve on it. Currently I'm looking through numpy but I don't think the function exists to fit a function like this: y = ax**4 + bx**3 + cx**2 + dx + e (I'm not sure what thats called but one degree

Re: Fitting polynomial curve

2011-03-17 Thread Astan Chee
On Thu, Mar 17, 2011 at 5:09 PM, Terry Reedy wrote: > Look at scipy. > > -- > Thanks for the info. I realized I made some mistakes. Anyway, what I'm trying to do is in maya (python), fit selected vertices on a curve. Here is what I have so far: import maya.cmds as cmds import numpy def run_mai

Running and killing a process in python

2011-05-03 Thread Astan Chee
Hi, I'm trying to make a python script (in windows 7 x64 using python 2.5) to start a process, and kill it after x minutes/seconds and kill all the descendants of it. Whats the best way of doing this in python? which module is best suited to do this? subprocess? thanks for any help -- http://mail.

turn monitor off and on

2011-05-13 Thread Astan Chee
Hi, I'm trying to turn off my monitor, pause and then turn it on again. I'm doing this in python 2.6 and windows xp. Here is my script so far (that doesn't work): import time import win32gui import win32con import win32api def turnOffMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(wi

Re: turn monitor off and on

2011-05-19 Thread Astan Chee
On Mon, May 16, 2011 at 7:29 PM, Gabriel Genellina wrote: > > Your script worked fine for me, 2.6 and XP also. Perhaps your monitor > device driver is buggy or does not implement the required functionality. > Mine is from Philips. > > I'm actually using windows 7. Maybe its the difference in OS? A

starting a separate thread in maya

2011-05-19 Thread Astan Chee
Hi, I'm using python2.5 in maya 2009 x64 (in linux). I have a script running and somewhere in the script, I want to start another python script that might not return and i don't want the main maya python script to wait for it to finish, even more, after the second script started, I'd like the main

urllib.open problem

2005-09-14 Thread Astan Chee
Hi Guys, I have a python script which runs perfectly on my machine. However a machine that I tested it on gives the following error message: Traceback (most recent call last): File "whip.py", line 616, in OnRebootRunning File "whip.py", line 626, in RebootCustom File

Re: urllib.open problem

2005-09-14 Thread Astan Chee
yeah, I actually typed that by hand, the url is a local intranet thus I dont specify any proxies of any kind (which I assume isnt required). Sorry about the typo. Cheers Dennis Lee Bieber wrote: On Thu, 15 Sep 2005 09:19:53 +1000, Astan Chee <[EMAIL PROTECTED]> declaimed the follow

Re: urllib.open problem

2005-09-17 Thread Astan Chee
OKay, but how do I check (and possibly change) _proxy environment variables in python? I know in perl its somewhere along the lines of  $ENV{'env_name'}, is it the same in python? Thanks again Cheers Fredrik Lundh wrote: Astan Chee wrote: I have a python script

file.readlines() and IOError exceptions

2006-07-11 Thread Astan Chee
Hi everyone, I currently have a problem with reading one of my files. Normally I'd read files like so: overf = 'C:\\overf' my_overf = open(overf,'r') contents = my_overf.readlines() my_overf.close() now the file Im trying to read has recently had alot of read/writes from other users/threads/etc,

a bug in list.remove?

2006-08-18 Thread Astan Chee
: ps.remove(p) The problem Im having is that when I do >>> print ps it gives me [2, 3, 4, 5, 7, 9, 11, 13, 14, 15] which is incorrect since 2,7,9,11 shouldnt be in that list. Is this a bug in .remove? or is my algorithm somewhat flawed? Thanks for your help! Cheers Astan -- htt

Re: a bug in list.remove?

2006-08-18 Thread Astan Chee
value > > > > If qs is large, you'll get improved performance by converting it to a > set first: > > >>> s = set(qs) > >>> ps = [x for x in ps if x not in s] > > > As for your algorithm, you're modifying the list over which you're > iterating--at best, often considered bad form...at worst, I've had > Python throw exceptions at me for attempting it. > > -tkc Thanks for that. Really helpful! Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

urllib2, proxies and https

2006-08-18 Thread Astan Chee
heers Astan -- http://mail.python.org/mailman/listinfo/python-list

web-based SSH

2006-10-25 Thread Astan Chee
Hi, I was looking for a web-based SSH client (something like www.port42.com..but for some reason it doesnt work..can anyone verify this)..does anyone know any other alternative to other websites that offer this? If you're gonna scream 'security!security!' well, its for testing purposes and the box

popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Hi, Im trying to popen (or more specifically os.popen4() ) from wxPython. I've read the documentation on popen and it says I can do a popen as a seperate process or popen not as a child process but it doesnt say how. Can anyone help? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Fredrik Lundh wrote: Astan Chee wrote: Im trying to popen (or more specifically os.popen4() ) from wxPython. I've read the documentation on popen and it says I can do a popen as a seperate process or popen not as a child process where does it say that? afaik, the whole point o

Re: popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Fredrik Lundh wrote: > Astan Chee wrote: > > >> Yes, that is true. But everytime I run a os.popen() it executes as a >> child process of the current running one. How do I launch as a seperate >> process? >> > > what's your definition of &

Re: popen(1-4) as a seperate process

2006-11-17 Thread Astan Chee
Dennis Lee Bieber wrote: > On Fri, 17 Nov 2006 18:53:41 +1100, Astan Chee <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >> What would be a good method to do this? I've tried your >> os.system("command&") and the s

using custom cookies in http

2006-06-05 Thread Astan Chee
Hi, Im attemtping to set values of custom cookies and use it to gain access to certain web-pages that require these custom cookies. What I've done so far is creating the cookies like so: import Cookie C = Cookie.SmartCookie() C["__user_name"] = "foob" And Im trying to open a url that requires

Re: Small newbie question

2006-02-12 Thread Astan Chee
Byte wrote: >How would I do this: Write a program that simply outputs a ramdom (in >this case) name of (for this example) a Linux distibution. Heres the >code ive tryed: > >from random import uniform >from time import sleep > >x = 2 >while x < 5: >x = uniform(1, 5) >if x >= 1 <= 1.999: p

Terminating a function

2006-02-17 Thread Astan Chee
Hi, Im rather new to threads in python but Im trying to terminate a function call (or the execution of the function) after a certain period of time has passed. Do i need to use threads with this? if i do, how do i go about doing it? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Terminating a function

2006-02-17 Thread Astan Chee
help! Diez B. Roggisch wrote: Astan Chee wrote: Hi, Im rather new to threads in python but Im trying to terminate a function call (or the execution of the function) after a certain period of time has passed. Do i need to use threads with this? if i do, how do i go about doing it

Re: Random Prime Generator/Modular Arithmetic

2006-03-05 Thread Astan Chee
thanks for the webpage info, however theres a small error I found when trying to generate a prime number with more than 300 decimal digits. It comes up with File "prime.py", line 84, in mod_square_pow return x*mod_square_pow(((a**2)%n),t,n,p*2) File "prime.py", line 84, in mod_square_pow

Re: Random Prime Generator/Modular Arithmetic

2006-03-05 Thread Astan Chee
Also you last code which looked like: def cran_rand(min,max): if(min>max): x=max max=min min=x range=round(log(max-min)/log(256)) if range==0: range=1 num=max+1 while(num>max): num=min+s2num(urandom(range)) return num what does s2nu

Re: Random Prime Generator/Modular Arithmetic

2006-03-05 Thread Astan Chee
Also I think the snippet code [p for p in range(2,N) if 0 not in [pow(w,p-1,p)==1 for w in [2, 3, 5, 7, 11] if p>w]] is probably nicer to generate a list of primes for up to N (instead of hard coded) Aside from that looks nice. Thanks Tuvas wrote: >Yep, you guessed correctly about the s2num fun

dual CPU-mode in python

2006-03-05 Thread Astan Chee
Hi, I have a python script which i convert to an executeable (using py2exe) and on a dual-cpu machine seems to be taking only 50% (1cpu) only. I was wondering if there is a way to maximize CPU usage without forking the function? Thanks -- http://mail.python.org/mailman/listinfo/python-list

removing redundant elements in a dictionary

2007-07-31 Thread Astan Chee
elem[out1].sort() elem[out2].sort() if elem[out1] == elem[out2]: del elem[out1] This returns in a KeyError exception when sorting. What am I missing here? Thanks Astan -- http://mail.python.org/mailman/listinfo/python-list

get position is scrolled wxScrolledWindow

2007-08-06 Thread Astan Chee
oes anyone have any examples or advice on how to get the real or position of the window including where it has been scrolled? Thanks Astan -- http://mail.python.org/mailman/listinfo/python-list

check if var is dict

2007-08-13 Thread Astan Chee
Hi, I have a variable, I want to check if it is a dictionary or a string. Is there any better way to do this than I've done. How I did it is by doing a .items() and catching a AttributeError that it raises if its not a dictionary. How do i properly do it? Thanks Astan -- http://mail.pytho

converting epoch time to string (and vice versa)

2007-03-12 Thread Astan Chee
Hi, I have a string in this format "DD/MM/YYY" for example: tdate = "18/01/1990" and Im trying to convert this to epoch time, can anyone help? Im also trying to convert that epoch time to the string format previously. Can anyone help this one too? Thanks! Astan -- http://mai

getting local system information with python

2007-03-15 Thread Astan Chee
Hi, I have a python script and I want to check what operating system it is on and what the current local machine name is. How do I do it with python? Thanks! Astan -- http://mail.python.org/mailman/listinfo/python-list

upgrading python (and other modules)

2007-03-28 Thread Astan Chee
html.HtmlWindowEvent AttributeError: 'module' object has no attribute 'HtmlWindowEvent' How should I be importing in the new wx? Thanks! Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: upgrading python (and other modules)

2007-03-28 Thread Astan Chee
Forget I asked this question. I've solved it using wxPython 2.6.3.3 Cheers Astan Chee wrote: > Hi, > I was once using python 2.4 in win2k with wxPython 2.4.2.4 (if im not > mistaken) with it. > Now i've upgraded to winXP and am using python 2.5 with wxPython 2.8.1.1. >

Re: ok

2007-04-04 Thread Astan Chee
How much does it pay? [EMAIL PROTECTED] wrote: > hi looking for someone to bult my web site for me > > -- http://mail.python.org/mailman/listinfo/python-list

eval('000052') = 42?

2007-02-20 Thread Astan Chee
Hi, I just tried to do eval('00052') and it returned 42. Is this a known bug in the eval function? Or have I missed the way eval function works? Thanks -- http://mail.python.org/mailman/listinfo/python-list

reading raw variables from file

2007-11-29 Thread Astan Chee
n it as normal python variable statements so that when i read the file, my users var will be ["Bob","Jane"] and my status var will be {1:"ok",2:users[0]} . Is there an easy way of doing this instead of parsing the files and checking said types? Thanks Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: reading raw variables from file

2007-11-29 Thread Astan Chee
Paddy wrote: On Nov 30, 4:57 am, Astan Chee <[EMAIL PROTECTED]> wrote: Hi, I have a file that might contain literal python variable statements at every line. For example the file info.dat looks like this: users = ["Bob", "Jane"] status = {1:"ok",2:users[0]

sizers in wxpanels/notebooks

2007-12-07 Thread Astan Chee
self.notebook.AddPage(self.tab12,"Test Sizers") Thanks! Astan -- http://mail.python.org/mailman/listinfo/python-list

python "sounds-like" module

2007-12-12 Thread Astan Chee
'right' and 'write' sounds the same or 'u' and 'you' . Also I know this takes into account the use of language and accent but is there any out there before I start making my own? Thanks Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: python "sounds-like" module

2007-12-12 Thread Astan Chee
John Machin wrote: > Someone is sure to trot out the hoary old soundex ... believe me, it's > teh suxxor. > > plus febrl has soundex (and modified versions of it) within it. But thanks again! Looks like this is what I'm looking for. Thanks alot guys! Astan -- http://m

Re: python "sounds-like" module

2007-12-12 Thread Astan Chee
John Machin wrote: > Someone is sure to trot out the hoary old soundex ... believe me, it's > teh suxxor. > > Plus febrl has soundex in it (as well as several modified versions of it) among other things. Looks like this is what Im looking for. Thanks! Astan -- http://mail.p

Re: python "sounds-like" module

2007-12-12 Thread Astan Chee
John Machin wrote: > Someone is sure to trot out the hoary old soundex ... believe me, it's > teh suxxor. > > Plus febrl has soundex in it (as well as several modified versions of it) among other things. Looks like this is what Im looking for. Thanks! Astan -- http://mail.p

socket in python with proxies

2007-12-20 Thread Astan Chee
ep getting the Traceback (most recent call last): File "", line 1, in s.connect(server) File "", line 1, in connect gaierror: (11001, 'getaddrinfo failed') What does this mean? and can I actually use username/password to connect using a socket in python?

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Astan Chee
what about sending the mail as html instead of normal plain/text ? anya wrote: >Hey, >I have a certain problem and till now I didnt find an answer on the >web. > >I want to send an email message with picture in it. I dont want to put >it as >attachment but make it in the body of the mail, so eve

sending commands in body of HTTP with urllib2

2008-01-02 Thread Astan Chee
Hi, Im trying to implement the logic from http://www.hypothetic.org/docs/msn/general/http_connections.php to a simple python code using urllib2 and some parts of urllib. Im behind a http proxy that requires authentication that is why Im using urllib2. Im asking for help on how to send commands

Re: sending commands in body of HTTP with urllib2

2008-01-03 Thread Astan Chee
Astan Chee wrote: > Hi, > Im trying to implement the logic from > http://www.hypothetic.org/docs/msn/general/http_connections.php to a > simple python code using urllib2 and some parts of urllib. Im behind a > http proxy that requires authentication that is why Im using urllib

(bit)torrent source code help

2008-01-13 Thread Astan Chee
another source code for a torrent client or any torrent client in python that compiles nicely with py2exe in windows? Thanks Astan -- http://mail.python.org/mailman/listinfo/python-list

Restart crashing modules in windows

2008-01-14 Thread Astan Chee
it that restarts this module every time it crashes. Is this possible? How do I do this? Or does one windows crash in one python module crash python entirely and I have to resort in an external program to restart python everytime it crashes? Thanks again for all the help. Astan -- http

Re: Restart crashing modules in windows

2008-01-15 Thread Astan Chee
Mike Driscoll wrote: On Jan 14, 9:02 pm, Astan Chee <[EMAIL PROTECTED]> wrote: Hi, I have a python module that keeps on crashing with various windows errors (not BSOD but the less lethal windows XP popup ones). Now these are intentional and rather sporadic so I cant really solve

Re: [python] How to detect a remote webpage is accessible? (in HTTP)

2008-01-17 Thread Astan Chee
m') f = urllib2.urlopen(req) notes= f.readlines() f.close() print "Everything is ok" except IOError, r: p = str(r) if re.search(r'urlopen error timed out',p): print "Web page timed out" You'll need to set up the timeout to whatever duration your website takes

Bittorent client with google talk interface

2008-01-20 Thread Astan Chee
re Im doing something wrong calling the interface from the code because it (wx) sporadically crashes; Im not sure what to do since I dont know how to call it properly. Does anyone have any idea? Cheers Astan The file can be downloaded here: http://gtalktorrent.googlecode.com/fil

small problem with re.sub

2008-01-30 Thread Astan Chee
Hi, I have a html text stored as a string. Now I want to go through this string and find all 6 digit numbers and make links from them. Im using re.sub and for some reason its not picking up the previously matched condition. Am I doing something wrong? This is what my code looks like: htmlStr = r

Re: wxEVT_SCROLL_ENDSCROLL

2008-01-31 Thread Astan Chee
try wx.EVT_SCROLL_ENDSCROLL ? Jack Holt wrote: > Hello, > > I got the following error: > > Traceback (most recent call last): > File "vplayer.py", line 15, in ? > File "config.pyo", line 3, in ? > File "wx\__init__.pyo", line 44, in ? > File "wx\_core.pyo", line 3592, in ? > AttributeErro

Help with jabber client in wx

2008-02-10 Thread Astan Chee
o overwrite or handle the wx MainLoop method and maybe I'm doing something wrong in there. Maybe a deadlocked event? Anyway, does anyone have any ideas? Cheers Astan Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and an

copy file over LAN

2008-03-26 Thread Astan Chee
') and it gives me a IOError: [Errno 13] Permission denied: error, which I expect. How do I provide authentication to copy this file? Thanks for the help. Cheers Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.an

Re: copy file over LAN

2008-03-26 Thread Astan Chee
ssword) raise err if __name__ == '__main__': node = hostname dst = r'C:\temp\destination__' dst += node + r'.txt' wnet_connect(node,username,password) shutil.copyfile(r'\\' + node + r'\c$\temp\\al_lsf_log',dst) Gabriel Ge

defining class functions

2009-01-19 Thread Astan Chee
g a function of another class without inheriting it? Does this make sense? Thanks Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: defining class functions

2009-01-19 Thread Astan Chee
31 PM, James Mills mailto:[email protected]>> wrote: On Tue, Jan 20, 2009 at 10:08 AM, Astan Chee mailto:[email protected]>> wrote: > Hi, > I have two classes in python that are in two different files/python scripts. > Class A uses Class

USB in python

2009-01-21 Thread Astan Chee
to if the software to activate this can actually be written and how do I do it? Any examples? I've seen pyUSB but it doesn't give me control over the hardware and how much power is going through the data pins. Thanks for any help. Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: Astan Chee wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the powe

Re: USB in python

2009-01-22 Thread Astan Chee
rallel port (according to the spec) only provides 1mA. Thats why I was looking into the USB solution. Thanks for the suggestion though. Also, yes, the device is rather mobile and that is why it is powered by the computer/laptop but legacy isn't really an issue for me I guess. Cheers Astan

Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: If all you need is on-off - why can't you just use a switch? Because I want to control the on-off the device using a computer and write software for it (which I am confident I can do if I had references to how the wrappers to said interface). Cheers

Re: USB in python

2009-01-25 Thread Astan Chee
Tim Roberts wrote: Sorry, but you have NOT created a USB device, and I sincerely hope you do not try to plug it in to a real USB port. Sorry, by USB device, I meant a device that is powered/activated by a bunch of wires that I want to control using a computer and since I had a spare USB jack

Re: USB in python

2009-01-26 Thread Astan Chee
parts here and maybe use that. Thanks for all the ideas! Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

get most common number in a list with tolerance

2009-02-20 Thread Astan Chee
list where each of them is unique [(1, 12), (1, 10), (1, 11), (2, 20), (1, 30)] but I am expecting a list that looks like this: [(3, 10), (2, 20), (1, 30)] What do I need to add? Thanks for any help. Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: equivalent of py2exe in other os

2008-10-07 Thread Astan Chee
, what I'm looking for is a stand-alone binary/executable. Thanks again for the suggestions Astan Lars Stavholm wrote: Almar Klein wrote: Hi, I was going to say "try google", but it seems quite hard to find indeed. Use "freeze" for linux and "py2app" for

equivalent of py2exe in other os

2008-10-07 Thread Astan Chee
Hi, I was just wondering if there is a equivalent of py2exe on linux (centOS) and mac (OS X). I have a python script that uses wx and I dont want to install wx on linux/mac machines. What are my choices? Thanks Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. C

Re: equivalent of py2exe in other os

2008-10-13 Thread Astan Chee
.exe in because I am in windows. Is what I am after not possible so far? Thanks again for all the help. Cheers Astan PS: I already did some google and tried out all the suggestions everyone gave but still nothing. Benjamin Kaplan wrote: On Tue, Oct 7, 2008 at 10:58 AM, Joe Strout &l

factoring wx.Image

2009-02-26 Thread Astan Chee
ly wx? Thanks for any help. Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

threads problem in python

2008-05-13 Thread Astan Chee
and making the first class wait for it to finish. Im very confused on doing threads in python. Thanks for any help. Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment befor

Re: threads problem in python

2008-05-13 Thread Astan Chee
separate thread, otherwise wx wont play nice. Is there a simple example of how I can do this? And as for finance, the source for the game is free, but it isnt free to play on my server. How does that sound? Thanks Astan [EMAIL PROTECTED] wrote: On May 13, 5:38 am, "Gabriel Genellina&quo

parsing .pcap files

2008-06-06 Thread Astan Chee
a (python) dictionary/documentation somewhere that I can use to parse this data? Thanks again. Cheers Astan PS: I've attached the .pcap file that Im using to test and the python file as well. -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two.&q

VNC capture in python

2008-07-06 Thread Astan Chee
Hi, I was wondering if I can do a capture of a VNC screen in python. Kinda like this http://search.cpan.org/~lbrocard/Net-VNC-0.35/lib/Net/VNC.pm but without opening a VNC window or doing a screen capture. Thanks for any suggestions -- "Formulations of number theory: Complete, Consistent, Non-t

sine in python

2008-04-03 Thread Astan Chee
Hi, I have a math function that looks like this sin (Theta) = 5/6 How do I find Theta (in degrees) in python? I am aware of the math.sin function, but is there a reverse? maybe a sine table in python? Thanks Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choos

testing client-server sockets

2008-04-18 Thread Astan Chee
client to connect to the server for testing purposes. Any suggestions on how I should do this? Thanks Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing thi

Re: testing client-server sockets

2008-04-18 Thread Astan Chee
data), 'bytes' s.close() David Harrison wrote: On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: Hi, I have a client-server socket script in python. Something like this http://ubuntuforums.org/showthread.php?t=208962 Now the problem I have is that I want to t

Re: testing client-server sockets

2008-04-18 Thread Astan Chee
Wierd. It works now. I must've changed something. Oh well, thanks anyway. David Harrison wrote: On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: Server code: import os, sys, socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '' port = 56

simple chemistry in python

2008-04-29 Thread Astan Chee
information Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not th

Re: simple chemistry in python

2008-04-29 Thread Astan Chee
Wow, that is the jackpot. Is that color node supposed to be the actual color of the element? or just representation? Thanks again Astan baoilleach wrote: If you are familiar with parsing XML, much of the data you need is stored in the following file: http://bodr.svn.sourceforge.net/viewvc

tool to calculate color combination

2008-04-30 Thread Astan Chee
(1,0.7,0) Is there such a tool in python? Thanks for any information Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachme

Re: tool to calculate color combination

2008-04-30 Thread Astan Chee
Dont worry about this. I've figured it out. Rather simple : red = sum of for each red (50/100) * 1 green = sum of for each green (50/100) * 0 blue = sum of for each blue(50/100) * 0 Astan Chee wrote: Hi, I was just wondering if there is a tool/script in python that allows me to do

get number that is raised to the power of

2008-05-02 Thread Astan Chee
was a faster way of doing it? Thanks for any pointers Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confi

Re: get number that is raised to the power of

2008-05-02 Thread Astan Chee
Python.Arno wrote: the "reverse" of a power to is logarithm so v = 10**n <=> math.log(v,10) = n Arno Im so ashamed of myself for not thinking in logs. I must be dreaming again. Thanks for the help. -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal

python/py2exe running in background

2006-03-23 Thread Astan Chee
Hi, Im using py2exe to convert my python scripts to .exe. Im trying to get my scripts and .exes to only run (utilize full CPU) when my PC is idle (kinda like [EMAIL PROTECTED]). Do i only need to modify GIL parameters or is there more to acomplishing this? Thanks -- http://mail.python.org/mail

Help with invoking standard mail app in windows

2009-12-18 Thread Astan Chee
ed" errors. I'm using windows xp and python 2.5. I have outlook 2007 installed as a default mail client. Clicking on any mailto links in html brings up the normal write mail from the mail client. Any ideas why this is happening or how do I debug what access is being denied? Thanks for any help Astan -- http://mail.python.org/mailman/listinfo/python-list

Help with invoking standard mail app in windows

2009-12-18 Thread Astan Chee
) all of these are having "WindowsError : [Error 5] Access is denied" errors. I'm using windows xp and python 2.5. I have outlook 2007 installed as a default mail client. Clicking on any mailto links in html brings up the normal write mail from the mail client. Any ideas why this is happening or how do I debug what access is being denied? Thanks for any help Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with invoking standard mail app in windows

2009-12-18 Thread Astan Chee
Kev Dwyer wrote: Hello Astan, Your code executes without error for me on Win98 (!) with Python 2.5 or XP with Python 2.6. It would help people to help you if you could provide the *exact* console output from when you try to execute the code, *including* the traceback. That way we can

converting XML to hash/dict/CustomTreeCtrl

2010-02-01 Thread Astan Chee
Hi, I have xml files that I want to convert to a hash/dict and then further placed in a wx CustomTreeCtrl based on the structure. The problem I am having now is that the XML file is very unusual and there aren't any unique identifiers to be put in a dict and because there are no unique variabl

Re: converting XML to hash/dict/CustomTreeCtrl

2010-02-02 Thread Astan Chee
}, '1', '1943498', '0'], [{'current': '411307840', 'peak': '1640100156', 'name': 'geoSpace', 'description': 'Geo-Space'}, {'current': '1406752', 'peak': '709596712', 'name': 'gridSpace', 'description': 'Grid-Space'}, {'current': '0', 'peak': '737720720', 'name': 'spaceMem', 'description': 'Space memory'}, {'peak': '607.432373', 'name': 'endTime', 'description': 'End'}], {'current': '2054715622', 'peak': '5164184694', 'name': 'subsystemSpace', 'description': 'Subsystem space total'}]], 'name': 'position1', 'description': 'Calculation statistics'}} Which is kinda wrong. I expect the dict to have the "Space usage summary", but it doesn't (duplicate?). What am I doing wrong here? I am attempting to keep the attribute value of an XML as key (if it doesn't have a value, then just the tag name will do) and associate it with the text value of that tag/attribute value as well as reflecting the hierarchy structure of the XML in the dict. Does this make sense? Anyway, the python script above is just the first step or an example for me. Cheers and thanks again Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: converting XML to hash/dict/CustomTreeCtrl

2010-02-03 Thread Astan Chee
Nobody wrote: The code you're using expects the XML to follow a particular format, and yours doesn't. You might want to start with a fairly direct translation, e.g.: def xmldict(e): d = {} d['tag'] = e.tag d.update(e.attrib) children = map(xmldict, e) if children: d[

calculating a string equation

2010-02-11 Thread Astan Chee
e how to convert the equation; if I have to make a bunch of if-statements or if there is a python function that already does something like this. Thanks for any help. Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list

Re: calculating a string equation

2010-02-20 Thread Astan Chee
Arnaud Delobelle wrote: Astan Chee writes: Hi, I have some variables in my script that looks like this: vars = {'var_a':'10','var_b':'4'} eqat = "(var_a/2.0) <= var_b" result = "(var_a+var_b)/7" What I'm trying to do i

RCX using python serial help

2010-12-06 Thread Astan Chee
Hi, I've got a lego mindstorm RCX 1.0 (but firmware is 2.0) that uses one of those old serial IR towers to control the microcontroller. I've had a look around at python's serial documentation as well as the RCX's documentation and I'm trying to write something to control the RCX directly using pyth

Re: RCX using python serial help

2010-12-08 Thread Astan Chee
) compliment? Thanks again for the clarification On 12/8/10, MRAB wrote: > On 06/12/2010 15:37, Astan Chee wrote: >> Hi, >> I've got a lego mindstorm RCX 1.0 (but firmware is 2.0) that uses one of >> those old serial IR towers to control the microcontroller. I've h

run a function in another processor in python

2010-12-09 Thread Astan Chee
Hi, I've got a python script that calls a function many times with various arguments and returns a result. What I'm trying to do is run this function each on different processors and compile the result at the end based on the function result. The script looks something like this: import time def

Re: run a function in another processor in python

2010-12-09 Thread Astan Chee
esn't give me any return data. It also spawns an infinite number of (sub)processes that crashes my machine. What am I doing wrong here? On 12/9/10, Jean-Michel Pichavant wrote: > Astan Chee wrote: >> Hi, >> I've got a python script that calls a function many times with various

  1   2   >