On Sun, 09 Aug 2009 23:03:14 -0700, John Nagle wrote:
> if another escape character ever has to be
> added to the language, that may change the semantics of previously
> correct strings.
And that's the only argument in favour of prohibiting non-special
backslash sequences I've seen yet that is e
On Sun, 09 Aug 2009 22:48:31 -0700, AlF wrote:
> Steven D'Aprano wrote:
>> On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
>>
>>> Hi,
>>>
>>> what is the best way to reload the module imported using 'from ...
>>> import ...'
>>
>>
>> Have you tried "from ... import ..." again?
>>
>>
> I have n
On Sun, 09 Aug 2009 18:34:14 -0700, Carl Banks wrote:
>> Why should a backslash in a string literal be an error?
>
> Because the behavior of \ in a string is context-dependent, which means
> a reader can't know if \ is a literal character or escape character
> without knowing the context, and it
On Sun, 09 Aug 2009 17:56:55 -0700, Douglas Alan wrote:
> Steven D'Aprano wrote:
>
>> Why should a backslash in a string literal be an error?
>
> Because in Python, if my friend sees the string "foo\xbar\n", he has no
> idea whether the "\x" is an escape sequence, or if it is just the
> characte
Carl Banks wrote:
IOW it's an error-prone mess. It would be better if Python (like C)
treated \ consistently as an escape character. (And in raw strings,
consistently as a literal.)
Agreed. For one thing, if another escape character ever has to be
added to the language, that may change th
Thank you Dennis
I'm using 2 differents editor, which may be the cause of such a mess
in the indentation.
I must admitt that I lazily rely on those (not so bad indeed) editors.
"If indentation whas bad they would have tell me"
Too bad am i
Won't post misindeted code anymore.
--
http://mail.py
Steven D'Aprano wrote:
On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
Hi,
what is the best way to reload the module imported using 'from ...
import ...'
Have you tried "from ... import ..." again?
I have not because of an assumption that "import" imports the module
just once. In fact th
Dave WB3DWE wrote:
>
>Anybody tried it ?
>Is anything broken, ie is the whole shootin' match good to go ?
>I'm esp interested in WConio for 3.0/3.1 which I use heavily.
I've been running the 32-bit builds of Python 2.5, PyWin32, and wxPython on
Windows 7 64-bit for many months. No problems at al
"Algirdas Brazas" wrote:
>
>Did anyone manage to get windows extensions installet on windows 7 64 bit? As
>far as I try I get only "Setup program invalid or damaged".
I've been running 32-bit Python 2.5 and the 32-bit versions of PyWin32 and
wxPython on Windows 7 64-bit for many months. No prob
On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
> Hi,
>
> what is the best way to reload the module imported using 'from ...
> import ...'
Have you tried "from ... import ..." again?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Kosta wrote:
>
>
>What I would like to do, is to open a cmd window, and start a Python
>script. This script would then (based upon input arguments), build
>different flavors of the driver (fre, chk, x86, x64) and do some post
>processing (create cat files, sign, etc.).
>
>I was hoping to take adv
Hi Dave,
I forgot to provide the information about the code how I am using logger
Here is the complete scenario
I have modified the code as mentioned in reply and is working fine. But
still I am facing an issue and the issue is described below.
In configuration file i have coded the TimedRotatin
Hi Dave,
I have modified the code as mentioned in reply and is working fine. But
still i am facing an issue and the issue is described below.
In configuration file i have coded the TimedRotatingFileHandler like
args=("G:\\lok_sib\\logs\\rotate_test", 'D', 1)
step1: Executed the code and got the
Since you're talking about documentation, which is a part of python,
don't you think you should be discussing it on python-dev ?
That's where discussions about the documentation should be held.
haha - I'm just curious to see how long it will for them to
shut the discussion down.
Before you do
Hi,
what is the best way to reload the module imported using 'from ...
import ...'
Is following a way to do so?
>>> from email.charset import Charset
>>> reload(email.charset)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'email' is not defined
>>>
>>>
>>> import
The prob with python docs is with the python priests.
there are frequent posts about python doc's poor quality, and some
efforts to improve the doc (such as wiki or seggestions), about few
times a year (in so much as i've seen), the typical response is
pissing fight, with python priests to tell th
On Aug 9, 3:26 pm, Lee Harr wrote:
> pybotwar is a fun and educational game where players
> create computer programs to control simulated robots
> to compete in a battle arena.
>
> http://pybotwar.googlecode.com/
Why is the doc folder empty?
Shouldn't you supply some hint on how the games works
On Aug 9, 8:06 pm, Steven D'Aprano wrote:
> while the behaviour your
> friend wants is "treat a backslash as an error, except for these
> exceptions".
Besides, can't all error situations be described as, "treat the error
situation as an error, except for the exception of when the situation
isn't
On Aug 9, 5:06 pm, Steven D'Aprano wrote:
> On Sun, 09 Aug 2009 12:26:54 -0700, Douglas Alan wrote:
> > A friend of mine is just learning Python, and he's a bit tweaked about
> > how unrecognized escape sequences are treated in Python.
> ...
> > In any case, I think my friend should mellow out a b
Steven D'Aprano wrote:
> Why should a backslash in a string literal be an error?
Because in Python, if my friend sees the string "foo\xbar\n", he has
no idea whether the "\x" is an escape sequence, or if it is just the
characters "\x", unless he looks it up in the manual, or tries it out
in the R
On Aug 9, 1:02 pm, Nikolaus Rath wrote:
> Hi,
>
> I want to monkeypatch an object so that it becomes callable, although
> originally it is not meant to be. (Yes, I think I do have a good reason
> to do so).
>
> But simply adding a __call__ attribute to the object apparently isn't
> enough, and I d
On Sun, 09 Aug 2009 12:26:54 -0700, Douglas Alan wrote:
> A friend of mine is just learning Python, and he's a bit tweaked about
> how unrecognized escape sequences are treated in Python.
...
> In any case, I think my friend should mellow out a bit, but we both
> consider this something of a wart.
Jan Kaliszewski wrote:
09-08-2009 o 23:43:14 r wrote:
#-- el bueno --#
"hello i am a very long string that\
does not like newlines so please \
escape me, Thank you!"
You probably ment: """hello i am... [etc.]
Anyway... You're right that generally it's good idea to define
dialog prompts and
MalC0de wrote:
hello there, I've a question :
I want to know does python have any capability for using Ring0 and
kernel functions for driver and device development stuff .
if there's such a feature it is very good, and if there something for
this kind that you know please refer me to some referen
Johannes Janssen wrote:
> class A(object):
> def __init__(self, mod=__name__):
> self.mod = mod
won't work. In this case mod would always be "foo".
You have to inspect the stack in order to get the module of the caller.
The implementation of warnings.warn() gives you some
09-08-2009 o 23:43:14 r wrote:
#-- el bueno --#
"hello i am a very long string that\
does not like newlines so please \
escape me, Thank you!"
You probably ment: """hello i am... [etc.]
Anyway... You're right that generally it's good idea to define
dialog prompts and such stuff separately ra
On Sun, Aug 9, 2009 at 4:21 PM, Victor Subervi wrote:
> Hi:
> I get a ton of warnings like this from a program I run:
>
> Warning (from warnings module):
> File "C:\Python25\read.py", line 67
> cursor.execute(sqlKWDrop)
> Warning: Unknown table 'judaism_128'
>
> How do I surpress them?
impor
On Aug 9, 12:02 pm, Nikolaus Rath wrote:
> Hi,
>
> I want to monkeypatch an object so that it becomes callable, although
> originally it is not meant to be. (Yes, I think I do have a good reason
> to do so).
>
> But simply adding a __call__ attribute to the object apparently isn't
> enough, and I
On Aug 9, 8:25 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
>
>
>
> > On Aug 9, 4:42 pm, "Diez B. Roggisch" wrote:
> >> gert schrieb:
>
> >>> On Aug 9, 3:17 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
> > I working on a resume upload script and encountered the following
> > probl
Hi
I like to know in which module an instance of a class was initialized.
Using __module__ or __name__ within a class only gives me the module in
which the class was defined not the instance of the class. Is there some
(simple) way to do this?
For better understanding I'll give an example how I
#-- el bueno --#
"hello i am a very long string that\
does not like newlines so please \
escape me, Thank you!"
#-- el malo --#
"hello i am a very long string that"+
"does not like newlines but i have no"+
"idea what to do with myself"
#-- el feo --#
"hello i am a very long string that"
"does no
Lokesh wrote:
Hi,
Need help in configure the TimedRotatingFileHandler from configuration
file
I have tried with the below code and ended up with the error, code is
pasted below
Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
\logs\rotate_test'
[loggers]
keys=root,simpleExamp
On Aug 7, 4:53 pm, kj wrote:
> Suppose that x is some list. To produce a version of the list with
> duplicate elements removed one could, I suppose, do this:
>
> x = list(set(x))
>
> but I expect that this will not preserve the original order of
> elements.
>
> I suppose that I could write so
On Aug 9, 12:10 pm, "Jan Kaliszewski" wrote:
..(snip)
> Sorry, you are wrong, '''-way would be usefull only if:
>
> * you want to have '\n' in each place where you wrap the
> literal in your code,
>
> and
>
> * you use '''-literal at a module (non-indented) level
>
> or you
Nikolaus Rath schrieb:
Hi,
I want to monkeypatch an object so that it becomes callable, although
originally it is not meant to be. (Yes, I think I do have a good reason
to do so).
But simply adding a __call__ attribute to the object apparently isn't
enough, and I do not want to touch the class
pybotwar is a fun and educational game where players
create computer programs to control simulated robots
to compete in a battle arena.
http://pybotwar.googlecode.com/
pybotwar uses pybox2d for the physical simulation,
and uses pygame and pygsear for the visualization.
pybotwar is released und
Hi:
I get a ton of warnings like this from a program I run:
Warning (from warnings module):
File "C:\Python25\read.py", line 67
cursor.execute(sqlKWDrop)
Warning: Unknown table 'judaism_128'
How do I surpress them?
TIA,
Victor
--
http://mail.python.org/mailman/listinfo/python-list
> Fencer (F) wrote:
>F> Also, notice the code I've commented out. If I can get the join above to
>F> work (with your help) my next question is how to present the known experts
>F> in a comma separated list with only expert_id and name? I can't use the
>F> normal __str__() method (the one I'm
A friend of mine is just learning Python, and he's a bit tweaked about
how unrecognized escape sequences are treated in Python. This is from
the Python 3.0 reference manual:
Unlike Standard C, all unrecognized escape sequences are left in
the string unchanged, i.e.,
the backslash is left
Hi,
I want to monkeypatch an object so that it becomes callable, although
originally it is not meant to be. (Yes, I think I do have a good reason
to do so).
But simply adding a __call__ attribute to the object apparently isn't
enough, and I do not want to touch the class object (since it would
mo
MRAB wrote:
Try printing self.topics. It should always be a list of topics.
Ah, yes, that made me find a bug when I was creating the Expert objects:
the lists of known topics were not created properly. I should have
posted more code I suppose! Thanks for the help, this problem has now
been s
gert schrieb:
On Aug 9, 4:42 pm, "Diez B. Roggisch" wrote:
gert schrieb:
On Aug 9, 3:17 pm, "Diez B. Roggisch" wrote:
gert schrieb:
I working on a resume upload script and encountered the following
problems
sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
'\ufffd\ufff
Fencer wrote:
jon rascal wrote:
You're turning your list into a string -- try this:
', '.join([str(x) for x in self.topics])
Thanks for your quick reply, unfortunately it didn't quite work for me.
Say topics contain two topics: polemics, and the parthenon I get this
output:
e2:Carla
Known t
>
> only the first topic is printed. If topics only contain a single topic I
> get this error:
> Traceback (most recent call last):
> File "C:\Users\fencer\workspace\Find Expert\src\find_expert.py", line 57,
> in
>print experts[1]
> File "C:\Users\fencer\workspace\Find Expert\src\find_expert
On Aug 9, 4:42 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
>
>
>
> > On Aug 9, 3:17 pm, "Diez B. Roggisch" wrote:
> >> gert schrieb:
>
> >>> I working on a resume upload script and encountered the following
> >>> problems
> >>> sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
jon rascal wrote:
You're turning your list into a string -- try this:
', '.join([str(x) for x in self.topics])
Thanks for your quick reply, unfortunately it didn't quite work for me.
Say topics contain two topics: polemics, and the parthenon I get this
output:
e2:Carla
Known topics: t5:Polem
output += '\nKnown topics: %s' % (', '.join(str(self.topics)))
Your problem is here.
self.topics is a list of topic instances: but you're calling str() on the
list itself to turn the LIST itself into a string. Compare:
>>> x = [1,2,3]
>>> x
[1, 2, 3]
>>> str(x)
'[1, 2, 3]'
Now, after str(se
> def __str__(self):
> output = '%s:%s' % (self.expert_id, self.name)
> output += '\nKnown topics: %s' % (', '.join(str(self.topics)))
You're turning your list into a string -- try this:
', '.join([str(x) for x in self.topics])
--
http://mail.python.org/mailman/listinfo/python-list
Hello, I've written two classes. One class describes experts: experts
has a unique ID and a name. An expert knows topics and other experts. A
topic is described by my other class and includes a unique ID and a
name. Now I have a problem with the __str__ method in my Expert class:
def __str__(s
09-08-2009 r wrote:
On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote:
08-08-2009 Steven D'Aprano wrote:
...(snip)
I use it very often, e.g.:
afunction('quite long string %s quite long string '
'quite long string quite long string %s '
'quite %s lo
r wrote:
> On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote:
>> (Note that multiline-'''-strings are usless in such cases).
>>
>
> uhh? A much better way to handle such a problem is like this...
>
> prompt1 = '''
> Some people like to use %s
> ways of doing things just
> so they can support their %
nipun batra wrote:
I will be receiving data serially from another pc,.i can use any sort of
marker between two packets,i will be the person sending data as well after
reading it from some devices.But packet length is not constant.
each packet has this format:
201.535a56.65b4.56c89.565d
another pa
Hello list,
I've written a small Client/server system.
Basically, i'm expecting something like : The client sends every once
and a while a small data chunk (not more than 50 bytes) the server
receive it and print it.
Here is the server request handler :
class ThreadedTCPRequestHandlerFoo(SocketS
On 03:35 pm, koranth...@gmail.com wrote:
Hi,
I am writing a HTTP client in Twisted. The client contacts the
server, and any errors in the sent messages will be returned back to
the client in 400 message. The reason for failure at the server is
sent as the text in the 400 message. I tried the sa
On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote:
> 08-08-2009 Steven D'Aprano wrote:
...(snip)
> I use it very often, e.g.:
>
> afunction('quite long string %s quite long string '
> 'quite long string quite long string %s '
> 'quite %s long string quite
Hi,
I am writing a HTTP client in Twisted. The client contacts the
server, and any errors in the sent messages will be returned back to
the client in 400 message. The reason for failure at the server is
sent as the text in the 400 message. I tried the same using the
browser, and I can see the er
09-08-2009 Lokesh wrote:
I have tried with the below code and ended up with the error, code is
pasted below
Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
\logs\rotate_test'
Note that: '\r' is listed (interpreted by Python as 'carriage return'
special character) and not '
On Sun, Aug 9, 2009 at 5:13 PM, Lokesh wrote:
> Hi,
>
> Need help in configure the TimedRotatingFileHandler from configuration
> file
>
> I have tried with the below code and ended up with the error, code is
> pasted below
> Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
> \log
gert schrieb:
On Aug 9, 3:17 pm, "Diez B. Roggisch" wrote:
gert schrieb:
I working on a resume upload script and encountered the following
problems
sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
'\ufffd\ufff
d\ufffd\ufffd↑!ExifEf1gL6KM7Ij5ae0gL6KM7cH2cH2GI3
Co
On Sun, 09 Aug 2009 06:13:38 -0700, samwyse wrote:
> Here's what I have so far:
>
> import urllib
>
> class AppURLopener(urllib.FancyURLopener):
> version = "App/1.7"
> referrer = None
> def __init__(self, *args):
> urllib.FancyURLopener.__init__(self, *args)
> if sel
On Aug 9, 3:17 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
>
> > I working on a resume upload script and encountered the following
> > problems
>
> > sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
> > '\ufffd\ufff
> > d\ufffd\ufffd↑!ExifEf1gL6KM7Ij5ae0gL6KM7cH2cH
gert schrieb:
I working on a resume upload script and encountered the following
problems
sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
'\ufffd\ufff
d\ufffd\ufffd↑!ExifEf1gL6KM7Ij5ae0gL6KM7cH2cH2GI3
Content-Disposition: form-data; name="Filename"
You are treati
Here's what I have so far:
import urllib
class AppURLopener(urllib.FancyURLopener):
version = "App/1.7"
referrer = None
def __init__(self, *args):
urllib.FancyURLopener.__init__(self, *args)
if self.referrer:
addheader('Referer', self.referrer)
urllib._url
On Sunday 09 August 2009 03:20:12 nipun batra wrote:
> On Sun, Aug 9, 2009 at 2:11 AM, Chris Rebert wrote:
> > On Sat, Aug 8, 2009 at 12:34 PM, nipun batra
> >
> > wrote:
> > > Hi,
> > > How can we access serial port using usb-serial converters,using python
> > > in linux.
> >
> > PySerial might a
Emanuele D'Arrigo schrieb:
Greetings everybody,
I don't quite understand why if I do this:
d = {}
exec("dir()", d)
1) d is no longer empty
2) the content of d now looks like __builtins__.__dict__ but isn't
quite it d == __builtins__.__dict__ returns false.
Can anybody shed some light?
RTF
Emanuele D'Arrigo wrote:
> Greetings everybody,
>
> I don't quite understand why if I do this:
>
d = {}
exec("dir()", d)
>
> 1) d is no longer empty
> 2) the content of d now looks like __builtins__.__dict__ but isn't
> quite it d == __builtins__.__dict__ returns false.
>
> Can anybo
Greetings everybody,
I don't quite understand why if I do this:
>>> d = {}
>>> exec("dir()", d)
1) d is no longer empty
2) the content of d now looks like __builtins__.__dict__ but isn't
quite it d == __builtins__.__dict__ returns false.
Can anybody shed some light?
Manu
--
http://mail.python
I working on a resume upload script and encountered the following
problems
sql: Could not decode to UTF-8 column 'SUBSTR(picture,?)' with text
'\ufffd\ufff
d\ufffd\ufffd↑!ExifEf1gL6KM7Ij5ae0gL6KM7cH2cH2GI3
Content-Disposition: form-data; name="Filename"
DSC00013.JPG
Ef1
w
Hi,
Need help in configure the TimedRotatingFileHandler from configuration
file
I have tried with the below code and ended up with the error, code is
pasted below
Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
\logs\rotate_test'
[loggers]
keys=root,simpleExample
[handlers]
k
I will be receiving data serially from another pc,.i can use any sort of
marker between two packets,i will be the person sending data as well after
reading it from some devices.But packet length is not constant.
each packet has this format:
201.535a56.65b4.56c89.565d
another packet could be :
4a5b6
m...@pixar.com wrote:
> How can I watch the messages being sent back and for on urllib shttp
> requests? If it were simple http I would just watch the socket traffic
> but of course that won't work for https. Is there a debug flag I can
> set that will do this?
>
> context: I am dealing with a
On Sat, 08 Aug 2009 19:00:11 +0200, Thorsten Kampe wrote:
>> I was running it one million times to mitigate influences on the timing
>> by other background processes which is a common technique when
>> benchmarking.
>
> Err, no. That is what "repeat" is for and it defaults to 3 ("This means
> tha
How can I watch the messages being sent back and for on urllib shttp
requests? If it were simple http I would just watch the socket traffic
but of course that won't work for https. Is there a debug flag I can
set that will do this?
context: I am dealing with a web service bug and I want to tell
On Sat, 08 Aug 2009 20:27:49 +0100, Mark Lawrence wrote:
> Further, I have seen many requests here which are nothing really to do
> with Python, say a query about which algorithm to use. Response "Not
> really a Python question, but try ...". Put the same question on (say)
> the C ng and you'd b
On Sat, 08 Aug 2009 12:11:19 +, kj wrote:
> In Chris Rebert
> writes:
>
>>The double-underscores indicate that the Python interpreter itself
>>usually is the caller of the method, and as such some level of "magic"
>>may be associated with it. Other languages have you do the equivalent of
>>
-On [20090808 20:07], Thorsten Kampe (thors...@thorstenkampe.de) wrote:
>In real life people won't even notice whether an application takes one or
>two minutes to complete.
I think you are quite wrong here.
I have worked with optical engineers who needed to calculate grating numbers
for their len
On Aug 8, 9:08 pm, Brian Allen Vanderburg II
wrote:
> I've coded my own 'relpath' implementation for 2.5 (shown below) and I
> want to make sure it follows as closely as it should to 2.6 and later.
> I've got a question regarding that. When attempting to convert to a
> relative path and it is n
77 matches
Mail list logo