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

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

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

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

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.

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

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: run a function in another processor in python

2010-12-10 Thread Astan Chee
ething can substitute. I'd appriciate any help. Thanks On Sat, Dec 11, 2010 at 9:04 AM, geremy condra wrote: > On Fri, Dec 10, 2010 at 4:42 AM, Astan Chee wrote: > > On Fri, Dec 10, 2010 at 1:37 AM, Peter Otten <__pete...@web.de> wrote: > >> > >> I can&#

Re: run a function in another processor in python

2010-12-10 Thread Astan Chee
On Fri, Dec 10, 2010 at 1:37 AM, Peter Otten <__pete...@web.de> wrote: > I can't replicate the crash. However, your problem looks like there is a > ready-to-use solution: > > http://docs.python.org/library/multiprocessing.html#using-a-pool-of-workers > > -- > http://mail.python.org/mailman/listinf

Re: run a function in another processor in python

2010-12-10 Thread Astan Chee
I just saw this: http://bugs.python.org/issue8094 which seem to be similar to what I'm having. Does anyone know if there is a fix for it? Thanks again On Fri, Dec 10, 2010 at 11:02 PM, Astan Chee wrote: > Thanks for that. I'll try and see if it makes any difference but I'm

Re: run a function in another processor in python

2010-12-10 Thread Astan Chee
ning python 2.6 on windows 7 x64 is it the ammount of memory/cpu speed/number of cpu that is the issue? Thanks for any clarification On Fri, Dec 10, 2010 at 4:16 AM, geremy condra wrote: > On Thu, Dec 9, 2010 at 5:03 AM, Astan Chee wrote: > > Thanks but I'm having trouble wi

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

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: 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

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

webcam in gtalk/xmpp

2010-09-14 Thread Astan Chee
Hi, I was wondering if there is an implementation in any of the xmpp python API (e.g. xmpppy, etc) that implements broadcasting webcam (as well as audio-chat). The documentation on xmpppy doesn't show me how this can be done. Is this even possible? Thanks Astan -- http://mail.python.org/mailma

Re: killing all subprocess childrens

2010-09-01 Thread Astan Chee
Chris Rebert wrote: import os import psutil # http://code.google.com/p/psutil/ # your piece of code goes here myself = os.getpid() for proc in psutil.process_iter(): Is there a way to do this without psutil or installing any external modules or doing it from python2.5? Just wondering. Than

killing all subprocess childrens

2010-09-01 Thread Astan Chee
Hi, I have a piece of code that looks like this: import subprocess retcode = subprocess.call(["java","test","string"]) print "Exited with retcode " + str(retcode) What I'm trying to do (and wondering if its possible) is to make sure that any children (and any descendants) of this process is kil

Re: equivalent of source in python?

2010-08-24 Thread Astan Chee
anks again for the help. Chris Rebert wrote: On Tue, Aug 24, 2010 at 12:18 PM, Astan Chee wrote: Hi, I'm trying to convert my tcsh script to python and am stuck at one part, particularly the part of the script that looks like this: #!/bin/tcsh setenv LSFLOG /var/tmp/lsf_log source /et

equivalent of source in python?

2010-08-24 Thread Astan Chee
Hi, I'm trying to convert my tcsh script to python and am stuck at one part, particularly the part of the script that looks like this: #!/bin/tcsh setenv LSFLOG /var/tmp/lsf_log source /etc/setup unalias cp umask 0 env >> ${AFLOG} What is the equivalent of doing this in python2.5? Thanks again

executing python scripts within wx frames

2010-07-13 Thread Astan Chee
Hi, I'm trying to make one of those frames thats similar to the wx python demo where a folder is filled with demo wx python scripts and there is one main script that opens the other ones in as different items in a tree/notebook. I've gotten most of it figured out except the part where the scrip

sound effects in python

2010-05-18 Thread Astan Chee
Hi, I have a sound file (e.g. .wav; .mp3, etc) in python that I'd like to modify (e.g. change tempo, pitch, add echo, amplify, etc). Any recommendation on how I can achieve this in python independent of platform? Thanks -- 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

calculating a string equation

