I have a question about finding out whether a string contains binary
data?
In my application, I am reading from a file which could contain
binary data. After I have read the data, I transfer it using xmlrpclib.
However, xmlrpclib has trouble unpacking XML which contains binary data
and my applica
Amita Ekbote wrote:
> Hello,
>
> I am retrieving values from a database in the form of a dictionary so
> I can access the values as d['column'] and I was wondering if there is
> a way to convert the hash to a struct like format so i can just say
> d.column. Makes it easier to read and understand.
I wanted to make a more generic way of doing this so that even if the
columns are modified or new ones are added it should be simple. Anyway
I will reconsider this sort of am implementation. Just out of
curiosity is there any other way of achieving this?
Thanks
Amita
On Fri, Jun 19, 2009 at 1:52
On Jun 19, 12:42 pm, Chris Rebert wrote:
> On Fri, Jun 19, 2009 at 12:02 PM, Gustavo Narea wrote:
> > Hello, everyone.
>
> > I've noticed that if I have a class with so-called "rich comparison"
> > methods
> > (__eq__, __ne__, etc.), when its instances are included in a set,
> > set.__contains__/_
On 2009-06-19, Mitko Haralanov wrote:
> I have a question about finding out whether a string contains
> binary data?
All strings contain binary data. Unless you've invented
ternary logic and built a computer with it. ;)
> If I read in a string containing some binary data from the file, the
> t
Thanks guys, for all the replies.
They were some very interesting reading / watching.
Seems to me, the Unladen-Swallow might in time produce code which will
have this problem lessened a bit. Their roadmap suggests at least
modifying the GIL principles if not fully removing it. On top of this,
they
Mitko Haralanov wrote:
I have a question about finding out whether a string contains binary
data?
In my application, I am reading from a file which could contain
binary data. After I have read the data, I transfer it using xmlrpclib.
However, xmlrpclib has trouble unpacking XML which contains b
On 19 juin, 21:05, Christian Heimes wrote:
> I've seen a single Python process using the full capacity of up to 8
> CPUs. The application is making heavy use of lxml for large XSL
> transformations, a database adapter and my own image processing library
> based upon FreeImage.
interesting...
> O
Sorry, just a few more thoughts:
Does anybody know why GIL can't be made more atomic? I mean, use
different locks for different parts of code?
This way there would be way less blocking and the plugin interface
could remain the same (the interpreter would know what lock it used
for the plugin, so t
Amita Ekbote wrote:
I wanted to make a more generic way of doing this so that even if the
columns are modified or new ones are added it should be simple. Anyway
I will reconsider this sort of am implementation. Just out of
curiosity is there any other way of achieving this?
Thanks
Amita
On Fri,
On 19 juin, 21:41, Carl Banks wrote:
> He's saying that if your code involves extensions written in C that
> release the GIL, the C thread can run on a different core than the
> Python-thread at the same time. The GIL is only required for Python
> code, and C code that uses the Python API. C cod
On Fri, Jun 19, 2009 at 12:50 PM, OdarR wrote:
> On 19 juin, 16:16, Martin von Loewis > If you know that your (C) code is thread safe on its own, you can
>> release the GIL around long-running algorithms, thus using as many
>> CPUs as you have available, in a single process.
>
> what do you mean ?
Here's my general-purpose solution for doing this:
class Dict2Class(object):
"""
Update like a dictionary, but expose the keys as class properties.
Sweet!
You can instantiate and update this practically any way you
choose, and
the values are available as class properties.
>>> c
I've created a small application that when you click one of the
buttons it randomly picks a paragraphs from a list that it generates
from a text file and then copies them to the clipboard. It also has
make new/edit/delete/print/ etc functionality.
It's for work so I get some brownie points and eve
On Jun 19, 11:45 pm, OdarR wrote:
> On 19 juin, 21:05, Christian Heimes wrote:
>
> > I've seen a single Python process using the full capacity of up to 8
> > CPUs. The application is making heavy use of lxml for large XSL
> > transformations, a database adapter and my own image processing library
In article <15b1e25c-2bb4-425e-974f-be3d686b5...@p21g2000prn.googlegroups.com>,
VP wrote:
>
>I need to create a web based inventory tool with specific requirements
>such as:
>
>* More then one group is going to use it.
>* Authentication and authorization system based on user and group
>privileges
In article ,
Steven D'Aprano wrote:
>
>Additionally, while I'm a fan of the simplicity of CPython's ref counter,
>one serious side effect of it is that it requires the GIL, which
>essentially means CPython is crippled on multi-core CPUs compared to non-
>ref counting implementations.
Your bare
Hi,
One of my clients is looking for three top web developers (engineers) to build
a new video platform from scratch. Wouldn't it be nice to build this system
without having to work with legacy code or systems? They are part of a major
organization and have deep funding. We're looking for so
Dear all,
I am using os.open to open a tun/tap device and then read data from it.
I also need to do some other tasks apart from reading from this device. So i
wish to have the read non blocking.
I am opening the device in non-block mode using os.O_NONBLOCK .
But, if i do this, i get an error when
Why does IDLE use two hash marks for comments (##)? Most other editors
(Geany, SPE) use a single hash mark (#) to designate comments.
How does one change IDLE to use just a single (#) hash mark for
comments?
Thanks,
Jason Gervich
Santa Cruz, CA
--
http://mail.python.org/mailman/listinfo/python-
On Jun 19, 11:59 pm, Jesse Noller wrote:
> On Fri, Jun 19, 2009 at 12:50 PM, OdarR wrote:
> > On 19 juin, 16:16, Martin von Loewis >> If you know that your (C) code is thread safe on its own, you can
> >> release the GIL around long-running algorithms, thus using as many
> >> CPUs as you have ava
What is the difference between
z=int(raw_input()) and z=eval(raw_input())(I thought them to be
the same in case of integers)
I mean when an integer is entered in that case are they same and when
an integer in not entered,in that case how are they different?
--
http://mail.python.org/mai
"Hans Müller" wrote in message
news:4a37b18d$0$3283$8e6e7...@newsreader.ewetel.de...
> Small addition:
>
> While tracing the network data I found the server to be the problem,
> the answer to a request is beeing delayed by about 180ms - no idea why.
Nagle's algorithm: you've unintentionally pro
Is there any modern support for WSDL? The only projects I could find
are ZSI and SOAPpy, and both have been dead for several years.
--
http://mail.python.org/mailman/listinfo/python-list
I got a problem about UDP.
How do I get the UDP buffer size?
When the server had some delay in handling incoming UDP, it will lost
some package. I wonder it's because the system buffer size, is there any
ways to find the exactly size of the buffer?
ex:
client.py
import socket
On Jun 17, 12:52 pm, Mark Dickinson wrote:
> g_n(t) = nt if 0 <= t <= 1/n else 1
Whoops. Wrong definition. That should be:
g_n(t) = nt if 0 <= t <= 1/n else
n(2/n-t) if 1/n <= t <= 2/n else 0
Then my claim that g_n(t) -> 0 for all t might
actually make sense...
--
http://mail.python
On Jun 17, 1:26 pm, Jaime Fernandez del Rio
wrote:
> P.S. The snowflake curve, on the other hand, is uniformly continuous, right?
The definition of uniform continuity is that, for any epsilon > 0,
there is a delta > 0 such that, for any x and y, if x-y < delta, f(x)-f
(y) < epsilon. Given that K
Mark Dickinson writes:
> It looks as though you're treating (a portion of?) the Koch curve as
> the graph of a function f from R -> R and claiming that f is
> uniformly continuous. But the Koch curve isn't such a graph (it
> fails the 'vertical line test',
I think you treat it as a function f: R
On Jun 17, 10:32 am, Aaron Brady wrote:
> On Jun 17, 10:23 am, Mensanator wrote:
snip
> > > I think high and low /voltages/, though continuous and approximate,
> > > might satisfy this.
>
> > > There are no such things as electrons,
>
> > I've got a Tesla coil if you'd like to meet some electrons
Sparky wrote:
>
> Thank you for your quick response, I will take a look at the link you
> provided.
Depending on what you're trying to do, you may be able to use
`synclient` with subprocess.
--
http://mail.python.org/mailman/listinfo/python-list
Thank you for the clarification Stefan, I understand.
--
http://mail.python.org/mailman/listinfo/python-list
On 6/17/2009 8:38 AM Jean-Michel Pichavant apparently wrote:
> I'm pretty sure you'll be able to find OOP scripting
> language.
http://www.amazon.com/Scripting-Objects-Comparative-Presentation-Object-Oriented/dp/047039725X/ref=sr_1_1?ie=UTF8&s=books&qid=1245276357&sr=1-1>
fwiw,
Alan Isaac
--
h
Nathan Stoddard:
> The best way to become a good programmer is to program. Write a lot of
> code; work on some large projects. This will improve your skill more than
> anything else. It's also important to learn new languages regularly. I
> recommend to learn C, Python, and Lisp first.
To become v
in 117815 20090617 221804 Phil Runciman wrote:
>Because it reminds me of when things went badly wrong. IBM360, Von Neumann =
>architecture, no hardware stacks ...
>
>IMHO Burroughs and ICL had better approaches to OS design back then but had=
>less resources to develop their ideas.=20
>
>However,
On Jun 15, 1:00 am, rustom wrote:
>
> For every one Horowitz there are a thousand wannbes thumping on the
> piano trying to become Horowitz.
> The traction that practice gives is maximal only in the beginning.
Funny but I was watching an interview/conversation between and older
composer and a you
Thank you, Peter. That solved my problem.
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 18, 3:23 pm, CiTro wrote:
> Thank you, Peter. That solved my problem.
the another way is,
codecs.raw_unicode_escape_decode(stringOne) == stringTwo
--
http://mail.python.org/mailman/listinfo/python-list
Here we have to select between wxPython and PyQt for a medium size project.
In this project several hundred dialogs are to be created. This work will be
done by a
program generator which has to re-written.
The question now is which framework should we use.
As far as I could found is PyQt with th
Hans Müller wrote:
> Here we have to select between wxPython and PyQt for a medium size
> project. In this project several hundred dialogs are to be created. This
> work will be done by a program generator which has to re-written.
>
> The question now is which framework should we use.
> As far as
On Jun 18, 3:49 pm, "Diez B. Roggisch" wrote:
> Hans Müller wrote:
> > Here we have to select between wxPython and PyQt for a medium size
> > project. In this project several hundred dialogs are to be created. This
> > work will be done by a program generator which has to re-written.
>
> > The que
Diez B. Roggisch schrieb:
Here we have to select between wxPython and PyQt for a medium size
project. In this project several hundred dialogs are to be created. This
work will be done by a program generator which has to re-written.
The question now is which framework should we use.
As far as I
On Wed, 17 Jun 2009 05:46:22 -0700 (PDT), Mark Dickinson
wrote:
>On Jun 17, 1:26 pm, Jaime Fernandez del Rio
>wrote:
>> On Wed, Jun 17, 2009 at 1:52 PM, Mark Dickinson wrote:
>> > Maybe James is thinking of the standard theorem
>> > that says that if a sequence of continuous functions
>> > on an
> Does the generator expression have its own little namespace or so ?
Yes, generators create a new scope:
http://docs.python.org/reference/expressions.html#grammar-token-generator_expression
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm looking for a fascility that can check if the file is open on Windows XP
and if the file is open (say a notepad file is open), I want to close that file
(i.e the notepad application)
I found that there are no such methods available in OS modules. Is using Win32
API is the only solutio
My problem is some complex, because some condition is not supplied as a
given value
please have a look at
http://www.lusiya.com/bbs/attachment/thumb/Mon_0906/80_3201_d2fa7bd75d28675.jpg
because I have to do futher calculation based on previous steps as
http://www.lusiya.com/bbs/attachment/thumb/Mon
Thanks for all your informative replies.
If I understand you right, for a commercial, closed source program I
only need a commercial PyQt license for ~ 500€ ?
As far as I know I also need a Qt Licenses which is ~3500€ per OS.
What is right ?
Thanks a lot,
Hans
--
http://mail.python.org/mail
On Jun 19, 7:45 am, a...@pythoncraft.com (Aahz) wrote:
> In article
> ,
> Aaron Brady wrote:
>
>
>
> >You are not being any help, Rhodri, in your question.
>
> Maybe not, but honestly, you're getting pretty close to going back in my
> killfile. Although you're no longer trolling this group, I
Hans Müller schrieb:
Thanks for all your informative replies.
If I understand you right, for a commercial, closed source program I
only need a commercial PyQt license for ~ 500€ ?
As far as I know I also need a Qt Licenses which is ~3500€ per OS.
What is right ?
Qt is under the LGPL licens
On 2009-06-19, Dennis Lee Bieber wrote:
> On Thu, 18 Jun 2009 14:24:42 +0300, Piter_ declaimed
>> I cant find out how to set "Handshaking RST on TX" in pyserial.
>
> Never encountered "RST" mode... "RTS" mode is common.
>
>>From the source -- a port can be initialized with:
[nothing relev
On 19 Jun, 21:41, Carl Banks wrote:
>
> (Note: I'm not talking about releasing the GIL for I/O operations,
> it's not the same thing. I'm talking about the ability to run
> computations on multiple cores at the same time, not to block in 50
> threads at the same time. Multiple cores aren't going
Grant Edwards wrote:
> On 2009-06-19, Mitko Haralanov wrote:
>
>> I have a question about finding out whether a string contains
>> binary data?
>
> All strings contain binary data.
Not quite, (python 2.x's) strings are binary data.
It just happens that it behaves like text when you appropria
On Fri, Jun 19, 2009 at 6:10 PM, Jure Erznožnik wrote:
> On Jun 19, 11:59 pm, Jesse Noller wrote:
>> On Fri, Jun 19, 2009 at 12:50 PM, OdarR wrote:
>> > On 19 juin, 16:16, Martin von Loewis > >> If you know that your (C) code is thread safe on its own, you can
>> >> release the GIL around long-run
John Machin wrote:
> Hi Gerhard,
> [...]
> In http://www.sqlite.org/c3ref/prepare.html it says """When an error
> occurs, sqlite3_step() will return one of the detailed error codes or
> extended error codes. The legacy behavior was that sqlite3_step()
> would only return a generic SQLITE_ERROR resu
Hi,
Newbie here. I copied and pasted the code below. But when I ran it I
got this error:
D:\>python mp3.py
Duree du fichier : 298919 millisecondes
Traceback (most recent call last):
File "mp3.py", line 37, in
time.sleep(int(buf)/1000)
ValueError: invalid literal for int() with base 10: '
On Jun 20, 7:16 am, Arlie wrote:
> Hi,
>
> Newbie here. I copied and pasted the code below. But when I ran it I
> got this error:
>
> D:\>python mp3.py
> Duree du fichier : 298919 millisecondes
> Traceback (most recent call last):
> File "mp3.py", line 37, in
> time.sleep(int(buf)/1000)
>
On 2009-06-19, Arlie wrote:
> Hi,
>
> Newbie here. I copied and pasted the code below. But when I ran it I
> got this error:
>
> D:\>python mp3.py
> Duree du fichier : 298919 millisecondes
> Traceback (most recent call last):
> File "mp3.py", line 37, in
> time.sleep(int(buf)/1000)
> Valu
In article ,
=?windows-1252?Q?Jure_Erzno=9Enik?= wrote:
>
>I do aggree though that threading is important. Regardless of any
>studies showing that threads suck, they are here and they offer
>relatively simple concurrency. IMHO they should never have been
>crippled like this. Even though GIL solve
In article <157e0345-74e0-4144-a2e6-2b4cc854c...@z7g2000vbh.googlegroups.com>,
Carl Banks wrote:
>
>I wish Pythonistas would be more willing to acknowledge the (few)
>drawbacks of the language (or implementation, in this case) instead of
>all this rationalization.
Please provide more evidence
In article ,
=?windows-1252?Q?Jure_Erzno=9Enik?= wrote:
>On Jun 19, 11:59=A0pm, Jesse Noller wrote:
>>
>> Sorry, you're incorrect. I/O Bound threads do in fact, take advantage
>> of multiple cores.
>
>Incorrect. They take advantage of OS threading support where another
>thread can run while one
OdarR schrieb:
> On 19 juin, 21:41, Carl Banks wrote:
>> He's saying that if your code involves extensions written in C that
>> release the GIL, the C thread can run on a different core than the
>> Python-thread at the same time. The GIL is only required for Python
>> code, and C code that uses t
On Jun 20, 1:36 am, a...@pythoncraft.com (Aahz) wrote:
>
> You should put up or shut up -- I've certainly seen multi-core speedup
> with threaded software, so show us your benchmarks!
> --
Sorry, no intent to offend anyone here. Flame wars are not my thing.
I have shown my benchmarks. See first p
Aahz wrote:
> In article <157e0345-74e0-4144-a2e6-2b4cc854c...@z7g2000vbh.googlegroups.com>,
> Carl Banks wrote:
>> I wish Pythonistas would be more willing to acknowledge the (few)
>> drawbacks of the language (or implementation, in this case) instead of
>> all this rationalization.
>
> Pleas
Jesse Noller wrote:
> Sorry, you're incorrect. I/O Bound threads do in fact, take advantage
> of multiple cores.
wrote:
>Incorrect. They take advantage of OS threading support where another
>thread can run while one is blocked for I/O. That is not equal to
>running on multiple cores (though it
On 6/19/2009 1:18 PM Mitko Haralanov said...
I have a question about finding out whether a string contains binary
data?
The only other check that I can think of is to check every character in
the read-in string against string.printable but that will take a long
time.
Well, probably not rea
On 2009-06-19, Arlie wrote:
> print 'Duree du fichier : ',buf,' millisecondes'
You can obviously make sure that 'buf' can be accessed as a string.
> time.sleep(int(buf)/1000)
The error seems to be having issues converting buf to an int. Could you
possibly convert it to a string before converti
Jure Erznožnik wrote:
> On Jun 20, 1:36 am, a...@pythoncraft.com (Aahz) wrote:
>> You should put up or shut up -- I've certainly seen multi-core speedup
>> with threaded software, so show us your benchmarks!
>> --
>
> Sorry, no intent to offend anyone here. Flame wars are not my thing.
>
> I have
Arlie wrote:
Hi,
Newbie here. I copied and pasted the code below. But when I ran it I
got this error:
D:\>python mp3.py
Duree du fichier : 298919 millisecondes
Traceback (most recent call last):
File "mp3.py", line 37, in
time.sleep(int(buf)/1000)
ValueError: invalid literal for int()
Hello,
My requierment is to get the "Stick Tag" value from the below o/p and
based on tag take different actions. What is the best way to implement
it. I am new to Python, so appreciate any input.
Command o/p:
===
File: Packet.tcl
On Jun 20, 8:07 am, Tim Harig wrote:
> On 2009-06-19, Arlie wrote:
>
> > print 'Duree du fichier : ',buf,' millisecondes'
>
> You can obviously make sure that 'buf' can be accessed as a string.
>
> > time.sleep(int(buf)/1000)
>
> The error seems to be having issues converting buf to an int. Coul
On Jun 20, 8:48 am, MRAB wrote:
> Arlie wrote:
> > Hi,
>
> > Newbie here. I copied and pasted the code below. But when I ran it I
> > got this error:
>
> > D:\>python mp3.py
> > Duree du fichier : 298919 millisecondes
> > Traceback (most recent call last):
> > File "mp3.py", line 37, in
> >
En Thu, 11 Jun 2009 16:44:03 -0300, steven.oldner
escribió:
Please give me directions on where to start researching for answers.
I probably can do the javascript, but I don't know where to start on
the Python.
1. Wife has a blogger blog and wants a widget to embed in the posts.
2. Widget wil
On Sat, 20 Jun 2009 00:07:27 GMT, Lie Ryan wrote:
[snip]
Perhaps we should have more built-in/stdlib operations that can release
GIL safely to release GIL by default? And perhaps some builtin/stdlib
should receive an optional argument that instruct them to release GIL
and by passing this argume
En Tue, 16 Jun 2009 02:09:57 -0300, Girish escribió:
I am not able to register DLL generated from py2exe
When I try to register the dll using the commant: regsve32 dspace.dll,
I am getting error saying :"DLLRegisterServer in dspace.dll failed.
Return code was: 0xc005"
I don't think the pr
En Tue, 16 Jun 2009 11:42:08 -0300, Daniel Merboth (RIT Student)
escribió:
My college uses a program called AccessGrid for video conferencing, and
it runs through pythonw.exe. It comes with a python script to kill all
processes and exit the program. The problem is, the script kills
every
On Wed, Jun 17, 2009 at 11:23 PM, Jason Gervich wrote:
> Why does IDLE use two hash marks for comments (##)? Most other editors
> (Geany, SPE) use a single hash mark (#) to designate comments.
I would guess to distinguish its (usually block) comments from
manually-added (usually explanatory) comme
ryles wrote:
However, in 3.0 list
comprehensions are actually treated as list().
That's not quite true -- it would be rather inefficient
if it was. The code generated for the LC is much the same
as it was in 2.x. But the whole LC is put into a nested
function so that the loop variables are loca
Philip Semanchuk wrote:
try:
sem.acquire() # User hits Ctrl + C while this is waiting
except:
print "* I caught it!"
Instead a KeyboardInterrupt error is propagated up to the interpreter
and the process is killed as if the try/except wasn't there at all.
Not sure exactly wh
In article <87eitg267e@benfinney.id.au>,
Ben Finney wrote:
>Matthew Wilson writes:
>>
>> from datetime import datetime
>> def f(c="today"):
>> if c == "today":
>> c = datetime.today()
>> return c.date()
>
>* You're re-binding the parameter name â
In article <4a3b5dc3$0$2985$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
>
>NB : answering the OP (original post didn't show up on c.l.py ???)
Correct. There's a problem with the mail->news gateway, I think that
MIME messages are failing. I "fixed" the problem for c.l.py.announce by
maki
I currently have something like this.
class applicant():
def __int__(self, x, y):
self.randomnum = normalvariate(x, y)
then other stuff
x, y are only used to calculate self.randomnum and this seems to
work. But I want self.randomnum to be 0 <= randomnum <= 100. The only
way I can th
Thanks, Chris. The best (and only) explanation I've heard so far. AS for
as editing the source code, that's beyond my gnubyness. I thought there
might be an easily accessible configuration file, but for the time I'll
use it as is.
I do wonder why in all these forum discussions about which Python
101 - 181 of 181 matches
Mail list logo