Re: Twisted and txJSON-RPC

2011-03-20 Thread Travis
This problem has come up for me as well. $ sudo easy_install pylisp-ng [sudo] password for _: install_dir /usr/local/lib/python2.6/dist-packages/ Searching for pylisp-ng Reading http://pypi.python.org/simple/pylisp-ng/ Reading https://launchpad.net/pylisp-ng Best match: pyLisp-NG 2.0.0 Downloadin

Re: python time

2011-03-20 Thread ecu_jon
i see. i was using time as a variable name , messing it all up.im not going to post the whole backup script here, but here are a few lines that i changed to make it work. from datetime import datetime from os.path import join, getsize import time,os,string,getpass,md5,ConfigParser from time import

Re: reimport module every n seconds

2011-03-20 Thread John Nagle
On 3/17/2011 3:53 PM, Aahz wrote: In article<753e9884-60eb-43cf-a647-12b29ed28...@y31g2000prd.googlegroups.com>, Santiago Caracol wrote: Don't do that. =A0;-) =A0I suggest using exec instead. =A0However, I wo= uld be surprised if import worked faster than, say, JSON (more precisely, I doubt t

Re: python time

2011-03-20 Thread Nick Stinemates
You should just use cron (or Windows Scheduled Tasks if that's your thing) for job scheduling, allowing people the flexibility of the environment they already know. Nick On Sun, Mar 20, 2011 at 6:19 PM, ecu_jon wrote: > I'm working on a script that will run all the time. at time specified > in

Re: python time

2011-03-20 Thread eryksun ()
On Monday, March 21, 2011 12:07:13 AM UTC-4, ecu_jon wrote: > so then why does this not work ? > > import time > ... > time = config.get("myvars", "time") > ... > while a>0: > #import time > time.sleep(2) > > if i uncomment the import time line in the while loop it works. > boggle... An i

Re: python time

2011-03-20 Thread ecu_jon
so then why does this not work ? from datetime import datetime from os.path import join, getsize import time,os,string,getpass,md5,ConfigParser from time import strftime,localtime config = ConfigParser.ConfigParser() config.read("config.ini") date = config.get("myvars", "date") time = config.get(

Re: python time

2011-03-20 Thread MRAB
On 21/03/2011 03:29, ecu_jon wrote: On Mar 20, 10:48 pm, ecu_jon wrote: On Mar 20, 10:09 pm, Dave Angel wrote: On 01/-10/-28163 02:59 PM, ecu_jon wrote: I'm working on a script that will run all the time. at time specified in a config file, will kick-off a backup. problem is, its not ac

Re: python time

2011-03-20 Thread MRAB
On 21/03/2011 02:48, ecu_jon wrote: On Mar 20, 10:09 pm, Dave Angel wrote: On 01/-10/-28163 02:59 PM, ecu_jon wrote: I'm working on a script that will run all the time. at time specified in a config file, will kick-off a backup. problem is, its not actually starting the job. the double whil

Re: python time

2011-03-20 Thread ecu_jon
On Mar 20, 10:48 pm, ecu_jon wrote: > On Mar 20, 10:09 pm, Dave Angel wrote: > > > > > On 01/-10/-28163 02:59 PM, ecu_jon wrote: > > > > I'm working on a script that will run all the time. at time specified > > > in a config file, will kick-off a backup. > > > problem is, its not actually startin

Re: python time

2011-03-20 Thread ecu_jon
On Mar 20, 10:09 pm, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, ecu_jon wrote: > > > > > I'm working on a script that will run all the time. at time specified > > in a config file, will kick-off a backup. > > problem is, its not actually starting the job. the double while loop > > runs, the fi

Re: os.utime

2011-03-20 Thread Dan Stromberg
On Sun, Mar 20, 2011 at 7:12 PM, Christian Heimes wrote: > Am 21.03.2011 01:40, schrieb Dan Stromberg: > > 1) If you want to set the ctime to the current time, you can os.rename() > the > > file to some temporary name, and then quickly os.rename() it back. > > > > 2) You can sort of set a file to

Re: Pyserial

2011-03-20 Thread Manatee
On Mar 20, 9:06 pm, "Littlefield, Tyler" wrote: >  >The windows msi install fails saying there is no python install found >  >in the registry. Is there a workaround for this? Can I edit the >  >registry and manually enter the information? > I've came to realize that the 64-bit version of python do

Re: os.utime

2011-03-20 Thread Christian Heimes
Am 21.03.2011 01:40, schrieb Dan Stromberg: > 1) If you want to set the ctime to the current time, you can os.rename() the > file to some temporary name, and then quickly os.rename() it back. > > 2) You can sort of set a file to have an arbitrary ctime, by setting the > system's clock to what you

Re: Pyserial

2011-03-20 Thread Manatee
On Mar 20, 9:06 pm, "Littlefield, Tyler" wrote: >  >The windows msi install fails saying there is no python install found >  >in the registry. Is there a workaround for this? Can I edit the >  >registry and manually enter the information? > I've came to realize that the 64-bit version of python do

Re: python time