2010-02-11 Thread Astan Chee
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 is to plug in var_a and var_b's values from vars into eqat and see if eqat returns true or false as well as getting the va

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[

Re: converting XML to hash/dict/CustomTreeCtrl

2010-02-02 Thread Astan Chee
Hi, Sorry for being vague but here my question about converting an xml into a dict. I found some examples online but none gives the dict/result I want. The xml looks like this: This is the note on calculation times 609.081574 2531.972081

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: 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 work

Help with invoking standard mail app in windows

2009-12-18 Thread Astan Chee
Hi, I don't know if my last mail made it or not but here it is again. I'm trying to launch standard mail app in windows and after looking around most look like this: import urllib, webbrowser, win32api def mailto_url(to=None,subject=None,body=None,cc=None): """ encodes the content as a ma

Help with invoking standard mail app in windows

2009-12-18 Thread Astan Chee
Hi, I'm trying to launch standard mail app in windows and after looking around most look like this: import urllib, webbrowser, win32api def mailto_url(to=None,subject=None,body=None,cc=None): """ encodes the content as a mailto link as described on http://www.faqs.org/rfcs/rfc2368.html

Re: ignore special characters in python regex

2009-07-21 Thread Astan Chee
e characters in regular expression that have special significance, I don't know which ones to add a '\' infront of. Thanks anyway John Machin wrote: On Jul 21, 3:02 pm, Astan Chee wrote: Hi, I'm reading text from a file (per line) and I want to do a regex using these lines

ignore special characters in python regex

2009-07-20 Thread Astan Chee
Hi, I'm reading text from a file (per line) and I want to do a regex using these lines but I want the regex to ignore any special characters and treat them like normal strings. Is there a regex function that can do this? Here is what I have so far: fp = open('file.txt','r') notes = fp.readlines

Re: copytree with timeout in windows

2009-07-06 Thread Astan Chee
Tim Golden wrote: Astan Chee wrote: Hi, I'm trying to modify the copytree function in shutil so that any file being copied does not take more than 5 minutes (if it does, skip to the next one). One suggestion is to use the CopyFileEx API exposed in the win32file module from py

copytree with timeout in windows

2009-07-06 Thread Astan Chee
Hi, I'm trying to modify the copytree function in shutil so that any file being copied does not take more than 5 minutes (if it does, skip to the next one). This is what I have so far: import shutil import signal, os def handler(signum, frame): print 'Signal handler called with signal', si

square box graph (?) API in python

2009-06-22 Thread Astan Chee
Hi, I'm trying to graph something that looks like the bottom half of this http://windirstat.info/images/windirstat.jpg I was wondering if there is any API in python or wxPython specifically to do this? I know it is possible to do calculation manually and use floatcanvas or something similar but

square box graph (?) API in python

2009-06-22 Thread Astan Chee
Hi, I'm trying to graph something that looks like the bottom half of this http://windirstat.info/images/windirstat.jpg I was wondering if there is any API in python or wxPython specifically to do this? I know it is possible to do calculation manually and use floatcanvas or something similar but

factoring wx.Image

2009-02-26 Thread Astan Chee
Hi, I want to factor (red, green and blue at the same time) an image using wx but without any GUI display or windows but it keeps crashing and if I set the checks to ignore it, it doesn't produce the images at all. It looks like this: import wx img = wx.Image("star.jpg",wx.BITMAP_TYPE_BMP) fac

get most common number in a list with tolerance

2009-02-20 Thread Astan Chee
Hi, I have a list that has a bunch of numbers in it and I want to get the most common number that appears in the list. This is trivial because i can do a max on each unique number. What I want to do is to have a tolerance to say that each number is not quite unique and if the difference from o

Re: USB in python

2009-01-26 Thread Astan Chee
Brian Allen Vanderburg II wrote: This is the FT245 chip which is basically USB-to-Parallel. Chips: http://www.ftdichip.com/Products/FT245R.htm Kit/Board: http://www.ftdichip.com/Products/EvaluationKits/UM245R.htm The spec sheet for the board seems quite simple. It's pin out is similar to tha

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-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 Astan.

Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: Others suggested the parallel port. It is the natural choice for such things, with two caveats: - it is legacy, and thus often not available on modern hardware, especially on mobile ones. So if you want it be prepared to additionally buy a usb2parallel-adapter. -

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

USB in python

2009-01-21 Thread Astan Chee
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 power pin is getting). Now I'm confused to if the softwa

Re: defining class functions

2009-01-19 Thread Astan Chee
31 PM, James Mills mailto:prolo...@shortcircuit.net.au>> wrote: On Tue, Jan 20, 2009 at 10:08 AM, Astan Chee mailto:astan.c...@al.com.au>> wrote: > Hi, > I have two classes in python that are in two different files/python scripts. > Class A uses Class

