flupke schreef:
Thanks for all the info.
I'm sure i will get it right this time :)
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
i made a backup script to backup my postgres database.
Problem is that it prompts for a password. It thought i
could solve this by using popen2.
I tested popen2 with dir (i'm on windows 2000, python 2.4.3)
and it works.
However when i try popen2 and my pg_dump command, it prompts
for a passwor
Duncan Booth schreef:
> flupke <[EMAIL PROTECTED]> wrote:
>
>> Using 86400 instead of (24*60*60) is faster
>
> s/is/was/
>
> upgrade to Python 2.5
Indeed, i'm still on 2.4.
I thought 2.5 might give a different result :)
Thanks for the info
Benedict
--
http
[EMAIL PROTECTED] schreef:
> Hi,
>
> String formatting can be used to converting an integer to its octal or
> hexadecimal form:
a = 199
"%o" % a
> '307'
"%x" % a
> 'c7'
>
> But, can string formatting be used to convert an integer to its binary
> form ?
>
>
> Thanks in advance.
>
Fredrik Lundh schreef:
>
def get_seconds(td):
> ... return td.days * (24*60*60) + td.seconds
> ...
import dis
dis.dis(get_seconds)
> 2 0 LOAD_FAST0 (td)
> 3 LOAD_ATTR0 (days)
> 6 LOAD_CONST 4
Frank Millman schreef:
> Not that I know of. The results of my investigations so far seem to
> indicate that we have a problem :-(
>
> Here is a link to an article dated 1998 -
> https://svn.python.org/www/trunk/pydotorg/windows/OdbcHints.html
>
> Among other interesting stuff, it states -
flupke schreef:
When i do the same sql from a client, i get this: 1961-02-15
Seems ok.
If i check the catalog, the native field type is listed as 10 positions
and of type date.
Yet when i print it after i got the values i get this which looks very
weird (print "value ",str(i),"
Frank Millman schreef:
> Well waddyaknow - I get exactly the same, for dates earlier than
> 1970-01-02. Thanks for finding a bug that would have bitten me sooner
> or later.
>
> I will do some investigation. If I find an answer I will post it here,
> unless some kind soul saves me the trouble an
Frank Millman schreef:
> flupke wrote:
>> I'm using a solid DB and i'm accessing it via the odbc module
>> (activepython).
>> I get a DbiDate object returned but i don't find a way to decently print
>> it or get a format like %d/%m%/%y.
>>
>
I'm using a solid DB and i'm accessing it via the odbc module
(activepython).
I get a DbiDate object returned but i don't find a way to decently print
it or get a format like %d/%m%/%y.
I found a few posts but the code doesn't work.
>>> birthd = results[0][4] #info from db
>>> birthd
>>> str(birt
[EMAIL PROTECTED] schreef:
> Hey people!
> For the first time I'm doing a client/server application, and I'm
> really confused with IPC stuff.
>
> I read the fastest method is shared memory, but I tryed mmap and found
> it tedious for the amount of data I'm handling (which is 30K at most,
> but mm
flupke schreef:
> Hi Vinay,
>
> thanks for the info.
>
> I tried to change the handlers.py file.
> First, i changed some code in doRollover.
>
> if os.path.exists(dfn):
> os.remove(dfn)
> try:
> #os.rename(self.baseFilename, dfn)
>
> -> The
Vinay Sajip schreef:
> flupke wrote:
>
>> If this bug is fixed, where will i find a fixed version and how do i
>> install it?
>> Also, more important to me, what am i doing wrong to get this error
>> message in the first place?
>
> You're not doing any
Vinay Sajip wrote:
> flupke wrote:
>
>
>> File "C:\Python24\lib\logging\handlers.py", line 134, in doRollover
>>self.handleError(record)
>>NameError: global name 'record' is not defined
>
>
> There's a bug in doRollover'
Hi,
i'm getting errors with the log module concerning RotatingFileHandler.
I'm using Python 2.4.3 on Windows XP SP2. This used to work in previous
python versions but since i upgraded to 2.4.3 i get these errors:
Traceback (most recent call last):
File "C:\Python24\lib\logging\handlers.py", li
Fredrik Lundh wrote:
> "flupke" wrote:
>
>
>>Is there an easy to convert following hour notation hh:mm
>>to decimals?
>>For instance 2 hours and 30 minutes as 2:30 to 2,50
>>I don't really know where to search for this kind of conversion.
>
flupke wrote:
> Is there an easy to convert following hour notation hh:mm
> to decimals?
> For instance 2 hours and 30 minutes as 2:30 to 2,50
> I don't really know where to search for this kind of conversion.
>
> Thanks,
> Benedict
I found a way. Not sure if it's
Is there an easy to convert following hour notation hh:mm
to decimals?
For instance 2 hours and 30 minutes as 2:30 to 2,50
I don't really know where to search for this kind of conversion.
Thanks,
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
flupke wrote:
> I forgot to add that if i check the shared.lib py2exe creates, the
> program1 dir and subdirs/files are there so they are included in the
> package.
>
> Benedict
Hi,
i solved it by adding the same import statement to the py2exe setup.py
script as in my co
flupke wrote:
> Hi,
>
> i have a program with is built like this:
> startup.py
> dir1/__init__.py
> dir1/file1.py
> dir2/__init__.py
> dir2/file2.py
> dir3/__init__.py
> dir3/file3.py
>
> The program works but now i want to add the functionality into an
>
Hi,
i have a program with is built like this:
startup.py
dir1/__init__.py
dir1/file1.py
dir2/__init__.py
dir2/file2.py
dir3/__init__.py
dir3/file3.py
The program works but now i want to add the functionality into an
existing program 2. This is program 2:
program2.py
program2dir1/__init__.py
pro
Thomas Heller wrote:
> This has been discussed on the py2exe-users lists, and a fix was found
> by David Hess. Fortunately he added it to the wiki:
>
> http://starship.python.net/crew/theller/moin.cgi/LoggingModule
>
> Thomas
Cool, thanks Thomas, i'll give that a whirl
Benedict
--
http://ma
Hi,
when i run my program and use the logging component, i see this:
2005-09-02 17:07:48,193 INFO windowmain 97 Main window created
2005-09-02 17:07:49,020 DEBUG windowmain 103 Frame
2005-09-02 17:07:49,145 INFO firebird 195 Starting up the database
However when i run py2exe on my app and run i
flupke wrote:
> Hi,
>
> i have a property in a class that gets changed
> and i would want to know who changes it.
> Is there a way i can find out the calling function of a property?
>
> Thanks,
> Benedict
I solved it by using
import traceback, sys
traceb
Hi,
i have a property in a class that gets changed
and i would want to know who changes it.
Is there a way i can find out the calling function of a property?
Thanks,
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> Make printclass a class method:
>
> class A(object):
> def __init__(self):
> print "I'm A"
>
> # for python 2.4
> @classmethod
> def printclass(cls):
> print "Module", cls.__module__
> print "Class", cls.__name__
> # for 2.3 or
I have the following test code setup, trying to get the class name of a
subclass in the super class. (Reason why i want this is described below)
file class_name_start.py
import class_name as cn
obj = cn.B()
obj.printclass()
file class_name.py
=
Robert Kern wrote:
> chris wrote:
>
>> When I think about what I should do I end up with a class XY that has a
>> method for everything I want to do eg.
>>
>> class XY:
>> def read_file
>> def scale_data
>> def plot_data
>> def shelve_data
>>
>> But somehow that doesn't feel right, especia
Dave Cook wrote:
> On 2005-07-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>>On the other hand I even in its current form I don't see how I would to
>>the simple things that I need every day. Create a session, set a
>>cookie, redirect to another url, perform HTTP autentication, create
>>
I need to program and setup serveral webservices.
If i were still using jsp, i would use Tomcat to make the several
applications available on a given port.
How can i accomplish this in Python?
I was thinking about Twisted but it's not clear to me what parts i need
to make a webserver listen on a c
Damjan wrote:
>>I developed a package with a structure like this
>>src/
>>tesfile.py
>>dir1/
>>__init__.py
>>file1.py
>>dir2/
>>__init__.py
>>file2.py
>
>
> Importing dir2/file2 from dir1/file1.py works here, because when yuo started
> the testfile scri
Hi,
I developed a package with a structure like this
src/
tesfile.py
dir1/
__init__.py
file1.py
dir2/
__init__.py
file2.py
The testfile is meant to try the code out that is specified in file1.py
and file2.py
Now i have another project where i want to
t;
> n bits for rank, then m bits for suit.
>
> 10 0001 = 2 clubs
> 01 1000 = K spades
> ...
>
> [flupke]
>
>>>As for straights, if i understand correctly, you make all possible
>>>straights of the cards in the hand and then see i
Erik Max Francis wrote:
> flupke wrote:
>
>> Which projects are you talking about? I only found a library in c to
>> evaluat ranks but i didn't find the code to be very understandable.
>
>
> pokersource is the main was I was thinking about, yes.
>
>>
Erik Max Francis wrote:
> flupke wrote:
>
First of all, my apologies for the double posts. I can only see this
reply and can't see my original messages. I posted the message from home
and work and they didn't show up. We use the same isp at home and at
work so it's
Hi,
i've included the code so people can take a look.
I've tried to expand on the thread of 26/05/2005 on "Checking for a full
house". Code is suboptimal as I coded it rather quickly.
I've added the "normal" classes one would expect from a cardgame: card,
deck, hand etc.
1. I can detect most thin
Hi,
i've included the code so interested people can take a look.
I've tried to expand on the thread of 26/05/2005 on "Checking for a full
house". Code is suboptimal as I coded it rather quickly.
I've added the "normal" classes one would expect from a cardgame: card,
deck, hand etc.
1. I can detec
Hi,
i've included the code so interested people can take a look.
I've tried to expand on the thread of 26/05/2005 on "Checking for a full
house". Code is suboptimal as I coded it rather quickly.
I've added the "normal" classes one would expect from a cardgame: card,
deck, hand etc.
1. I can det
flupke wrote:
Thanks for the good ideas people.
Regards,
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
Jarek Zgoda wrote:
> flupke napisaĆ(a):
>
>> I'm thinking of a function that will generate such a code and put it
>> in a file. Then when the program starts it checks this file and checks
>> the code in there with a code that it generates at that time again
>>
I'm going to be distributing a program based on wxPython & python in a
few weeks time. The code will run on windows machines.
Because i don't want the users to move the folders around or mess with
the program or taking copies home to fiddle with it, i was thinking of a
way to check when the pro
Michael Onfrek wrote:
> Hi!
> I'm playing with entry again and trying to restrict length of entry
> widget to certain number of character, so users cannot enter more
> character into it. Any ideas?
> Reg. Michael Onfrek
>
What widget set are you talking about, wxPython pygtk, tkinter?
In wxPytho
Kent Johnson wrote:
> flupke wrote:
>
>>
>> Hi,
>>
>> i tried to use timeit on a function in a class but it doesn't do what
>> i think it should do ie. time :)
>> In stead it starts printing line after line of hello time test!
>> What am i doi
Fredrik Lundh wrote:
> "flupke" wrote:
>
>
>>i tried to use timeit on a function in a class but it doesn't do what i
>>think it should do ie. time :)
>>In stead it starts printing line after line of hello time test!
>>What am i doing wrong in
Hi,
i tried to use timeit on a function in a class but it doesn't do what i
think it should do ie. time :)
In stead it starts printing line after line of hello time test!
What am i doing wrong in order to time the f function?
class TimeTest(object):
def f(self):
print "hello time
Raymond Hettinger wrote:
> [Benedict]
>
>>>It would be interesting to see how complicated it would get to write
>>>code to detect the correct hands in poker with wildcards included.
>
>
> There is an interesting SF project with code written in C:
> http://pokersource.sourceforge.net/
>
> In
Paul Rubin wrote:
> "Raymond Hettinger" <[EMAIL PROTECTED]> writes:
>
>>Your use case for gathering roll statistics probably needs a more
>>general solution:
>>
>>hands = {
>>(1,1,1,1,1): 'nothing',
>>(1,1,1,2): 'one pair',
>>(1,2,2): 'two pair',
>>(1,1,3): 'three of a kind',
>>
DE wrote:
> Hello,
>
> I have an app with embedded Python. Python scripts create their own
> threads and I need to terminate these threads at the point where the
> user wants to leave the application. I use threading.Thread as base
> classes.
>
> I have tried to use call the join method of the py
flupke wrote:
I solved it by getting the latest py files from CVS and overwriting the
existing ones. It gave an Attribute error but that was gone after
commenting this line:
#isc_info_isc_version = _k.isc_info_isc_version
I'm not sure if this is a safe way of working. It
flupke wrote:
> Hi,
>
> i'm developing an app that uses wxPython and Firebird via kinterbasdb on
> Win XP SP2. On insert of a record i get this error:
> (kinterbasdb.InterfaceError)
> (0, "Type mismatch: Input parameter for field named [name n
> ot known at this st
Hi,
i'm developing an app that uses wxPython and Firebird via kinterbasdb on
Win XP SP2. On insert of a record i get this error:
(kinterbasdb.InterfaceError)
(0, "Type mismatch: Input parameter for field named [name n
ot known at this stage of query execution] must be a string, rather than
a .")
flupke wrote:
I finally succeeded in making a proper mci.dll that works. I will
document what i did in the coming days and place it here. I developed
the dll with DevC++.
Anyway, it all works :)
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
i am in search of a cddb module for Python on windows. I stumbled upon
http://sourceforge.net/projects/cddb-py but couldn't use it since the
mci.dll is compiled against Python2.0.
So i'm trying to rebuild it using Dev-C++. I've succeeded in building a
dll but when i try a test program it ge
flupke wrote:
>
> I'm using wxPython and design the gui via wxglade. One of the gui
> components is a simple dialog class that gets displayed when a user
> exits the program.
> I want to use the same dialog but with a different text for closing
> certain dialogs in th
Fredrik Lundh wrote:
> "flupke" wrote:
>
>
>>>Then i got a tip that you can register a function that needs to be
>>>called when the object is going to be deleted.
>>>For instance to register a function __exit, you do this:
>
>
I'm using wxPython and design the gui via wxglade. One of the gui
components is a simple dialog class that gets displayed when a user
exits the program.
I want to use the same dialog but with a different text for closing
certain dialogs in the program. (it's a pure "do you want to exit
" dialo
phil wrote:
>
>> Then i got a tip that you can register a function that needs to be
>> called when the object is going to be deleted.
>> For instance to register a function __exit, you do this:
>>
>
>
> Here is the complete line class with your suggestion:
>
> Below is the output.
>
> Nice id
phil wrote:
> A class instance based language doesn't have to BE C++ to have a
> destructor method.
>
> All I wanted to know is: is the apparent treatment of __del__
> which SEEMS to work fine for me in 2.3.4 deprecated or mangled
> in some later release or future plans.
> If someone doesn't kno
Vinay Sajip wrote:
> flupke nonexistingdomain.com> writes:
>
>
>>Hi,
>>
>>i have a class and a class attribute log which is a logger object. In
>>the __del__() function i want to log a message but it fails even if i
>>use self.__class__.log.
>&
Hi,
i have a class and a class attribute log which is a logger object. In
the __del__() function i want to log a message but it fails even if i
use self.__class__.log.
The error i get is this:
Traceback (most recent call last):
File "C:\Python24\lib\logging\__init__.py", line 712, in emit
[EMAIL PROTECTED] wrote:
look at this discussion:
http://www.dbforums.com/archive/index.php/t-1100372.html
it looks like we have to use other way, hold the data we want to
preseve in an object, because it is possible the class is removed
before the instance cleaned, and we can not expect __del__ 10
Hi,
i'm starting work and a simple database layer and wanted to use the
__del__ to open and close a connection. However, i get an erro when
executing this script:
class Table:
refcount = 0
def __init__(self, name):
self.name = name
print "table %s " % repr(self)
T
Richard Lyons wrote:
Has anyone been successful in using Glade for Windows with Python?
Yeah, i'm using it right now.
See the previous email for the links
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
Dave Cook wrote:
On 2005-04-09, flupke <[EMAIL PROTECTED]> wrote:
i create my GUIs mainly via wxGlade. However when you start of to
program and want to do some rearranging to the gui, wxglade overwrites
your file and you've got to put your own code back in.
How about generatin
Jeremy Bowers wrote:
Domain-specific abstractions do that *faster* than GUI designers, not
slower. And better, too, since every iteration tends to be fully
functional and not just a "let's see what this looks like" prototype.
Heck, switch 'em out dynamically based on what day of the week it is and
Reinhold Birkenfeld wrote:
Have to disagree strongly.
It's evil anyway (for more complex applications) to put GUI construction
in your code. GUI should be described appropriately in data files.
Glade does this very good, and with pygtk it's no problem to use the XML files.
Reinhold
So the GUI shoul
Hi,
i create my GUIs mainly via wxGlade. However when you start of to
program and want to do some rearranging to the gui, wxglade overwrites
your file and you've got to put your own code back in.
I think i can work around that (at least a bit) by making a second file
that imports the gui genera
Hi,
i need to develop a gui which will load several "windows" depending on
what the users selects in the menu and i thought i could accomplish this
with panels.
What i'm trying to do to test this is load an initial panel and then
when the user hits a button load a second panel. This doesn't seem
Lucas Raab wrote:
flupke wrote:
Hi,
i capture a movie from mividv to an avi containing the dv video. I
found a program that reads the timestamp from the avi so you know the
exact date and time the video was shot. However, the source of that
program is not available and it doesn't allow to
Hi,
i capture a movie from mividv to an avi containing the dv video. I found
a program that reads the timestamp from the avi so you know the exact
date and time the video was shot. However, the source of that program is
not available and it doesn't allow to batch process a directory of video
fi
Hi,
for an old intranet that is still used here, i would like to add a
search function.
I think there migth already be an indexer/search script available in
python. I've googled and come across a few scripts but i'm not sure
which one is really easy and good at the task.
Any good scripts (and e
flupke wrote:
Hi,
a lot of applications here a made with access. Tables, forms, reports
and the like. Now i rather use Python to do this but i'm not sure how to
proceed. I can use wxPython for a gui via wxGlade for rapid testing and
design (forms), MySQL as db (tables) but the report pa
Hi,
a lot of applications here a made with access. Tables, forms, reports
and the like. Now i rather use Python to do this but i'm not sure how to
proceed. I can use wxPython for a gui via wxGlade for rapid testing and
design (forms), MySQL as db (tables) but the report part is what's
bothering
Hi,
i need to develop an app here which will be used to produce stats.
I'm going to go with twisted pb for the client server communication.
And wxPython for the GUI.
Now i would want to split the GUI code from the pb code to make
debugging easier amongst other things but i'm not sure how i would b
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 06 Jan 2005 15:13:42 GMT
NNTP-Posting-Host: 212.123.8.34
X-Complaints-To: [EMAIL PROTECTED]
X-Trace: phobos.telenet-ops.be 1105024422 212.123.8.34 (Thu, 06
Peter Hansen wrote:
On my machine, I have a folder called c:\bin where I put useful
batch files. I have a python23.bat and a python24.bat file,
which basically just call c:\python23\python.exe or
c:\python24\python.exe as required. For various reasons which
may or may not apply to you as well, I
I searched with Google and on this newsgroups and i didn't find any info
regarding this. If there is more info, please redirect me to that info.
I have version 2.3.4 and 2.4 installed on windows and i thought that by
switching the PYTHONPATH parameter to the dir of the 2.4 version that
that wou
Vinay Sajip wrote:
It works for me:
#file3.py
import file1
import file2
a = file1.A()
b = file2.B()
b.otherfunction()
gives
2004-12-28 00:18:34,805 DEBUG file2 6 creating class B
2004-12-28 00:18:34,805 DEBUG file2 9 in otherfunction
yeah, the classes where a simplification of the classes i'm using
> Steve Holden wrote:
This might be of interest (and also possibly of relevance to an earlier
query about accessing MS SQL Server from Unix in the "Python, unix and
mssql" thread):
http://sourceforge.net/projects/pyodb
"""PyODB is an ODBC Python module to provide an quick an easy way to
work
Hi,
at work we use a solid database and i need to develop an application
that accesses it. Problem is the drivers: i only have some dll's lying
around and jar.
On winsdows i could get by by using ODBC and the dll's to access the
solid database but i want to eventually run it on a linux server.
S
Hi,
i'm trying to log to the same file (using logging module) from different
classes but i can't seem to get it to work.
File 1 is the main file which sets up the logger and then i want to also
use the same logger in another class
This is what i have
file1
=
import log
flupke wrote:
Thanks for the info.
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
previously i made an application that used sockets to
do some network based processing.
My next app is again going to be a client/server app
and i wanted to see if i can't find an easier way to
make the networking going.
I bumped into xmlrpclib and also twisted (pb).
I'm not sure which on of th
83 matches
Mail list logo