Python and MySQL server

2005-07-14 Thread Unknown
Python 2.4 Linux kernel 2.6.12 Hi, 1. How do I make the following statement to search for all Strings I input from console? for example, with the code below I need to enter %hello world% (yeah, including the % symbols) to find all entries for hello world on the tableName. But I want to set the %

error processing variables

2005-09-09 Thread Unknown
PROBLEM: for some reason, the variables won't work outside the function. I tried fix it by converting the variables to str and unicode and still no joy. The only way it works is by typing each source and destination file by hand on the shutil.copy2() method. Or by specify

Re: Creating a function for a directory

2013-11-12 Thread unknown
On Mon, 11 Nov 2013 14:26:46 -0800, Matt wrote: > So I want to take the file, "desktop/test.txt" and write it to > "desktop/newfolder/test.txt". I tried the below script, and it gave me: > "IOError: [Errno 2] No such file or directory: 'desktop/%s.txt'". Any > suggestions would be great. > > >

Re: Creating a function for a directory

2013-11-12 Thread unknown
On Tue, 12 Nov 2013 11:24:02 +0100, Peter Otten wrote: > unknown wrote: > >> On Mon, 11 Nov 2013 14:26:46 -0800, Matt wrote: >> >>> So I want to take the file, "desktop/test.txt" and write it to >>> "desktop/newfolder/test.txt". I tried th

Re: Implementing a multivibrator function with python

2013-11-12 Thread unknown
On Tue, 12 Nov 2013 06:44:05 -0800, JL wrote: > I am actually running python on raspberry pi. The trigger event is a > button-press. > > On Monday, November 11, 2013 6:56:03 PM UTC+8, Dave Angel wrote: >> On Mon, 11 Nov 2013 01:41:58 -0800 (PST), JL >> >> wrote: >> >> > - If the event happens

Re: PyMyth: Global variables are evil... WRONG!

2013-11-14 Thread unknown
On Thu, 14 Nov 2013 14:29:41 +1100, Chris Angelico wrote: > On Thu, Nov 14, 2013 at 2:22 PM, Rick Johnson > wrote: >> Yeah, a "global" keyword that extends access ONLY as far as module >> level scope -- hardly a *true* global. > > I have yet to see any language that gives true globals. At very b

Re: Invalid syntax with print "Hello World"

2013-11-14 Thread unknown
On Thu, 14 Nov 2013 07:05:08 -0800, johannes.gunz97 wrote: > Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann: >> obviously total mewbiew: >> >> My first program in Python Windows >> >> print "Hello World" >> >> I select Run/Run Module and get an error: >> >> Syntax error, w

Re: Immediate requirement - Sr. Business Analyst for Pricewaterhouse Coopers (PwC) in Tampa, FL.

2013-11-07 Thread unknown
On Thu, 07 Nov 2013 11:45:24 -0800, parker.svksystems wrote: > Hi, > > Immediate requirement - Sr. Business Analyst for Pricewaterhouse Coopers > (PwC) in Tampa, FL. > > Sr. Business Analyst – BA - # 900663 > > Start: Immediate Duration: 9 - 12 Months > > >

Re: To whoever hacked into my Database

2013-11-08 Thread unknown
> > You have demonstrated significant difficulties in social interaction and > behavior. Pot - Kettle -- https://mail.python.org/mailman/listinfo/python-list

Re: To whoever hacked into my Database

2013-11-08 Thread unknown
On Fri, 08 Nov 2013 18:28:39 +0200, Νίκος Αλεξόπουλος wrote: > Στις 8/11/2013 6:06 μμ, ο/η Mark Lawrence έγραψε: > >> But let's not waste any more time on this. Please get back to checking >> your web site. She might have been hacking again. Or little fingers >> from one of my highly paid cont

Re: To whoever hacked into my Database

2013-11-08 Thread unknown
On Fri, 08 Nov 2013 18:57:21 +0200, Νίκος Αλεξόπουλος wrote: > Στις 8/11/2013 6:48 μμ, ο/η unknown έγραψε: >> On Fri, 08 Nov 2013 18:28:39 +0200, Νίκος Αλεξόπουλος wrote: >> >>> Στις 8/11/2013 6:06 μμ, ο/η Mark Lawrence έγραψε: >>> >>>> But let's

Re: datetime question

2013-11-10 Thread unknown
On Sat, 09 Nov 2013 15:43:53 +0200, Νίκος Αλεξόπουλος wrote: > Στις 9/11/2013 2:45 μμ, ο/η Mark Lawrence έγραψε: >> On 08/11/2013 23:02, Νίκος Αλεξόπουλος wrote: >>> Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε: On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote: > I sa

replace string in a file

2008-03-15 Thread Unknown
Hi, I've got this code : cb = open("testfile", "r+") f = cb.readlines() for line in f: rx = re.match(r'^\s*(\d+).*', line) if not rx: continue else: serial = rx.group(1) now = time.time() today = time.strftime('%Y%m%d00', time.localtime(now)) to

