Hi,
Suppose I have the following function
char *generateMessage(char *sender, char *reciever, char *message) ;
now in c I would normally do
char *msg = generateMessage(sender, reciever, message);
// do something
free(msg);
My question is how do I free the memory allocated when I call this
funct
> Mac OS X:http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
Found these for linux:
http://www.pyinstaller.org/
http://wiki.python.org/moin/Freeze
thanks alot
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
The nicest thing I like about py2exe is its library.zip which
encapsulate all the dependencies into one single file.
I wonder if there a script which can do the same for linux/mac osx so
one can ship a python solution as a single file
(instead of starting easy_install per used library on the t
$ ~/devel/ice/snoip/freespeech$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.DatagramHandler
Traceback (most recent call last):
File "", line 1, in
AttributeErro
Trying to follow a technique found at bzr I did the following
added to ~/.ssh/authorized_keys the command="my_parder" parameter
which point to a python script file named 'my_parser' and located in /
usr/local/bin (file was chmoded as 777)
in that script file '/usr/local/bin/my_parser' I got the
On Oct 23, 12:04 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,,
> How can we access the time of message received ( UTC time) of an
> outlook mail in python? As far as I know the time which it displays in
> the mail is not the exact time... this UTC time will be present in
> MIME He
> Because math.pow returns a float; 100 ** 155 won't fit in a float.
Sure that is the reason.
May I rephrase, my question:
Why not returning another type as long as we can calculate it?
After all, math module is likely to be used on large numbers as well.
--
http://mail.python.org/mailman/listinfo
What is the reason math.pow yields OverflowError while python itself
can
calculate these large numbers. e.g:
>>> import math
>>> math.pow(100, 154)
1e+308
>>> math.pow(100, 155)
Traceback (most recent call last):
File "", line 1, in
OverflowError: math range error
>>> eval(('100*'* 155)[:-1])
1
Thanks Gabriel,
I was missing the information how to create a writable buffer.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I can't find in the documentation the way to use these two functions.
can someone share a simple code that utilize these two functions?
--
http://mail.python.org/mailman/listinfo/python-list
> Transmitting large binary data over UDP? That makes only sense for few
> applications like video and audio streaming. UDP does neither guarantee
> that your data is received nor it's received in order. For example the
> packages A, B, C, D might be received as A, D, B (no C).
>
> Can your protoco
On Sep 10, 9:55 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Tzury Bar Yochay wrote:
> > Would the one below will be capable of holding 30 concurrent
> > connections?
>
> UDP is a connectionless datagram protocol, so that question doesn't
> really m
concurrent
connections?
I have no intention of using Twisted or alike since I am looking for
making it as lightweight as possible
Thanks in advance,
Tzury Bar Yochay
# begin of snippet
from socket import *
# Create socket and bind to address
UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.bind(('
> When using SOCK_RAW, the family should be AF_PACKET,
> not AF_INET. Note that you need root privileges to do so.
I changed as instructed:
server = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
socket.getprotobyname('ip'))
now I am getting:
Traceback (most recent call last):
File "tcpsrv.
I am trying to create raw socket:
server = socket.socket(socket.AF_INET, socket.SOCK_RAW,
socket.getprotobyname('ip'))
As a result I get the following error:
Traceback (most recent call last):
File "tcpsrv.py", line 14, in
server = socket.socket(socket.AF_INET, socket.SOCK_RAW,
socket.get
> Can someone point me in the right direction? I'm looking for a module
> to monitor the Windows Event Viewer.
http://docs.python.org/lib/module-logging.html
NTEventLogHandler is the one you should use.
happy pythoning
--
http://mail.python.org/mailman/listinfo/python-list
after executing insert
do conection.commit()
--
http://mail.python.org/mailman/listinfo/python-list
Although I am experiencing this problem using a specific domain
library (pjsip). Googling this issue show that it is happening to many
libraries in python on mac.
I was wondering whether anyone solved this or alike in the past and
might share what steps were taken.
Note: this python lib works fine
> and then when my application execute code how can I set path to
> d3dx module to "library.zip/d3dx.py".
> I'm not sure is this properly set question.
use the module zipimport
http://docs.python.org/lib/module-zipimport.html
--
http://mail.python.org/mailman/listinfo/python-list
+Functional Programming
i guess we will meet somewhere in the middle
thanks again
tzury
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 25, 4:03 pm, Anthony <[EMAIL PROTECTED]> wrote:
> On Mar 25, 11:44 am, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote:
>
> > While my intention is to get 1.2 I get 2.2
> > I would like to know what would be the right way to yield the expected
> > results
>
> Rather than use Foo.bar(), use this syntax to call methods of the
> super class:
>
> super(ParentClass, self).method()
Hi Jeff,
here is the nw version which cause an error
class Foo(object):
def __init__(self):
self.id = 1
def getid(self):
return self.id
class FooSon(F
On Mar 25, 2:00 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Mar 25, 10:44 pm, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote:
>
>
>
> > given two classes:
>
> > class Foo(object):
> > def __init__(self):
> > self.id = 1
>
> >
given two classes:
class Foo(object):
def __init__(self):
self.id = 1
def getid(self):
return self.id
class FooSon(Foo):
def __init__(self):
Foo.__init__(self)
self.id = 2
def getid(self):
a = Foo.getid()
b = self.id
return
while I can invoke methods of empty string '' right in typing
(''.join(), etc.) I can't do the same with empty list
example:
>>> a = [1,2,3]
>>> b = [].extend(a)
>>> b
>>> b = []
>>> b.extend(a)
>>> b
[1,2,3]
I would not use b = a since I don't want changes on 'b' to apply on
'a'
do you think t
this byte array.
On Mar 24, 8:48 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sun, 23 Mar 2008 22:33:58 -0700 (PDT), Tzury Bar Yochay
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > for example:
> > the value
> > 'EE604E
hi,
in my table the field row_id is type of uniqueidentifier.
when try to fetch the data, pymssql somehow, encodes the values in a
way which yields odd results.
for example:
the value
'EE604EE3-4AB0-4EE7-AF4D-018124393CD7'
is represent as
'\xe3N`\xee\xb0J\xe7N\xafM\x01\x81$9<\xd7'
the only way
I am about to start a large-scale enterprise project next month (I
insist on using Python instead Java and .NET and I am sure `they` will
thank me eventually).
I was wondering around making my components-and-libraries-shopping-
list and came across PEAK.
My paranoia is that PEAK would make me writ
Thank Hrvoje as well
--
http://mail.python.org/mailman/listinfo/python-list
> data = "dummy"
> while data:
> ...
Thanks Alot
--
http://mail.python.org/mailman/listinfo/python-list
The following is a code I am using for a simple tcp echo server.
When I run it and then connect to it (with Telnet for example) if I
shout down the telnet the CPU tops 100% of usage and saty there
forever.
Can one tell what am I doing wrong?
#code.py
import SocketServer
class MyServer(SocketServ
here is its:
# a simple tcp server
import SocketServer
class EchoRequestHandler(SocketServer.BaseRequestHandler ):
def setup(self):
print self.client_address, 'connected!'
self.request.send('hi ' + str(self.client_address) + '\n')
def handle(self):
while 1:
> See the SocketServer module, both the documentation and the source code.
I firstly looked at this module and its __doc__, yet I still need an
'hello world' sample. and couldn't get it straight how can I write my
own hello world sample with SocketServer objects.
--
http://mail.python.org/mailm
> Even simpler, use Twisted:
I am afraid Twisted is not the right choice in my case. I am looking
for smaller, simpler and minimal server sample.
--
http://mail.python.org/mailman/listinfo/python-list
hi, the following sample (from docs.python.org) is a server that can
actually serve only single client at a time.
In my case I need a simple server that can serve more than one client.
I couldn't find an example on how to do that and be glad to get a
hint.
Thanks in advance
import socket
HOST =
> However, one point you have shown very clearly: the second one is much
> easier to tear apart and reassemble.
Sure.
Zen Of Python: Readbility Counts
--
http://mail.python.org/mailman/listinfo/python-list
def loadResMap(self):
self.resMap = []
[[self.resMap.append(str('A2' + sim[0] + '/r' + str(x)))
for x in range(1, eval(sim[1])+1)]
for sim in [x.split(':')
for x in quickViews.smsResList.v.split(",")]]
'''
# Confuse
I discovered pywin32-210.win32-py2.5 package which does all the work
for me.
Open Software world is a great place to live by
On Aug 14, 12:45 pm, Tzury <[EMAIL PROTECTED]> wrote:
> I followed the tutorial about ctypes and I still cannot figure out how
> to call a method of a cals
I followed the tutorial about ctypes and I still cannot figure out how
to call a method of a calss within the dll.
For example:
a dll named 'foo' contain a class named 'bar' which expose a method
named 'baz'.
if I either do:
mydll = windll.foo
mycls = mydll.bar
or
mycls = windll.foo.bar
or
myc
I followed the tutorial about ctypes and I still cannot figure out how
to call a method of a calss within the dll.
For example:
a dll named 'foo' contain a class named 'bar' which expose a method
named 'baz'.
if I either do:
mydll = windll.foo
mycls = mydll.bar
or
mycls = windll.foo.bar
or
myc
> What do you actually think
>
> ... for m in msg:
> ... print m
>
> should do? Why do you believe that what you think it should do would be
> a natural choice?
I needed to know how to extract particular parts of a message, such as
the message 'body', 'subject', 'author', etc.
I co
ewbie to say so.
I found inspect.getmembers(msg) as a good solution to map the message
properties.
10x,
Tzury
--
http://mail.python.org/mailman/listinfo/python-list
I am getting the following error when trying to iterate in a message
in a Maildir directory.
please help.
>>> from mailbox import Maildir, MaildirMessage
>>> mbox = Maildir('path/to/mailbox', create = False, factory = MaildirMessage)
>>> for msg in mbox:
... for m in msg:
... print
Yet,
'utf_16_be' is not 'ucs-2'.
How would I get ucs-2 encoding and decoding functionality with python?
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 17, 10:48 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > I recently rewrote a .net application in python.
> > The application is basically gets streams via TCP socket and handle
> > operations against an existing database.
> > The Database is SQLite3 (Encoded as UTF-8).
> > The Network
On Jun 17, 10:48 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > I recently rewrote a .net application in python.
> > The application is basically gets streams via TCP socket and handle
> > operations against an existing database.
> > The Database is SQLite3 (Encoded as UTF-8).
> > The Network
I recently rewrote a .net application in python.
The application is basically gets streams via TCP socket and handle
operations against an existing database.
The Database is SQLite3 (Encoded as UTF-8).
The Networks streams are encoded as UCS-2.
Since in UCS-2, 'A' = '0041' and when I check with t
Is it possible to modify the Systems' Date and Time with python?
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone tell the technique of composing a WHERE clause that refer
to a unicode data. e.g. "WHERE FirstName = ABCD" where ABCD is the
unicoded first name in the form that sqlite will match with its
records.
--
http://mail.python.org/mailman/listinfo/python-list
Given an sqlite db that stores the strings data such as names, etc.
encoded in Unicode.
How do I write a sql query statement with 'LIKE' or '=' operators and
insert the Unicoded name.
for example:
in table MY_TABLE, in column COL01 there is a value "¿Habla español?"
within python I represent thi
On Feb 27, 2:27 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote:
> On 27 Feb, 13:12, "Tzury" <[EMAIL PROTECTED]> wrote:
>
>
>
> > c) small web application that will be used as front end to configure
> > the system (flat files and sqlite3 db ar
Regarding the platform described below, can anyone suggest from his
experience what would be the best library choice to develop the
following application.
a) application that deals with data transformed via TCP sockets.
b) reading and writing to and from sqlite3 (include Unicode
manipulations).
c)
52 matches
Mail list logo