defining class functions

2009-01-19 Thread Astan Chee
Hi, I have two classes in python that are in two different files/python scripts. Class A uses Class B like this: class B(object): def function1(self,something): pass def function2(self,something): print "hello one" print something class A(object): def __init__(self

Re: equivalent of py2exe in other os

2008-10-13 Thread Astan Chee
Hi, Thanks for all the links and information. It seems that I can't make linux binaries in windows of my python code. What I mean is that I am using windows to develop my python code, but I want it to run in linux and mac. So far py2exe,gui2exe,pyinstaller,freeze,etc seems to all create .exe i

Re: equivalent of py2exe in other os

2008-10-07 Thread Astan Chee
osx. http://python.net/crew/atuining/cx_Freeze /L I know of a program called gui2exe which is a gui which uses the three to compile executables of your os of choise (but I think only py2exe was implemented thus far). Almar 2008/10/7 Astan Chee <[EMAIL PROTECTED] <mailto:[EMAIL PROTE

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. Choose

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

parsing .pcap files

2008-06-06 Thread Astan Chee
Hi, Im using pyflag to parse .pcap files. Pyflag displays the data part of the .pcap file in binary and I was wondering what this means. How do I decode the 'data' part of the packet without using external libraries? What does these non-alpha numerical information mean? Is there a (python) dic

Re: threads problem in python

2008-05-13 Thread Astan Chee
t; <[EMAIL PROTECTED]> wrote: En Tue, 13 May 2008 06:42:13 -0300, Astan Chee <[EMAIL PROTECTED]> escribió: I'm confused trying to understand your requirements too. "run a class?" Threads execute code, it's easier to think of them as *functions* that are executed a

threads problem in python

2008-05-13 Thread Astan Chee
Hi, I have 2 classes in python, the first one runs first and and then the first one calls the second class. I want it to run the second class as a separate thread but I want the first one to wait until the second class is dead. Im having problem in both killing the second class when its done an

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

get number that is raised to the power of

2008-05-02 Thread Astan Chee
Hi, Im not sure if this is more of a math question or a python question. I have a variable in python: >>> v = 10.0**n is there a way to find the value of n if i know only v aside from str(v).split('+')[1] ? that seems like too much of a hack and I was wondering if there was a faster way of doi

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

tool to calculate color combination

2008-04-30 Thread Astan Chee
Hi, I was just wondering if there is a tool/script in python that allows me to do color calculations; specifically, when I add them. Also I was thinking that for this to work other than a simple way, some form of measure is included. e.g 50% red(1,0,0) + 50% yellow(1,1,0) = 100% orange(1,0.7,0

Re: simple chemistry in python

2008-04-29 Thread Astan Chee
CTED] Noel On Apr 29, 8:48 am, Astan Chee <[EMAIL PROTECTED]> wrote: Hi, Im looking for a python module to do simple chemistry things. Things like, finding the name of elements given the atomic number (and vice versa); what state the given matter is in depending on certain parameters;

simple chemistry in python

2008-04-29 Thread Astan Chee
Hi, Im looking for a python module to do simple chemistry things. Things like, finding the name of elements given the atomic number (and vice versa); what state the given matter is in depending on certain parameters; maybe even color of certain elements or even calculating the result of combin

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

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

testing client-server sockets

2008-04-18 Thread Astan Chee
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 try to connect the client to the server on the same machine, but it gives me a 'port already in use' error. I just want the client to c

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. Choose two."

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

copy file over LAN

2008-03-26 Thread Astan Chee
Hi, I have a file on another machine on the local network (my machine and local machines are on windows) and I want to copy it locally. Now the machine requires authentication and when I try to do a import shutil shutil.copy(r'\\remotemachine\c$\temp\filename',r'C:\folder\test.txt') and it gives

Help with jabber client in wx

2008-02-10 Thread Astan Chee
Hi, A project Im working on is a jabber client working with wx to interface with uTorrent's webUI using a python API for it. My project can be found here: http://code.google.com/p/gtalktorrent/ A quick note, the project started as a google talk client, but it seems that xmpppy is flexible enough

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

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

Bittorent client with google talk interface

2008-01-20 Thread Astan Chee
Hi, I dont know where to send this but I'll try here. I recently took the newest version of ABCTorrent and its code and added some features to it that I find very useful. Basically it is like a webUI except it connect to google's google talk and you can issue commands from it. Kinda like a com

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

2008-01-17 Thread Astan Chee
How about: import socket, urllib2 timeout = 10 socket.setdefaulttimeout(timeout) try: auth_handler = urllib2.HTTPBasicAuthHandler() opener = urllib2.build_opener(auth_handler) #this used if we need authentication urllib2.install_opener(opener) req = urllib2.Request('http://website.com') f = urll

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

Restart crashing modules in windows

2008-01-14 Thread Astan Chee
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 it by attempting to fix the crash; rather what Im trying to do is make another module outside

(bit)torrent source code help

2008-01-13 Thread Astan Chee
Hi, Im using windows XP and I was wondering if anyone had any experience in compiling (using py2exe) the official bittorrent client ( http://download.bittorrent.com/dl/BitTorrent-5.2.0.tar.gz ) or any bittorrent client open source and written in python. I ask since I am trying to make several o

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

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

socket in python with proxies

2007-12-20 Thread Astan Chee
Hi, I have a proxy server that requires authentication on a non-standard port and Im trying to connect to it via socket.connect() I tried doing this: import socket server = ("username:[EMAIL PROTECTED]",1234) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(server) I keep getting t

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.python.org/mailman/li

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.python.org/mailman/li

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://mail.python.org/mailman/lis

python "sounds-like" module

2007-12-12 Thread Astan Chee
Hi, Thanks for all the help from the previous problem. Turns out I didnt have to use wxSizers, just change the size of my wxWidgets everytime a EVT_SIZE is called. Anyway, Im trying to find a python module (im not sure if it exists) that takes two words and compares if they sound the same. So 'r

sizers in wxpanels/notebooks

2007-12-07 Thread Astan Chee
Hi, I have a wxNoteBook with a bunch of wxPanels attached to it as pages. Every page has its own GUI items. What Im trying to do is on a certain page, a certain GUI (wxTextCtrl) to be resized every time the notebook or panel is resized. But everything else stays the same. Now I know I can use si

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]

reading raw variables from file

2007-11-29 Thread Astan Chee
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]} the problem is I want to read this file and load whatever variables written in it as normal python variable st

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.python.org/m