Re: replace string in a file

2008-03-15 Thread Unknown
Thanks, andrei. I'll try that. Le Sat, 15 Mar 2008 14:25:21 -0700, andrei.avk a écrit : > What you want to do is either 1. load everything up into a string, > replace > text, close file, reopen it with 'w' flag, write string to it. OR if > file is too big, you can read each line, replace, write t

Re: replace string in a file

2008-03-16 Thread Unknown
Le Sat, 15 Mar 2008 16:55:45 -0700, joep a écrit : > you can also use standard module fileinput.input with ''inplace'' option > which backs up original file automatically. > > from python help for fileinput: > > Optional in-place filtering: if the keyword argument inplace=1 is passed > to input(

(beginner) logging config not working

2011-04-29 Thread Unknown Moss
Hi This is a beginner question. Thanks for the hand. I've been asked to maintain some poorly constructed python code. Logging is weak. Getting it to work with python logging programmatically was easy. However, I'd like to refactor all the logging code into configuration since I see the need for

Re: (beginner) logging config not working

2011-04-30 Thread Unknown Moss
On Apr 29, 10:09 pm, Peter Otten <__pete...@web.de> wrote: > Unknown Moss wrote: > > Hi > > > This is a beginner question. Thanks for the hand. > > > I've been asked to maintain some poorly constructed python code. > > Logging is weak. Getting it to w

Re: (beginner) logging config not working

2011-04-30 Thread Unknown Moss
On Apr 29, 10:09 pm, Peter Otten <__pete...@web.de> wrote: > Unknown Moss wrote: > > Hi > > > This is a beginner question. Thanks for the hand. > > > I've been asked to maintain some poorly constructed python code. > > Logging is weak. Getting it to w

(beginner question) ConfigParser nuances

2011-05-02 Thread Unknown Moss
Hi - Beginner question here. I'm working with ConfigParser. I'd like to take a multiline variable and convert it directly to an array. Seems like a common problem, but I don't see how I can do it without doing a little parsing in my own code. Here's what I'm doing ... >>> import ConfigParser >>>

Re: (beginner question) ConfigParser nuances

2011-05-02 Thread Unknown Moss
On May 2, 3:25 pm, Chris Rebert wrote: > On Mon, May 2, 2011 at 3:04 PM, Unknown Moss wrote: > > Hi -Beginnerquestionhere. I'm working with ConfigParser. I'd like > > to take a multiline variable and convert it directly to an array. > > Seems like a common  proble

Is Python appropriate for web applications?

2005-04-14 Thread Unknown User
I am a Python programmer and I'm thinking about learning PHP, which is similar to C++ (quite different from Python). I want to start writing web applications. Do you think if I learn PHP I'll develop faster? Does PHP have more features? How about the speed of execution? What are the pros and

Re: Is Python appropriate for web applications?

2005-04-16 Thread Unknown User
Thank you very much. On Fri, 15 Apr 2005 06:47:14 -0300, Peter Maas <[EMAIL PROTECTED]> wrote: Unknown User schrieb: I am a Python programmer and I'm thinking about learning PHP, which is similar to C++ wrong (quite different from Python). true I want to start writing web applicatio

Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the like, just foo). I have

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: > In a spirit of teaching people to fish... > > ... If you put something like "Python windows registry" into Google, you > get quite a few hits, the top one of which is probably pointing to the stdlib > _winreg module, but several others point towards wrapper classes, modules > et

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: > Well, I attach a kind of explanatory Noddy example I wrote a few years ago > for someone on the python-win32 list. I think, glancing over it, that it > includes > what you need to know, although not necessarily in the right order. I'm happy > to > explain if things aren't cle

Re: Scanning through Windows registry...

2008-05-07 Thread Unknown Hero
Thank you, I think I can manage now. It's nice that you could spare some time to help me in this, Tim. People like you make the world a better place :) I'll post my code here once I have time to write it, currently I'm rather busy. That is merely for optimization suggestions and for others who mig

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
On 7 touko, 14:25, Unknown Hero <[EMAIL PROTECTED]> wrote: > I'll post my code here once I have time to write it, currently I'm > rather busy. That is merely for optimization suggestions and for > others who might need the same sort of code I did. > > Thank you once

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
On 9 touko, 12:51, Unknown Hero <[EMAIL PROTECTED]> wrote: > Finally managed to get it to work (heh, I was pretty darn lost even > though I had the best help) but as promised, I'll post my code here > for those who might be interested in it. The biggest of thanks to Tim >

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
Ah, never mind, got it to work. Here's the code now. I hope I won't run into another problems later :D #Goes through all keys and subkeys in the selected hive (defined as root) and replaces the value 'old' with the value 'new' # #IMPORTANT! You should always back up the registry before attemptin