2011-03-20 Thread Dave Angel
On 01/-10/-28163 02:59 PM, ecu_jon wrote: I'm working on a script that will run all the time. at time specified in a config file, will kick-off a backup. problem is, its not actually starting the job. the double while loop runs, the first comparing date works. the second for hour/min does not. #

Re: send function keys to a legacy DOS program

2011-03-20 Thread Justin Ezequiel
On Mar 20, 7:30 am, Alexander Gattin wrote: > On Sun, Mar 20, 2011 at 12:52:28AM +0200, > > You need to place 2 bytes into the circular buffer > to simulate key press. Lower byte is ASCII code, > higher byte is scan code (they are the same for > functional keys, whe using default keycode set#1): >

Re: Regex in if statement.

2011-03-20 Thread Thomas L. Shinnick
At 07:46 PM 3/20/2011, Ken D'Ambrosio wrote: Hey, all -- I know how to match and return stuff from a regex, but I'd like to do an if, something like (from Perl, sorry): if (/MatchTextHere/){DoSomething();} How do I accomplish this in Python? You say you've done matching and accessing stuff fr

Re: Regex in if statement.

2011-03-20 Thread Rhodri James
On Mon, 21 Mar 2011 00:46:22 -, Ken D'Ambrosio wrote: Hey, all -- I know how to match and return stuff from a regex, but I'd like to do an if, something like (from Perl, sorry): if (/MatchTextHere/){DoSomething();} How do I accomplish this in Python? The basic routine is to do the match

Re: Regex in if statement.

2011-03-20 Thread python
I agree with previous comments. There are plenty of good tutorials, I have sometimes found more useful for learning than the manuals. The manuals are good but I prefer examples. http://www.tutorialspoint.com/python/python_reg_expressions.htm http://www.awaretek.com/tutorials.html#regular Bill Sn

python time

2011-03-20 Thread ecu_jon
I'm working on a script that will run all the time. at time specified in a config file, will kick-off a backup. problem is, its not actually starting the job. the double while loop runs, the first comparing date works. the second for hour/min does not. #python file import os,string,,time,getpass,C

Re: Regex in if statement.

2011-03-20 Thread Terry Reedy
On 3/20/2011 8:46 PM, Ken D'Ambrosio wrote: Hey, all -- I know how to match and return stuff from a regex, but I'd like to do an if, something like (from Perl, sorry): if (/MatchTextHere/){DoSomething();} How do I accomplish this in Python? Look at the doc to see what are the possible return

Re: Regex in if statement.

2011-03-20 Thread Benjamin Kaplan
On Sun, Mar 20, 2011 at 8:46 PM, Ken D'Ambrosio wrote: > Hey, all -- I know how to match and return stuff from a regex, but I'd > like to do an if, something like (from Perl, sorry): > > if (/MatchTextHere/){DoSomething();} > > How do I accomplish this in Python? > > Thanks! > > -Ken > Python doe

Re: Pyserial

2011-03-20 Thread Littlefield, Tyler
>The windows msi install fails saying there is no python install found >in the registry. Is there a workaround for this? Can I edit the >registry and manually enter the information? I've came to realize that the 64-bit version of python does not work with 32-bit modules in terms of the installer

Re: Pyserial

2011-03-20 Thread Terry Reedy
On 3/20/2011 8:46 PM, Manatee wrote: The windows msi install fails saying there is no python install found in the registry. Is there a workaround for this? Can I edit the registry and manually enter the information? I am running Python 2.71 There is no traceback, the installation fails immediat

Regex in if statement.

2011-03-20 Thread Ken D'Ambrosio
Hey, all -- I know how to match and return stuff from a regex, but I'd like to do an if, something like (from Perl, sorry): if (/MatchTextHere/){DoSomething();} How do I accomplish this in Python? Thanks! -Ken -- http://mail.python.org/mailman/listinfo/python-list

Pyserial

2011-03-20 Thread Manatee
The windows msi install fails saying there is no python install found in the registry. Is there a workaround for this? Can I edit the registry and manually enter the information? I am running Python 2.71 There is no traceback, the installation fails immediately -- http://mail.python.org/mailman

Re: os.utime

2011-03-20 Thread Christian Heimes
Am 21.03.2011 00:52, schrieb monkeys paw: > I used os.uname to succesfully change the access and mod times of > a file. My question is, is there any other date store for a file that > indicates the creation time, or is it impossible to detect that a file > with an older mod/access time is actually

Re: os.utime

2011-03-20 Thread Dan Stromberg
1) If you want to set the ctime to the current time, you can os.rename() the file to some temporary name, and then quickly os.rename() it back. 2) You can sort of set a file to have an arbitrary ctime, by setting the system's clock to what you need, and then doing the rename thing above - then res

Re: ttk styles

2011-03-20 Thread Peter
Here is what I came up with - hopefully I have understood the process correctly and therefore that the comments are correct :-) I am not sure I have the color of the indicator when it is (de)pressed correct, but to my eyes the color 'snow' looks like the same color used with a Tkinter Checkbutton

os.utime