get position is scrolled wxScrolledWindow

2007-08-06 Thread Astan Chee
Hi, I have a wxScrolledWindow, and some things drawn on it. I've hooked the left click event to a certain function I've got. Anyway, everytime I do a event.GetPosition() on the position of the mouse on the wxScrolledWindow, it returns the physical location or position of the mouse. Does anyone

removing redundant elements in a dictionary

2007-07-31 Thread Astan Chee
Hi, I have a dictionary which looks something like this: elem = {"co":[1,2,3],"cp":[3,2,1],"pp":[5,6,7],"cl":[1,2,3],"qw":[6,7,8],"qa":[8,7,6]} what Im trying to do is find all keys in the list that have the same value and delete those (except one); thereby removing all redundant keys so tha

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

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. >

upgrading python (and other modules)

2007-03-28 Thread Astan Chee
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. The problem Im currently having is that in my code: from wxPython.wx import * from wxPython.grid import * from wxPython.html impor

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

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://mail.python.org/mailman/l

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

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

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-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

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

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

urllib2, proxies and https

2006-08-18 Thread Astan Chee
Hi again, According to https://demo.launchpad.net/products/python/+bug/56872 or more specifically, the example of its working code: http://librarian.demo.launchpad.net/3507227/urllib2_proxy_auth.py I can use urllib2 via proxy to access a https site(specifically hooking it up to libgmail). The prob

Re: a bug in list.remove?

2006-08-18 Thread Astan Chee
Tim Chase wrote: >> I have 2 lists. What Im doing is check the first list and remove all >> occurances of the elements in the second list from the first list, >> like so: >> >>> ps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] >> >>> qs = [6,7,8,9,10,11,12,1,2] >> >>> for p in ps: >> if p in

a bug in list.remove?

2006-08-18 Thread Astan Chee
Hi all, I have 2 lists. What Im doing is check the first list and remove all occurances of the elements in the second list from the first list, like so: >>> ps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] >>> qs = [6,7,8,9,10,11,12,1,2] >>> for p in ps: if p in qs: ps.remove(p) The prob

  1   2   >