I tried
logfile=file(r'test.txt','w+')
logfile.write('datetime')
test=logfile.readlines()
print test
I got :
Open an encoded file using the given mode and return
a wrapped version providing transparent encoding/decoding.
Note: The wrapped version will only accept the object forma
logfile=file(r'test.txt','a+')
logfile.write('datetime')
logfile.flush()
test=logfile.readlines()
print test
I added logfile.flush(), the 'datetime' was written in the file
correctly but I couldn't get any result...
Crazy!
Garry
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 6 Jan 2005 12:55:22 +0530, Binu K S <[EMAIL PROTECTED]> wrote:
>>>The file's current position moves as you write into it.
I concure and have figured out the solution BUT while reading from the
file from the position where the file handler is, should return
"Null/Blank/Anything in this world
On Thu, 6 Jan 2005 14:27:40 +0530, Binu K S <[EMAIL PROTECTED]> wrote:
> I'm sorry, I didn't get what you trying to say here. Where do you see
> a read altering the file? An example might help.
Please try:
logfile=file(r'test.txt','w+')
logfile.write('datetime')
Check the contents of test.txt, y
I upgraded my python to 2.3 from 2.2 but Apache (V 2.0.4) is taking
old libraries for processing. I also made a soft link redirecting the
old files to new files but of no help... These error logs shows that
it is still using 2.2 :o(
[Tue Jan 11 16:18:45 2005] [error] [client 127.0.0.1] import
I am using Redhat 9.0/python2.3. I installed pyPgSQL-2.4.tar.gz and it
was successfull. Now when I am trying to import that module, I got:
Python 2.3.3 (#1, Jan 11 2005, 15:24:09)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more infor
> did you really do ./configure, make and make install?
No, I did python setup.py build and python setup.py install
> where is libpq.*
linpq is there in /usr/lib/python2.3/site-packages/pyPgSQL/
> was a postgres installation present while doing ./configure et all?
No, But I installed postgresql-
And now when I did...
cd /usr/local/lib/python2.3/site-packages/pyPgSQL/libpq/
[EMAIL PROTECTED] libpq]# python __init__.py
Traceback (most recent call last):
File "__init__.py", line 23, in ?
from libpq import *
ImportError: ./libpqmodule.so: undefined symbol: PyUnicodeUCS2_EncodeDecimal
I am using Mysql version 5.0.2-alpha on RedHat 9.0 (python2.2)
When I try to import MySQldb
I get:
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (m
I have two classes;
a.py -->
#!/usr/bin/python
global test
test =''
class a(b):
def __init__(self,test):
print test
print 'Outside: '+test
b.py -->
#!/usr/bin/python
import a
a.a('Garry')
I want to pass this string (or any object later) to a.py and that too
outside the
The purpose is, I pass a list to a class in a module but I want to use
that list out of the scope of that class and that too not in any other
class or a function but in the main program...
The problem is that when I import that, the statements in the module
which are not in the class are executed f
try:
re.search("()(/python>)", str).group()
except:
print 'not found'
otherwise,
re.search("().*?(\/python>)", str).group()
this is will help!
Regards,
Gurpreet Singh
Blogging [at] http://garrythegambler.blogspot.com
On 4 Jul 2005 01:04:47 -0700, jwaixs <[EMAIL PROTECTED]> wrote:
> a
http://www.byteofpython.info/download
Wonderful book for newbie!
Regards,
G
Blogs: http://garrythegambler.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any provision in python which allows me to make my own operators?
My problem is that I need to combine two dictonaries with their keys and I don't want to use any of the existing operators like '+','-','*'.
So is there a way I can make '**' or '~' as my operators to add two dicto
Hi,
I am facing a problem with swig while using Pointers:
#include
void Array(int *ptr)
{
int i;
for (i = 0; i < 6; i++)
{
printf("Index: %d - %d\n",i, *(ptr + i));
}
}
%module Array
%{
extern void Array(int *ptr);
#include
%}
extern void Array(in
I am using pywordnet and when ever I import the package
from wordnet import *, I get an error:
"Exception exceptions.AttributeError: "DbfilenameShelf instance has no
attribute 'writeback'" in ignored"
Now the package works fine until I tried to use that in Apache via
CGI. Apache is showing a Ser
>>> : I am just wondering which technologies google is using for gmail and
>>> : Google Groups???
Check this:
http://tools.devshed.com/c/a/Search%20Engine%20Tricks/To-the-next-level-with-Google-Groups-2
Regards,
Garry
http://garrythegambler.blogspot.com/
--
http://mail.python.org/mailman/listi
Can divide the regex on the bases of alphabets they are starting with
or can iterate on the list.
Regards,
Garry
http://garrythegambler.blogspot.com/
On Wed, 02 Mar 2005 12:50:01 +0100, André Søreng <[EMAIL PROTECTED]> wrote:
> Ola Natvig wrote:
> > André Søreng wrote:
> >
> >>
> >>
> >> Yes, b
Is there any module available that converts word like 'one', 'two',
'three' to corresponding digits 1, 2, 3??
Thanks and Regards,
GSS
--
http://mail.python.org/mailman/listinfo/python-list
I have shifted my python script on a 4 node open ssi cluster. Please
guide me what changes do I have to do in my python scripts to fully
utilize the cluster. How do we introduce parralel processing in
python???
--
Thanks and Regards,
GSS
--
http://mail.python.org/mailman/listinfo/python-list
I have written a code to figure out the difference in excecution time
of a func before and after using threading...
[CODE]
#!/usr/bin/env python
import threading
import time
loops = [5000,5000]
def loop(self, nsec):
for i in range(1,nsec):
t=i*5000
s=t/10*
>threads[i].join()
Oh thanks I corrected that but still the time taken after using thread
is more without using them
Please Advice...
Thanks,
Gurpreet Singh
--
http://mail.python.org/mailman/listinfo/python-list
I wrote:
>>> Also the difference of time is not much...
>>> How do we best optimize our task by using threads... please help...
Duncan Booth Wrote:
>The only times when it may result in a decrease
>in the running time... are when the time the task...when
> multiple CPU's are involved.
I fotgot to
>>> So That means blindly using threads on any process won't help!
> It depends on what "help" means to you.
Help means to improve processing speed in achieving a particular
task... *Help* here also means that I have a processor farm, how do I
best use them to get maximum processing speed out of t
Hi guys,
Can anyone suggest some good tool for handling nested
tables in a HTML page... BeautifulSoup is somehow not working with
Nested Tables.
Thanks and Regards,
Garry
--
http://mail.python.org/mailman/listinfo/python-list
I also coded for more than 3 years and eventually I got that I was not
coding but writting poems in perl... Even after 3 months, I go back
and check my hand written code, I had to think twice about the logic
used...
Now its pretty much systematic which incode dcoumentation and
programming structure
26 matches
Mail list logo