2011-03-20 Thread monkeys paw
I used os.uname to succesfully change the access and mod times of a file. My question is, is there any other date store for a file that indicates the creation time, or is it impossible to detect that a file with an older mod/access time is actually a 'new' file? os.utime('sum.py', (time.time(),ti

Re: Could I joined in this Happy family

2011-03-20 Thread Colin J. Williams
On 18-Mar-11 15:47 PM, Nick Stinemates wrote: > Welcome aboard ! > > On Mar 18, 2011 11:34 AM, "duxiu xiang" > wrote: > > Dear friends: > > I am in China.For some rearon,I cannot visit your Google Group.May > > I joint this mail list for help in learning Python?

ANN: psutil (python process utilities) 0.2.1 released

2011-03-20 Thread Giampaolo Rodolà
Hi, I'm pleased to announce the 0.2.1 release of psutil: http://code.google.com/p/psutil === About === psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalitie

drawing polygons in Google Earth using wxpython

2011-03-20 Thread !!AhmedLegend!!
...i am working on my graduation project and i need to draw some polygons in Google Earth map automatically using python so any one was subjected to something like that or have a solution plz respond ASAP ...given that i was able to open Google Earth from python and focus on a certain point and als

Re: os.walk/list

2011-03-20 Thread ecu_jon
yes i agree breaking stuff into smaller chunks is a good way to do it. even were i to do something like def safe_copy() f1=file(files ,'rb') f2 = file(os.path.join(currentdir,fname,files)) truth = md5.new(f1.read()).digest() == md5.new(f2.read()).digest() if truth == 0:

gdbm thread safety

2011-03-20 Thread Laszlo Nagy
Hi, Are gdbm objects thread safe? I searched through mailing list archives and the documentation but did not find the answer. My only concerns are: * is it safe to use the same gdbm object in read-only mode from many threads? * is it safe to use the same gdbm object from many thre

Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 6:18 pm, Noah Hall wrote: > > class Message: > >    def __init__(self,string1,string2,lenstr1,lenstr2): > >        self.string1="MY" > >        self.string2="NAME" > >        self.lenstr1=lenstr1 > >        self.lenstr2=lenstr2 > > The variables string1 and string2 that you're passing h

Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 6:18 pm, Noah Hall wrote: > > class Message: > >    def __init__(self,string1,string2,lenstr1,lenstr2): > >        self.string1="MY" > >        self.string2="NAME" > >        self.lenstr1=lenstr1 > >        self.lenstr2=lenstr2 > > The variables string1 and string2 that you're passing h

Re: Some Minor questions on Class and Functions

2011-03-20 Thread Noah Hall
> class Message: >    def __init__(self,string1,string2,lenstr1,lenstr2): >        self.string1="MY" >        self.string2="NAME" >        self.lenstr1=lenstr1 >        self.lenstr2=lenstr2 The variables string1 and string2 that you're passing here are in fact useless. They don't do anything insid

Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 11:13 am, joy99 wrote: > On Mar 20, 9:39 am, Steven D'Aprano > > > +comp.lang.pyt...@pearwood.info> wrote: > > On Sat, 19 Mar 2011 16:57:58 -0700, joy99 wrote: > > > Dear Group, > > > > I am trying to pose two small questions. > > > > 1) I am using Python 2.6.5 (r265:79096, Mar 19 2010

value of pi and 22/7

2011-03-20 Thread Gerald Britton
Surely on track for the *slowest* way to compute pi in Python (or any language for that matter): math.sqrt( sum( pow(k,-2) for k in xrange(sys.maxint,0,-1) ) * 6. ) Based on the Riemann zeta function: The sum of 1/k^2 for k = 1:infinity converges to pi^2 / 6 Depending on your

Re: Bounds checking

2011-03-20 Thread Martin De Kauwe
On Mar 19, 8:40 pm, Steven D'Aprano wrote: > On Sat, 19 Mar 2011 01:38:10 -0700, Martin De Kauwe wrote: > >> Why don't you do the range check *before* storing it in state? That way > >> you can identify the calculation that was wrong, instead of merely > >> noticing that at some point some unknown

Re: send function keys to a legacy DOS program

2011-03-20 Thread LehH Sdsk8
On Mar 10, 9:58 pm, Justin Ezequiel wrote: > Greetings, > > We have an old barcode program (MSDOS and source code unavailable.) > I've figured out how to populate the fields (by hacking into one of > the program's resource files.) > However, we still need to hit the following function keys in sequ

Re: os.walk/list

2011-03-20 Thread Peter Otten
ecu_jon wrote: > so i am trying to add md5 checksum calc to my file copy stuff, to make > sure the source and dest. are same file. > i implemented it fine with the single file copy part. something like : > for files in sourcepath: > f1=file(files ,'rb') > try: > shutil.

Re: import newer

2011-03-20 Thread eryksun ()
On Sunday, March 20, 2011 12:27:38 AM UTC-4, xinyou yan wrote: > I begin to study with <> > > I met a problem with import. > > first > I creat a file hello.py > > then in fedora /14 > I type python to the interpreter > > >>> import hello > Traceback (most recent call last): > File "", lin