En Tue, 02 Jun 2009 03:14:22 -0300, Chris Rebert
escribió:
On Mon, Jun 1, 2009 at 10:25 PM, Alexandr N Zamaraev
wrote:
import datetime as dt
d = dt.date(2009, 10, 15)
dt.date(d)
Traceback (most recent call last):
File "", line 1, in
TypeError: function takes exactly 3 arguments (1 giv
Gabriel Genellina wrote:
> If one can say float(3.0), str("hello"), etc -- what's so wrong with
> date(another_date)?
You can do
x = float(x)
when you don't know whether x is a float, int, or str. Not terribly useful,
but sometimes convenient because making the float() call idempotent allows
Hi,
I usually works with packages like pyserial, numpy, mathplotlib,pyUSB, etc..
When is planned that these packages are supported in Python 3.0?
Seen this i would say that is not recommendable to use Python 3.0 at the
moment? most of 2.6 packages are not available, not working in python 3.0.
On Tue, Jun 2, 2009 at 12:51 AM, ssd wrote:
> Hi,
>
> I usually works with packages like pyserial, numpy, mathplotlib,pyUSB, etc..
>
> When is planned that these packages are supported in Python 3.0?
That would depend on the individual packages and their maintainers.
Check their respective websit
hi have to parse a very complex dumps(whatever it is), i have done the parsing
thruogh python.since the parsed data is very huge in amount, i have to feed it
in the database (SQL), I have also done this... now the thing is i have to
compare the data now present in the sql.
in actual i have to
would like to take advantage of the wave module
found a good example here:
http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=10644
hmm .. i don't get how to write a stereo .. i mean i can set nchannels
.. but how do i actually take control of each ch individually?
and what's the range(in
"Visco Shaun" wrote in message
news:mailman.966.1243852864.8015.python-l...@python.org...
> when I was executing the below code I got "TypeError: 'int' object is
> not callable" exception. Why is it so?
>
> if type(c) == type(ERROR):
You've probably assigned to type somewhere in your code. What
In message , Nick Craig-
Wood wrote:
> As a ctypes user I found this an interesting story - thanks for
> posting it!
By the way, I hate wildcard imports. In the ctypes docs, they recommend you
do this
from ctypes import *
but I prefer this:
import ctypes as ct
which explains the "ct.
how about this :
- dump those data with sort enabled
- use diff to those two dumps , eg: diff dump_a dump_b
if you don't know what diff is , try : man diff
HTH
On Tue, Jun 2, 2009 at 2:50 AM, Kiran Siddiqui
wrote:
> hi have to parse a very complex dumps(whatever it is), i have done the
> par
2009/6/2 Stef Mientki :
...
> and the files generated by Py2Exe, don't work at all.
>
> Through this discussion, I discovered another problem,
> because __file__ isn't the current file,
> I can't run 1 module(file) from another module (file) .
>
> --
> http://mail.python.org/mailman/listinfo/python
Hello experts,
I'm looking for secure way to pass messages from a python program to a
c-library in both ways.
This scenario is given:
display client Calculation module in
COBOL (yes, big, old but it works well)
(python, wxpython) <- Network connec
Chris Rebert wrote:
On Tue, Jun 2, 2009 at 12:51 AM, ssd wrote:
Hi,
I usually works with packages like pyserial, numpy, mathplotlib,pyUSB, etc..
When is planned that these packages are supported in Python 3.0?
That would depend on the individual packages and their maintainers.
Check their r
Gabriel Genellina wrote:
> En Mon, 01 Jun 2009 14:19:19 -0300, Michael H. Goldwasser
> escribió:
>
>> I can examine the inherited slots to see which special methods are
>> there, and to implement my own __deepcopy__ accordingly. But to do
>> so well seems to essentially require reimplementi
In article
,
alex23 wrote:
> "alejandro" wrote:
> > I found some in C but could not find in Python
>
> The best I could find was a reference to some in-house code used by
> the US National Oceanoic & Atmospheric Association:
>
> http://tinyurl.com/mct9zz
>
> You might be able to conta
Gabriel Genellina wrote:
> En Tue, 02 Jun 2009 03:14:22 -0300, Chris Rebert
> escribió:
>
>> On Mon, Jun 1, 2009 at 10:25 PM, Alexandr N Zamaraev
>> wrote:
>
>> import datetime as dt
>> d = dt.date(2009, 10, 15)
>> dt.date(d)
>>> Traceback (most recent call last):
>>> File "", line
I have some strings, and I want to write them into a text files, one
string one line
but there is a requirement: every line has a max length of a certain
number(for example, 10), so I have to replace extra SPACE*3 with
SPACE*2, at the same time, I want to make the string looks good, so,
for "I am12
Lie Ryan wrote:
> Gabriel Genellina wrote:
>> En Tue, 02 Jun 2009 03:14:22 -0300, Chris Rebert
>> escribió:
>>
>>> On Mon, Jun 1, 2009 at 10:25 PM, Alexandr N Zamaraev
>>> wrote:
>>> import datetime as dt
>>> d = dt.date(2009, 10, 15)
>>> dt.date(d)
Traceback (most recent call la
On Jun 2, 12:10 pm, oyster wrote:
> I have some strings, and I want to write them into a text files, one
> string one line
> but there is a requirement: every line has a max length of a certain
> number(for example, 10), so I have to replace extra SPACE*3 with
> SPACE*2, at the same time, I want t
On May 25, 1:35 pm, LittleGrasshopper wrote:
> With so many choices, I was wondering what editor is the one you
> prefer when coding Python, and why. I normally use vi, and just got
> into Python, so I am looking for suitable syntax files for it, and
> extra utilities. I dabbled with emacs at some
Hi Martin,
I was able to compile ctypes with gcc4sparc without many changes to
the CFLAGS, etc. I had another weird error, but upgrading to the
latest gcc4sparc fixed it. One thing I'm not clear about is how
extensions are built. I noticed that my CFLAGS are not being passed
to gcc when buildin
On Tue, 2 Jun 2009 19:10:18 +0800
oyster wrote:
> I have some strings, and I want to write them into a text files, one
> string one line
> but there is a requirement: every line has a max length of a certain
> number(for example, 10), so I have to replace extra SPACE*3 with
> SPACE*2, at the same
here is what I get
[code]
import re
reSplitObj=re.compile('([ \t]*)|([^ \t]*)')
def evenReplace(aStr, length):
aStr=aStr.rstrip()
tmp=reSplitObj.split(aStr)
tmp=[i for i in tmp if i not in ['', None]]
lenStr=[[0, len(i)][i.strip()!=''] for i in tmp]
lenSpc=[[0, len(i)][i.strip()
Michael H. Goldwasser wrote:
On Monday June 1, 2009, Scott David Daniels wrote:
Michael H. Goldwasser wrote:
> I'll accept the "small price for flexibility" that you
> note, if necessary. However, I still desire a cleaner solution.
You seem to think that "deepcopy" is
Hi,
I'm using pyPgSQL for accessing Postgres and do some update and select
queries.
and getting WARNING: there is already a transaction in progress if I
run runUpdate more than once.
So, what happens is following:
1. SELECT address FROM address WHERE LOWER(address) = LOWER(%s); --
__existRecord
2
Hans Müller wrote:
> Hello experts,
>
> I'm looking for secure way to pass messages from a python program to a
> c-library in both ways.
>
> This scenario is given:
>
> display client Calculation module in
> COBOL (yes, big, old but it works well)
> (p
oyster wrote:
I have some strings, and I want to write them into a text files, one
string one line
but there is a requirement: every line has a max length of a certain
number ...
If you are doing this to fill and justify text, I seem to remember
a research result stating that filled text (with
On 2 Jun, 15:32, someone wrote:
> Hi,
> I'm using pyPgSQL for accessing Postgres and do some update and select
> queries.
> and getting WARNING: there is already a transaction in progress if I
> run runUpdate more than once.
I think this is because you're using explicit transaction statements
am
> But since i like to do it The Right Way, I would
> like to let the python-mode worry about this...
>
> Sorry if this is just a bunch of obvious thoughts to most of you.
>
> Regards,
> Giovanni
I dont see whats the problem.
Heres my attempt to show you my emacs windows using python-mode
(python.e
Here's how we normalize whitespace in multiline blocks of text. Perhaps
you can adapt this routine to your needs? Watch for line wrap.
# clean up duplicate whitespace, leading/trailing whitespace, triple
CRLF's
def fixwhitespace( text ):
output = []
lastLine = ''
#
On Jun 2, 3:58 pm, Paul Boddie wrote:
> On 2 Jun, 15:32, someone wrote:
>
> > Hi,
> > I'm using pyPgSQL for accessing Postgres and do some update and select
> > queries.
> > and getting WARNING: there is already a transaction in progress if I
> > run runUpdate more than once.
>
> I think this is
On Jun 2, 5:28 am, Hans Müller wrote:
> Hello experts,
>
> I'm looking for secure way to pass messages from a python program to a
> c-library in both ways.
>
> This scenario is given:
>
> display client Calculation module in
> COBOL (yes, big, old but it
In article <003e1491$0$9723$c3e8...@news.astraweb.com>,
Steven D'Aprano wrote:
>On Sun, 31 May 2009 07:24:09 +0100, Arnaud Delobelle wrote:
>>
>> AFAIK, 'complexity' means 'worst case complexity' unless otherwise
>> stated.
>
>No, it means "average or typical case" unless otherwise specified.
>C
On 2 Jun, 16:49, Tep wrote:
> On Jun 2, 3:58 pm, Paul Boddie wrote:
> > Really, you should use the commit method on the cursor object
>
> You mean connection object, do you?
Yes, I meant the connection object. :-)
> I've tried that, but forgotten to remove BEGIN;COMMIT; statements from
> my que
On 2009-06-01 18:54, Eric Pruitt wrote:
Hello everyone,
I am a student working on GSoC 2009 for PSF. My proposal involves making
changes to the subprocess module and subprocess.Popen. I wish to create
a Google Code project to host my changes so that I can receive feedback
from the community. Som
The same rule applies for your modules. As a general rule, NEVER say:
execfile('mymodule.py')
instead do:
import mymodule
mymodule.some_function()
mymodule.another_function()
(There are exceptions, but if you need to ask what they are, you're not
ready to learn them! *wink*)
hi Stev
Is it generally safe to explicitly import __builtin__ in python? That
is, my code reads like this:
=== foo.py ===
import __builtin__
...
print __builtin__.type('a')
=== EOF ===
It seems like it should be a safe import, but I just want to make
sure.
Thanks,
--Steve
--
http://mail.python.org/mail
On 2009-06-02 14:24, Stef Mientki wrote:
The same rule applies for your modules. As a general rule, NEVER say:
execfile('mymodule.py')
instead do:
import mymodule
mymodule.some_function()
mymodule.another_function()
(There are exceptions, but if you need to ask what they are, you're
not re
mrstevegross wrote:
Is it generally safe to explicitly import __builtin__ in python? That
is, my code reads like this:
=== foo.py ===
import __builtin__
...
print __builtin__.type('a')
=== EOF ===
It seems like it should be a safe import, but I just want to make
sure.
Why do you want to impor
So I was curious whether it's possible to use the ctypes module with
C++ and if so how difficult it is. I figure in principal it's possible
if ctypes knows about each compiler's name mangling scheme. So I
searched for "ctypes c++" on Google.
The third link will be "Using ctypes to Wrap C++ Librari
Joseph Garvin schrieb:
So I was curious whether it's possible to use the ctypes module with
C++ and if so how difficult it is. I figure in principal it's possible
if ctypes knows about each compiler's name mangling scheme. So I
searched for "ctypes c++" on Google.
The third link will be "Using c
En Tue, 02 Jun 2009 07:34:43 -0300, Lie Ryan escribió:
Gabriel Genellina wrote:
En Mon, 01 Jun 2009 14:19:19 -0300, Michael H. Goldwasser
escribió:
I can examine the inherited slots to see which special methods are
there, and to implement my own __deepcopy__ accordingly. But to do
so
Hi,
This is my first post here, hope this is the right group, and sorry
for my broken English.
So, let's start. I have created small PyQt application Simple Task
Timer (http://code.google.com/p/simpletasktimer/). Also I created
windows binary distro with py2exe, and Linux packages (.rpm and .deb).
> Why do you want to import it?
>
> Seehttp://docs.python.org/library/__builtin__.html
I'm using a weird python environment that overloads a few builtin
functions. In order to run them, I need to explicitly invoke
"__builtin__.foo()" to make sure I get the real builtin version, not
the overloaded
On May 28, 6:28 pm, Carl Banks wrote:
> On May 28, 11:06 am, trhaynes wrote:
>
>
>
> > I'm trying to use py2app to package an OpenGL app, so first I tried to
> > build the example here
>
> >http://svn.pythonmac.org/py2app/py2app/trunk/examples/PyOpenGL/
>
> > and I get the error:
>
> > > File
>
What is the best way to copy an object that has multiple inheritance
with the copy module. Particularly, some of the instances in the
hierarchy use the __copy__ method to create a copy (because even for
shallow copies they need some information updated a little
differently), so how can I mak
'2+ wrote in news:mailman.1017.1243932401.8015.python-l...@python.org in
comp.lang.python:
> would like to take advantage of the wave module
> found a good example here:
> http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=10644
>
> hmm .. i don't get how to write a stereo .. i mean i c
Diez B. Roggisch wrote:
> Joseph Garvin schrieb:
> > So I was curious whether it's possible to use the ctypes module with
> > C++ and if so how difficult it is. I figure in principal it's possible
> > if ctypes knows about each compiler's name mangling scheme. So I
> > searched for "ctypes c++" o
Mmmm,
not really a conspiracy but it is not that trivial
In wrapping c++ you might find useful the commands nm with c++filt
although they work under linux there is the same pair for every platform
(under windows I remember there is objdump): they should only you need to wrap
a c++ library.
Robert Kern wrote:
On 2009-06-02 14:24, Stef Mientki wrote:
The same rule applies for your modules. As a general rule, NEVER say:
execfile('mymodule.py')
instead do:
import mymodule
mymodule.some_function()
mymodule.another_function()
(There are exceptions, but if you need to ask what the
> Diez B. Roggisch wrote:
>> Joseph Garvin schrieb:
>> > So I was curious whether it's possible to use the ctypes module with
>> > C++ and if so how difficult it is. I figure in principal it's possible
>> > if ctypes knows about each compiler's name mangling scheme. So I
>> > searched for "ctyp
On 2009-06-02 18:00, Stef Mientki wrote:
Robert Kern wrote:
On 2009-06-02 14:24, Stef Mientki wrote:
The same rule applies for your modules. As a general rule, NEVER say:
execfile('mymodule.py')
instead do:
import mymodule
mymodule.some_function()
mymodule.another_function()
(There are e
Joseph Garvin wrote:
So I was curious whether it's possible to use the ctypes module with
C++ and if so how difficult it is. I figure in principal it's possible
if ctypes knows about each compiler's name mangling scheme. So I
searched for "ctypes c++" on Google.
The third link will be "Using cty
I started using python last week and ran into exceptions thrown when
unicode dictionary keys are exploded into function arguments. In my
case, decoded json dictionaries did not work as function arguments.
There was a thread from Oct 2008
(http://www.gossamer-threads.com/lists/python/python/684379)
In article <78lit5f1mvib...@mid.uni-berlin.de>,
"Diez B. Roggisch" wrote:
> > More seriously -- how difficult is it to use ctypes instead of saying,
> > boost::python, and why isn't this in a FAQ somewhere? ;)
>
> Because it's much more needed than name-mangling. Name mangling is
> (amongst ot
I wrote a small pre-processor for python documentation and I am
looking for advice on how to get the most natural sounding reading. I
uploaded an example of a reading of lxml documentation as a podcast1
http://dexrow.blogspot.com/2009/06/python-voice-preprocessor.html.
--
http://mail.pytho
I have a Python 2.6 program (a code generator, actually) that tries
several methods of compressing a string and chooses the most compact.
It then writes out something like this:
{ encoding='bz2_codec', data = '...'}
I'm having two problems converting this to Py3. First is the absence
of the bz2
mrstevegross writes:
> Is it generally safe to explicitly import __builtin__ in python? That
> is, my code reads like this:
>
> === foo.py ===
> import __builtin__
> ...
> print __builtin__.type('a')
> === EOF ===
>
> It seems like it should be a safe import, but I just want to make
> sure.
Ye
In article ,
Gabriel wrote:
>
>I have something like this:
>
>@render(format="a")
>@render(format="b")
>@
>def view(format, data):
> return data
>
>Each render will do something with 'data' if format match, and nothing
>if not.
>
>But if there is no more renders to eval, the last one is the
On Tue, Jun 2, 2009 at 7:15 PM, samwyse wrote:
> I have a Python 2.6 program (a code generator, actually) that tries
> several methods of compressing a string and chooses the most compact.
> It then writes out something like this:
> { encoding='bz2_codec', data = '...'}
>
> I'm having two problem
In article ,
Michael H. Goldwasser wrote:
>
>Assume that class B inherits from class A, and that class A has
>legitimately customized its deepcopy semantics (but in a way that is
>not known to class B). If we want a deepcopy of B to be defined so
>that relevant state inherited from A is copied a
On Jun 2, 7:35 pm, Chris Rebert wrote:
> On Tue, Jun 2, 2009 at 7:15 PM, samwyse wrote:
> > I have a Python 2.6 program (a code generator, actually) that tries
> > several methods of compressing a string and chooses the most compact.
> > It then writes out something like this:
> > { encoding='bz
In message , Sebastian Wiesner wrote:
>
>
>> That said I've used C++ with ctypes loads of times, but I always wrap
>> the exported stuff in extern "C" { } blocks.
>
> No wonder, you have never actually used C++ with C types. An extern "C"
> clause tells the compiler to generate C functions (mo
In message <4a24f0cc$0$3278$8e6e7...@newsreader.ewetel.de>, Hans Müller
wrote:
> display clientCalculation
> module in COBOL (yes, big, old but it
> works well)
> (python, wxpython)<- Network connection ->C-Lib beeing called from
> COBO
On 3 Jun., 05:51, Lawrence D'Oliveiro wrote:
> In message , Sebastian Wiesner wrote:
>
> >
>
> >> That said I've used C++ with ctypes loads of times, but I always wrap
> >> the exported stuff in extern "C" { } blocks.
>
> > No wonder, you have never actually used C++ with C types. An extern "C"
Dear all,
I am a python newbie. I am now progressing to writing a
network app in python to learn more about it. I have a client and a
server in python. The client sends a msg to the server asking it to
tar a binary .dbxml file and then send it over to it. The steps are:
from the
1. Clien
samwyse wrote:
> I have a Python 2.6 program (a code generator, actually) that tries
> several methods of compressing a string and chooses the most compact.
> It then writes out something like this:
> { encoding='bz2_codec', data = '...'}
>
> I'm having two problems converting this to Py3. Firs
En Wed, 03 Jun 2009 01:54:02 -0300,
escribió:
I am a python newbie. I am now progressing to writing a
network app in python to learn more about it. [...]
Surprisingly, the sha1 hash of the encrypted data before it is sent
from server is different from the encrypted file data recei
En Tue, 02 Jun 2009 06:11:30 -0300, Vlastimil Brom
escribió:
[...] just in case the main problem would be the
use of __file__ ...
It seems, that the exe files generated from py2exe don't recognise
this variable;
sometimes I used code like
try:
__file__
except NameError: # py2exe
__file
En Tue, 02 Jun 2009 08:07:32 -0300, Lie Ryan escribió:
Gabriel Genellina wrote:
En Tue, 02 Jun 2009 03:14:22 -0300, Chris Rebert
escribió:
On Mon, Jun 1, 2009 at 10:25 PM, Alexandr N Zamaraev
wrote:
import datetime as dt
d = dt.date(2009, 10, 15)
dt.date(d)
Traceback (most recent call la
On Jun 2, 10:29 pm, "Gabriel Genellina"
wrote:
> En Wed, 03 Jun 2009 01:54:02 -0300,
> escribió:
>
> > I am a python newbie. I am now progressing to writing a
> > network app in python to learn more about it. [...]
> > Surprisingly, the sha1 hash of the encrypted data before it is se
On May 21, 10:13 pm, George Sakkis wrote:
> On May 21, 5:55 pm, shailesh wrote:
>
> > There doesn't seem to be a predicate returning method wrappers. Is
> > there an alternate way to query an object for attributes that are of
> > method wrappers?
>
> Sure:>>> MethodWrapper = type({}.__init__)
> >
I've implemented a working reimport that, "does what you want". After
a bit of testing with friends, I'm releasing version 1.0 tonight.
http://code.google.com/p/reimport/
There's still work to do, but this already does a bit of fancy
transmuting to push the reimport changes into the runtime. This
En Tue, 02 Jun 2009 19:02:47 -0300, Brian Allen Vanderburg II
escribió:
What is the best way to copy an object that has multiple inheritance
with the copy module. Particularly, some of the instances in the
hierarchy
("...some of the classes in...", I presume?)
use the __copy__ method t
73 matches
Mail list logo