mark wrote:
> is it possible to call a php function from python and use a class from
> php in python? i want to use mmslib which creates mms messages and the
> only implementation is a php mmslib implementation.
You can consider to use some kind of RPC (remote procedure call)
for example XML-RPC.
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On Feb 14, 5:45 pm, "agent-s" <[EMAIL PROTECTED]> wrote:
| > btw Steven you are so witty I hope to one day pwn noobs on newsgroups
| > too.
Sorry, but you are 'pwning' yourself here ;-)
| Wit has nothing to do with it.
"John Machin" <[EMAIL PROTECTED]> writes:
> What does "pwn" mean?
http://en.wikipedia.org/wiki/Pwn
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 13, 5:09 pm, Giovanni Bajo <[EMAIL PROTECTED]> wrote:
> > The itertools.repeat(const).next approach wins on speed and
> > flexibility.
>
> But it's the most unreadable too.
Not really. It's unusual but plenty readable (no surprise that
repeat(0) repeatedly gives you zero). I think it more
En Wed, 14 Feb 2007 04:23:46 -0300, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
> I am OK with calls being stacked, but I wondering will the local
> variables be stacked given that return statement is followed by the
> function call?
>
> def test():
> x = 22
> y = 33
> z = x+y
> retu
On Feb 14, 11:09 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,
> I have a program which literately finds the object that overlapping a
> point. The horizontal and vertical search are called recursively from
> inside each other.
> Is this way of implementation fill thestackspace with th
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I am OK with calls being stacked, but I wondering will the local
variables be stacked given that return statement is followed by the
function call?
def test():
x = 22
y = 33
z = x+y
return anotherFunction(z)
On 14 Feb, 00:17, "Giles Brown" <[EMAIL PROTECTED]> wrote:
> Something I always found useful is to use the win32traceutil to set up
> the trace debugging tool.
> You can then see the output in the pythonwin trace collector tool.
> This is very useful for
> Python services and COM servers.
>
> Best
On Feb 14, 9:11 am, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
> On Feb 13, 5:09 pm, Giovanni Bajo <[EMAIL PROTECTED]> wrote:
>
> > > The itertools.repeat(const).next approach wins on speed and
> > > flexibility.
>
> > But it's the most unreadable too.
>
> Not really. It's unusual but plenty r
Rob Wolfe wrote:
>
> mark wrote:
>> is it possible to call a php function from python and use a class from
>> php in python? i want to use mmslib which creates mms messages and the
>> only implementation is a php mmslib implementation.
>
> You can consider to use some kind of RPC (remote procedu
On Feb 14, 7:02 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "John Machin" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> | On Feb 14, 5:45 pm, "agent-s" <[EMAIL PROTECTED]> wrote:
> | > btw Steven you are so witty I hope to one day pwn noobs on newsgroups
> | > too.
>
> Sorr
On Feb 14, 2007, at 3:08 AM, John Machin wrote:
> So "enlightenment" has been verbed, has it? I didn't realise that the
> language had been transitioned so far :-)
*ALL* nouns may be verbed ;-)
-michael
---
# Something just doesn't seem right in those
# "Every kiss begins with 'K'" commercials.
Sam <[EMAIL PROTECTED]> skriver:
> On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
><[EMAIL PROTECTED]> wrote:
>> Well, C++ is a better language than C in many ways. So, if he needs to learn
>> one of them, why does it have to be C?
>>
>> Another reason some people choose C++ over Python for some tasks i
(dancing stripper on your dekstop free)
--
http://mail.python.org/mailman/listinfo/python-list
>
> What module are you using for SSH?
>
> What's in your program that isn't pure Python?
> The problem is probably in some non-Python component; you shouldn't
> be able to force a memory protection error from within Python code.
>
It looks like the error could be in scipy/Numeric, when
On Feb 12, 1:27 am, "agent-s" <[EMAIL PROTECTED]> wrote:
> Basically I'm programming a board game and I have to use a list of
> lists to represent the board (a list of 8 lists with 8 elements each).
> I have to search the adjacent cells for existing pieces and I was
> wondering how I would go about
mark wrote:
> is it possible to call a php function from python and use a class from
> php in python? i want to use mmslib which creates mms messages and the
> only implementation is a php mmslib implementation.
Do yourself - and the python community... :) - a favor and just translate
the mmslib
On Feb 14, 12:26 am, Sam <[EMAIL PROTECTED]> wrote:
[...]
> C++ is -not- strongly typed. You can cast anything to void *, and
> manipulate it in ways unimaginable. Plus there's the whole mess that
> is pointer arithmetic and a weak typesystem...
The previous poster wrote "strongly typed", not "a s
Hi Thomas
On Feb 12, 6:00 pm, "Thomas Nelson" <[EMAIL PROTECTED]> wrote:
> I realize I'm approaching this backwards from the direction most
> people go, but does anyone know of a good c/c++ introduction for
> python programmers?
>
They are not particularly aimed at Python programmers, but Bruce
E
Michael Bentley <[EMAIL PROTECTED]> writes:
> # Something just doesn't seem right in those
> # "Every kiss begins with 'K'" commercials.
>
> >>> 'Every Kiss'.startswith('K')
> False
>>> kisses = ["kiss", "kiss", "kiss", "kiss", "kiss"]
>>> kisses == [kiss for kiss in kisses
...
Hi
I was wondering if there was a nicer way to swap the first 2
characters in a string with the 4th and 5th characters other than:
darr=list("010203040506")
aarr=darr[:2]
barr=darr[4:6]
darr[:2]=barr
darr[4:6]=aarr
result="".join(darr)
The above code works fine but I was wondering if anybody had
amadain wrote:
> Hi
> I was wondering if there was a nicer way to swap the first 2
> characters in a string with the 4th and 5th characters other than:
>
> darr=list("010203040506")
> aarr=darr[:2]
> barr=darr[4:6]
> darr[:2]=barr
> darr[4:6]=aarr
> result="".join(darr)
>
> The above code works
Le mercredi 14 février 2007 13:08, amadain a écrit :
> darr=list("010203040506")
> aarr=darr[:2]
> barr=darr[4:6]
> darr[:2]=barr
> darr[4:6]=aarr
> result="".join(darr)
>
> The above code works fine but I was wondering if anybody had another
> way of doing this?
Why not :
In [4]: s="010203040506
On Feb 14, 1:08 pm, "amadain" <[EMAIL PROTECTED]> wrote:
> I was wondering if there was a nicer way to swap the first 2
> characters in a string with the 4th and 5th characters other than:
>
> darr=list("010203040506")
> aarr=darr[:2]
> barr=darr[4:6]
> darr[:2]=barr
> darr[4:6]=aarr
> result="".jo
On Feb 14, 12:16 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> amadain wrote:
> > Hi
> > I was wondering if there was a nicer way to swap the first 2
> > characters in a string with the 4th and 5th characters other than:
>
> > darr=list("010203040506")
> > aarr=darr[:2]
> > barr=darr[4:6]
> >
jim-on-linux wrote:
> On Tuesday 13 February 2007 18:02, Gigs_ wrote:
>> can someone explain me this code?
>>
>> from Tkinter import *
>>
>> root = Tk()
>>
>> def callback(event):
>> print "clicked at", event.x, event.y
>>
>> frame = Frame(root, width=100, height=100)
>> frame.bind("", callbac
amadain <[EMAIL PROTECTED]> wrote:
>I was wondering if there was a nicer way to swap the first 2
>characters in a string with the 4th and 5th characters other than:
>
>darr=list("010203040506")
>aarr=darr[:2]
>barr=darr[4:6]
>darr[:2]=barr
>darr[4:6]=aarr
>result="".join(darr)
darr=list("010203040
Or, slighly slower, but more general:
def swap(s, order=(3,4,2,0,1)):
# assert len(s) >= len(order)
return ''.join([s[o] for o in order]) + s[6:]
--
http://mail.python.org/mailman/listinfo/python-list
Another question, I'm sorry.
Do you got any idea about how to get permissions of a file/directory
given the username?
For example: I would like to know if C:\my_file.ext is readable/
writable by user 'x' or not.
--
http://mail.python.org/mailman/listinfo/python-list
mtuller wrote:
> Alright. I have tried everything I can find, but am not getting
> anywhere. I have a web page that has data like this:
>
>
>
> LETTER
>
> 33,699
>
> 1.0
>
>
>
> What is show is only a small section.
>
> I want to extract the 33,699 (which is dynamic) and set the value to a
>
billie wrote:
> Another question, I'm sorry.
> Do you got any idea about how to get permissions of a file/directory
> given the username?
> For example: I would like to know if C:\my_file.ext is readable/
> writable by user 'x' or not.
This is an unfortunately messy question. The easiest
answer --
Tim Golden wrote:
> billie wrote:
>> Another question, I'm sorry.
>> Do you got any idea about how to get permissions of a file/directory
>> given the username?
>> For example: I would like to know if C:\my_file.ext is readable/
>> writable by user 'x' or not.
>
> This is an unfortunately messy qu
> Thats the same code. I was wondering if the string manipulation can be
> done without an excursion into the list world.
That's the price to pay for immutable strings. If you have to to lots of
stuff like that, then keep things a list, and join only when you need the
result as a string.
Diez
--
On 14 Feb, 14:30, Tim Golden <[EMAIL PROTECTED]> wrote:
> Tim Golden wrote:
> > billie wrote:
> >> Another question, I'm sorry.
> >> Do you got any idea about how to get permissions of a file/directory
> >> given the username?
> >> For example: I would like to know if C:\my_file.ext is readable/
>
On 2007-02-13, Sam <[EMAIL PROTECTED]> wrote:
> On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
><[EMAIL PROTECTED]> wrote:
>> Well, C++ is a better language than C in many ways. So, if he
>> needs to learn one of them, why does it have to be C?
>>
>> Another reason some people choose C++ over Python for
On 2007-02-14, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Wed, 14 Feb 2007 03:09:37 -0300, [EMAIL PROTECTED]
><[EMAIL PROTECTED]> escribió:
>> Is this way of implementation fill the stack space with the
>> local variables inside each call. If this is not good, is
>> there a better way t
Hi,
am am a Python beginner with Java knowledge background. Infact I need to use
Jython.
My first beginner question is how to determine of what type a variable is?
In program which supports Jython there is a variable called "rc" available. I
can use the methods on that variable
Diez B. Roggisch:
> That's the price to pay for immutable strings.
Right, but CPython has array.array("c") too. Using Diez Roggisch's
code:
>>> from array import array
>>> arrs = array("c", "010203040506")
>>> arrs[:2], arrs[4:5] = arrs[4:6], arrs[:2]
>>> arrs.tostring()
'0302013040506'
Using su
Hans Schwaebli wrote:
> Hi,
>
> am am a Python beginner with Java knowledge background. Infact I need to
> use Jython.
>
> My first beginner question is how to determine of what type a variable is?
Let v be the var, 'print type(v)' should* work. [* I've never used
Jython before].
You can pr
On Wed, 14 Feb 2007 05:47:31 -0800 (PST), Hans Schwaebli <[EMAIL PROTECTED]>
wrote:
>Hi,
>
> am am a Python beginner with Java knowledge background. Infact I need to use
> Jython.
>
> My first beginner question is how to determine of what type a variable is?
>
> In program which supports Jytho
Thanks all. I usually turn strings into arrays for processing. I was
looking to see if that was the best way to do it from others that use
python. No one else uses python in my company so its nice to get
different points of view from other python users from lists like this.
A
--
http://mail.pytho
[EMAIL PROTECTED] wrote:
> Diez B. Roggisch:
>> That's the price to pay for immutable strings.
>
> Right, but CPython has array.array("c") too. Using Diez Roggisch's
> code:
Ahhh, ze arrayz. I alwayz forget about the arrayz.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 14, 8:00 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Wed, 14 Feb 2007 05:47:31 -0800 (PST), Hans Schwaebli <[EMAIL PROTECTED]>
> wrote:
> >Hi,
>
> > am am a Python beginner with Java knowledge background. Infact I need to
> > use Jython.
>
> > My first beginner question is ho
On Feb 14, 6:08 am, "amadain" <[EMAIL PROTECTED]> wrote:
> Hi
> I was wondering if there was a nicer way to swap the first 2
> characters in a string with the 4th and 5th characters other than:
>
> darr=list("010203040506")
> aarr=darr[:2]
> barr=darr[4:6]
> darr[:2]=barr
> darr[4:6]=aarr
> result=
Paul Watson <[EMAIL PROTECTED]> writes:
> I would like to create some additional shapes in Microsoft Visio using
> the Python language. It would appear that Visio can use any CLR
> language. Has anyone done this? Can I use the Python package from
> python.org, or must I use IronPython?
An alte
On 2007-02-14, Terry Reedy <[EMAIL PROTECTED]> wrote:
>| Wit has nothing to do with it. The fact that you are a Python noob is
>| also irrelevant. Your problem statement was unintelligible, as is your
>| response. What does "pwn" mean?
>
> I believe that it is a misspelling of 'own' used by pvp (p
Hi
Heres a poser. I want to start a program 4 times at exactly the same
time (emulating 4 separate users starting up the same program). I am
using pexpect to run the program from 4 separate locations accross the
network. How do I start the programs running at exactly the same time?
I want to time h
I'm trying to write rot13, but to do it in a better and more Pythonic
style than I'm currrently using. What would you reckon to the
following pretty ugly thing? How would you improve it? In
particular, I don't like the way a three-way selection is done by
nesting two binary selections. Also I d
On Feb 13, 9:07 pm, Maric Michaud <[EMAIL PROTECTED]> wrote:
> I've heard of a bunch of arguments to defend python's choice of GIL, but I'm
> not quite sure of their technical background, nor what is really important
> and what is not. These discussions often end in a prudent "python has made a
> c
On Feb 14, 1:33 am, Maric Michaud <[EMAIL PROTECTED]> wrote:
> At this time, it 's not easy to explain him that python
> is notflawed compared to Java, and that he will not
> regret his choice in the future.
Database adaptors such as psycopg do release the GIL while connecting
and exchanging data
On Feb 14, 7:53 am, "amadain" <[EMAIL PROTECTED]> wrote:
> Hi
> Heres a poser. I want to start a program 4 times at exactly the same
> time (emulating 4 separate users starting up the same program). I am
> using pexpect to run the program from 4 separate locations accross the
> network. How do I st
On Feb 14, 3:32 pm, [EMAIL PROTECTED] wrote:
> On Feb 14, 7:53 am, "amadain" <[EMAIL PROTECTED]> wrote:
>
> > Hi
> > Heres a poser. I want to start a program 4 times at exactly the same
> > time (emulating 4 separate users starting up the same program). I am
> > using pexpect to run the program fro
You could try "some_string".encode('rot_13')
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I would like to know if there is a way to know how much memory (bytes,
kilobytes, megabytes, etc) a name is using.
More specifically, I have this list of strings that I want to write to
a file as lines.
This list grows througout the script execution, and toward the end,
the file is written
On Feb 14, 2:41 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
[...]
> Don't forget the lack of standard garbage collection.
Optional garbage collection is highly likely to be included in the
next C++ standard, due out in a couple of years.
> Also there's the hell known as exception safety.
>
> Pyth
py lib 0.9.0: py.test, distributed execution, greenlets and more
==
Welcome to the 0.9.0 py lib release - a library aiming to
support agile and test-driven python development on various levels.
Main API/Tool Features:
* py.te
"Characters" is a parameterized property. So you can't call it without a
generated wrapper.
see inside the wrapper:
# Result is of type Characters
# The method GetCharacters is actually a property, but must be
used as a method to correctly pass the arguments
def GetCharacte
I am working on a Python script to perform as a remote computer
manager. So far I have a WOL function working and I would like to add
the ability to show if a machine is on or off (I figured I would do so
by pinging the machine and seeing if I get a response). I would also
like to add the ability t
[EMAIL PROTECTED] a écrit :
> I am working on a Python script to perform as a remote computer
> manager. So far I have a WOL function working and I would like to add
> the ability to show if a machine is on or off (I figured I would do so
> by pinging the machine and seeing if I get a response). I
On 2007-02-14, Andy Dingley <[EMAIL PROTECTED]> wrote:
> I'm trying to write rot13, but to do it in a better and more
> Pythonic style than I'm currrently using. What would you
> reckon to the following pretty ugly thing? How would you
> improve it? In particular, I don't like the way a three-w
Bernard Lebel wrote:
> Hello,
>
> I would like to know if there is a way to know how much memory (bytes,
> kilobytes, megabytes, etc) a name is using.
>
> More specifically, I have this list of strings that I want to write to
> a file as lines.
> This list grows througout the script execution, a
[EMAIL PROTECTED] wrote:
> Here is my current setup:
>
> [... BSD ...]
> - Windows XP machine with folder share (What packet is sent over the
> network to remotely shutdown a Windows XP machine?)
>
> My hope is to have a script then when you start it will list all your
> remote computers/servers
martien friedeman wrote:
> I have written this tool that allows you to look at runtime data and
> code at the same time.
> And now I need people to test it.
>
> The easiest way to see what I mean is to look at some videos:
> http://codeinvestigator.googlepages.com/codeinvestigator_videos
>
> It
In my script I started using urllib2 to connect to a list of
servers.It works well but only until a server from the list is not
available.Then if it is down , there is a timeout and my script ends
with the error.
So, if I have a list of 10 servers, and the second from the list is
not available ,
Andy Dingley wrote:
> I'm trying to write rot13, but to do it in a better and more Pythonic
> style than I'm currrently using. What would you reckon to the
> following pretty ugly thing? How would you improve it? In
> particular, I don't like the way a three-way selection is done by
> nesting t
Johny wrote:
> In my script I started using urllib2 to connect to a list of
> servers.It works well but only until a server from the list is not
> available.Then if it is down , there is a timeout and my script ends
> with the error.
> So, if I have a list of 10 servers, and the second from the l
On 14 Feb, 16:23, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> str.translate is what I'd do.
That's what I hope to do too, but it might not be possible (for the
live, complex example). It looks as if I have to make a test, then
process the contents of the code differently depending. There might
well
I'm trying to create a list range of floats and running into problems.
I've been trying something like:
a = 0.0
b = 10.0
flts = range(a, b)
fltlst.append(flts)
When I run it I get the following DeprecationWarning: integer argument
expected, got float. How can I store a list of floats?
TIA
On 2/14/07, Steve <[EMAIL PROTECTED]> wrote:
> I'm trying to create a list range of floats and running into problems.
> I've been trying something like:
>
> a = 0.0
> b = 10.0
>
> flts = range(a, b)
>
> fltlst.append(flts)
>
> When I run it I get the following DeprecationWarning: integer argument
>
Steve wrote:
> I'm trying to create a list range of floats and running into problems.
> I've been trying something like:
>
> a = 0.0
> b = 10.0
>
> flts = range(a, b)
>
> fltlst.append(flts)
>
> When I run it I get the following DeprecationWarning: integer argument
> expected, got float. How c
On Wed, 14 Feb 2007 17:27:06 +, Dale Strickland-Clark wrote:
> Steve wrote:
>
>> I'm trying to create a list range of floats and running into problems.
>> I've been trying something like:
>>
>> a = 0.0
>> b = 10.0
>>
>> flts = range(a, b)
>>
>> fltlst.append(flts)
>>
>> When I run it I ge
> fits = list(float(a) for a in range(0, 10))
Another way of writing that:
flts = map(float,range(10))
--
http://mail.python.org/mailman/listinfo/python-list
Steve wrote:
> I'm trying to create a list range of floats and running into problems.
> I've been trying something like:
>
> a = 0.0
> b = 10.0
>
> flts = range(a, b)
>
> fltlst.append(flts)
>
> When I run it I get the following DeprecationWarning: integer argument
> expected, got float. H
En Wed, 14 Feb 2007 14:04:17 -0300, Andy Dingley <[EMAIL PROTECTED]>
escribió:
> I still don't understand what a lambda is _for_ in Python. I know what
> they are, I know what the alternatives are, but I still haven't found
> an instance where it permits something novel to be done that couldn't
a = 0.0
b = 10.0
inc = .2
flts = []
while a < b:
flts.append(a)
a += inc
--
http://mail.python.org/mailman/listinfo/python-list
Neil Cerutti wrote:
> On 2007-02-13, Peter Otten <[EMAIL PROTECTED]> wrote:
>> Well, what problems ocurring with
>>
>> class A: pass
>> class B: pass
>> class C(A, B): pass
>>
>> could be avoided by writing
>>
>> class A: pass
>> class B(A): pass
>> class C(B): pass
>>
>> instead?
>
> With multip
massimo s. wrote:
> On 13 Feb, 12:46, Peter Otten <[EMAIL PROTECTED]> wrote:
>> Well, what problems ocurring with
>>
>> class A: pass
>> class B: pass
>> class C(A, B): pass
>>
>> could be avoided by writing
>>
>> class A: pass
>> class B(A): pass
>> class C(B): pass
>>
>> instead? Classes have to
On Feb 14, 10:09 am, Christophe <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] a écrit :
>
>
>
> > I am working on a Python script to perform as a remote computer
> > manager. So far I have a WOL function working and I would like to add
> > the ability to show if a machine is on or off (I figured I
On Tuesday 13 February 2007 11:04, [EMAIL PROTECTED] wrote:
> To be true, I don't know if any of these toolkits (GTK, wxWindows, QT)
> and their GUIDesigners have the features you like in Delphi. What I
> know is that:
> 1/ these three toolkits have everything *needed* to write serious GUI
> apps
On Wed, 14 Feb 2007 17:29:26 +, Simon Brunning wrote:
> On 2/14/07, Steve <[EMAIL PROTECTED]> wrote:
>> I'm trying to create a list range of floats and running into problems.
>> I've been trying something like:
>>
>> a = 0.0
>> b = 10.0
>>
>> flts = range(a, b)
>>
>> fltlst.append(flts)
>>
>>
On 2/14/07, Steve <[EMAIL PROTECTED]> wrote:
> After re-reading my original post I was pretty vague. I'm trying to creat
> a list of ranges of floats, 0.0 10.0, 11 20, etc then checking to see if
> an float, example 12.5 falls in the list and if so get the list index of
> where it is in the index.
That's amazing!
We had the same idea.
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-02-14, Peter Otten <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>> On 2007-02-13, Peter Otten <[EMAIL PROTECTED]> wrote:
>>> Well, what problems ocurring with
>>>
>>> class A: pass
>>> class B: pass
>>> class C(A, B): pass
>>>
>>> could be avoided by writing
>>>
>>> class A: pass
>>>
I keep getting this error "local variable 'f' referenced before
assignment" in the finally block when I run the following code.
try:
f = file(self.filename, 'rb')
f.seek(DATA_OFFSET)
self.__data = f.read(DATA_SIZE)
self.isDataLoaded = True
On 14 Feb 2007 11:41:29 -0800, redawgts <[EMAIL PROTECTED]> wrote:
>I keep getting this error "local variable 'f' referenced before
>assignment" in the finally block when I run the following code.
>
>try:
>f = file(self.filename, 'rb')
>f.seek(DATA_OFFSET)
>
redawgts wrote:
> I keep getting this error "local variable 'f' referenced before
> assignment" in the finally block when I run the following code.
>
> try:
> f = file(self.filename, 'rb')
> f.seek(DATA_OFFSET)
> self.__data = f.read(DATA_SIZE)
>
"redawgts" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I keep getting this error "local variable 'f' referenced before
> assignment" in the finally block when I run the following code.
>
>try:
>f = file(self.filename, 'rb')
>f.seek(DATA_OFFSET)
>
redawgts wrote:
> I keep getting this error "local variable 'f' referenced before
> assignment" in the finally block when I run the following code.
>
> try:
> f = file(self.filename, 'rb')
> f.seek(DATA_OFFSET)
> self.__data = f.read(DATA_SIZE)
>
On Feb 14, 9:04 am, "Andy Dingley" <[EMAIL PROTECTED]> wrote:
> I still don't understand what a lambda is _for_ in Python.
Python supports functional programming to a certain extent, and
lambdas are part of this.
http://linuxgazette.net/109/pramode.html
> I know what
> they are, I know what the
"redawgts" <[EMAIL PROTECTED]> writes:
> try:
> f = file(self.filename, 'rb') ...
> Can someone tell me what's wrong with the code?
Various people have explained the error: if the file open attempt
fails, f is never assigned. Doing it the right way (i.e. handling the
potentia
Mathias wrote:
>>
>> What module are you using for SSH?
>>
>> What's in your program that isn't pure Python?
>> The problem is probably in some non-Python component; you shouldn't
>> be able to force a memory protection error from within Python code.
>>
>
> It looks like the error could be
Bernard Lebel a écrit :
> Hello,
>
> I would like to know if there is a way to know how much memory (bytes,
> kilobytes, megabytes, etc) a name is using.
>
> More specifically, I have this list of strings that I want to write to
> a file as lines.
> This list grows througout the script execution,
dear all,
i am new to python and have a question about referencing data in a dict.
is there anyway that allows me to do something like:
dict[['row1', 'row2', .'row100']]
thanks much.
--
WenSui Liu
A lousy statistician who happens to know a little programming
(http://spaces.msn.com/statcomput
In article <[EMAIL PROTECTED]>,
Maric Michaud <[EMAIL PROTECTED]> wrote:
> This is a recurrent problem I encounter when I try to sell python solutions
> to
> my customers. I'm aware that this problem is sometimes overlooked, but here
> is the market's law.
>
> I've heard of a bunch of argumen
"Wensui Liu" <[EMAIL PROTECTED]> writes:
> i am new to python and have a question about referencing data in a
> dict. is there anyway that allows me to do something like:
> dict[['row1', 'row2', .'row100']]
What behaviour would you expect from that statement? If we know what
you're trying t
Diez: thanks, I will try that. However isn't sum() returning an
integer that here would represent the number of elements?
Bruno: good question. We're talking about text files that can have
300,000 lines, if not more. Currently, the way I have coded the file
writing, every line calls for a write()
I know dict['row1'] will always work. but it will only get 1 row out
of the dict. is there anyway i can get multiple (>1) rows out of dict
by directly refeencing them, something like dict[['row1', 'row2']].
thank you for reply, Ben.
wensui
On 2/14/07, Ben Finney <[EMAIL PROTECTED]> wrote:
> "Wen
In <[EMAIL PROTECTED]>, Wensui Liu
wrote:
> I know dict['row1'] will always work. but it will only get 1 row out
> of the dict. is there anyway i can get multiple (>1) rows out of dict
> by directly refeencing them, something like dict[['row1', 'row2']].
Not by directly referencing them, but with
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> (1,)+[1]
Traceback (most recent call last):
File "", line 1, in
TypeError: can only concatenate tuple (not "list") to tuple
>>> [1]+(1,)
Sergey Dorofeev wrote:
> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> (1,)+[1]
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: can only concatenate tupl
1 - 100 of 176 matches
Mail list logo