? I'm not a
friend of things so deep in the system...
Greetings
Ulrich
--
Ulrich Goebel
--
https://mail.python.org/mailman/listinfo/python-list
unctions to different
instances of MyClass. It is in the context of a database app where I build
Getters for database data and pass one Getter per instance.
Thanks for hints
Ulrich
--
Ulrich Goebel
--
https://mail.python.org/mailman/listinfo/python-list
użytkownik Ulrich Goebel napisał:
13. Januar 1965
13. January 1965
13.01.1965
1965-01-13
02.03.2000
Is it Mar, 2nd 2000 or Feb, 3rd 2000?
--
Ulrich Goebel
Am Büchel 57, 53173 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
That's absolutely great, thank You!
Am 17.12.19 um 11:53 schrieb Jon Ribbens via Python-list:
On 2019-12-17, Ulrich Goebel wrote:
I need to interpret a date string to get a datetime object. That should
be done with strptime from the module datetime.
But I don't know enough about
e possible languages.)
Best regards
Ulrich
--
Ulrich Goebel
Am Büchel 57, 53173 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
Sorry for the wrong spelling. In fact
subprocess.call('./Test.py')
works.
The raising error was my error too, using ['./', 'Test.py'] instead of
'./Test.py'
Sorry...
Am 28.11.19 um 11:05 schrieb Ulrich Goebel:
Hi,
I have to call commands fro
session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
Using
subprocess.call(['./', 'Test.py'], shell=True)
I get
Test.py: 1: Test.py: ./: Permission d
read the outputfile into the string l
return (l)
What would be nice:
I would like to avoid the extra steps writing an reading extern files.
Can anybody help me?
Thanks
Ulrich
--
Ulrich Goebel
Am Büchel 57, 53173 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
herauszufinden, suche ich eine Funktion zeige_escape(string), die
mir liefert:
s = 'Hallo\nNeue Zeile'
zeige_escape(s)
Hallo\nNeue Zeile
print hilft nicht, denn
print(s)
Hallo
Neue Zeile
Hat jemand eine Idee?
Dank und Gruß
Ulrich
--
Ulrich Goebel
Am Büchel 57, 53173 Bon
Many thanks for the moment. I will try reportlab the next days.
Am 09.03.2014 22:29, schrieb Ulrich Goebel:
Hallo,
has anybody an idea how to make small formated documents redy to print
with python?
I would like to print address labels as
firstname lastname
street and number
cip
pagesize (labelsize) and a minimum format
(boldface). But may be there is another light-weight-format besides PDF?
Any idea?
Ulrich
--
Ulrich Goebel
Paracelsusstr. 120, 53177 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
e byte 0xc3 in position 6:
ordinal not in range(128)
The "position 6" is exactly the position of the special character, ß in
this case.
What to do?
Ulrich
--
Ulrich Goebel
Paracelsusstr. 120, 53177 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
Hi
Am 31.10.2013 23:35, schrieb Terry Reedy:
On 10/31/2013 5:29 PM, Ulrich Goebel wrote:
I'm locking for an "iterator" type with not only the .next() method, but
with a .previous(), .first() and .last() method, so that I can through
it from the beginning or from the e
ward, two steps
forward).
Any help will be wellcome!
Ulrich
--
Ulrich Goebel
Paracelsusstr. 120, 53177 Bonn
--
https://mail.python.org/mailman/listinfo/python-list
idecode does - and what it doesn't.
There is also a rather long-ish recent topic on a similar topic that
might be worth scanning as well.
Sorry, I didn't find that.
I've no direct/recent experience with this topic. I'm just an
interested bystander.
But even a helpful bys
return r
def compare (a, b):
aa = normal(a)
bb = normal(b)
if aa < bb:
return -1
elif aa == bb:
return 0
else:
return 1
That works, but my be there is a more intelligent way? Especially there
could be much more r.replace to handle all the accents as ^ ° ´ ` and so on.
Am 28.08.2013 13:55, schrieb Ferrous Cranus:
Τη Τετάρτη, 28 Αυγούστου 2013 2:32:44 μ.μ. UTC+3, ο χρήστης Dave Angel έγραψε:
You really have no directory in which you have write permissions? If
so, perhaps you'd better solve that first.
of cours ei ahve write permissions. Here:
ni...@superh
Am 23.08.2013 05:28, schrieb Steven D'Aprano:
On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote:
When the Python object goes away, it doesn't necessarily affect
thethread or file it represents.
>
That's certainly not true with file objects. When the file object goes
Am 21.08.2013 20:58, schrieb Johannes Bauer:
On 21.08.2013 11:11, Ulrich Eckhardt wrote:
That said, there is never a need for deriving
from the Thread class, you can also use it to run a function without
that. That way is IMHO clearer because the threading.Thread instance is
not the thread
Am 21.08.2013 08:50, schrieb chandan kumar:
class Test(threading.Thread):
def StartThread(self):
Lock = threading.Lock()
self.start()
Inconsistently indented code, this is a killer for Python. Please read
PEP8 and use four spaces! That said, there is never a need for de
Am 05.08.2013 21:38, schrieb Olive:
I have found telnetlib which make very easy to interact with a telnet
server, especially the read_until command. I wonder if something
similar exits for other things that a telnet server.
It's not Python and I haven't played with it extensively, but there is
Am 02.08.2013 15:17, schrieb matt.doolittl...@gmail.com:
so you are saying that
self.logfile.write('%s\t'%(str(time(
should be:
self.logfile.write('%s\t'%(str(time.time(
No, I'm not saying that. What I wanted to make clear is that your code
is impossible to understand as it
Am 02.08.2013 12:54, schrieb matt.doolittl...@gmail.com:
I am using 2.7 on Ubuntu 12.10. All I need to do is to print time with the
microseconds.[...]
# write date and time and microseocnds
self.logfile.write('%s\t'%(str(strftime("%Y-%m-%d",
self.logfile.write(
Am 01.08.2013 18:02, schrieb cool1...@gmail.com:
I know I should be testing out the script myself but I did, I tried
and since I am new in python and I work for a security firm that ask
me to scan hundreds of documents a day for unsafe links (by opening
them) I thought writing a script will be mu
Am 30.07.2013 16:49, schrieb cool1...@gmail.com:
Hello, I am looking for a script that will be able to search an
online document (by giving the script the URL) and find all the
downloadable links in the document and then download them
automatically.
Well, that's actually pretty simple. Using th
Am 30.07.2013 01:34, schrieb Devyn Collier Johnson:
Typing "101 & 010" or "x = (int(101, 2) & int(010, 2))" only gives errors.
What errors? Check out Eric Raymond's essay on asking smart questions,
it's a real eye-opener! ;)
That said, use "0b" as prefix for binary number literals (0b1000 is
Am 11.07.2013 16:11, schrieb Peter Otten:
Ulrich Eckhardt wrote:
Bug or feature?
No bug. Missing feature if you come up with a convincing use-case.
class Parser:
def _handle_bool(input):
# ...
pass
types = {'bool': _handle_bool,
'boolean
Hello!
I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
fail to detect that an object is a function, using the callable()
builtin function. Investigating, I found out that the object was indeed
not callable, but in a way that was very unexpected to me:
class X:
Welcome to Python!
Am 11.07.2013 11:09, schrieb fronag...@gmail.com:
I'm looking to write a program in Python, (and have in fact written
most of it by now,) and am trying to put together a GUI for it. Kivy
looks very nice, particularly with the fact that it's supposed to be
compatible with most
Am 09.07.2013 11:39, schrieb loial:
I have a socket application that is connecting to a HP printer via port 9100.
Occassionally I get a "Connection reset by peer" error which I am
trapping and exiting the script with an error message.
Strange. Why does the remote terminate the connection?
T
Am 04.07.2013 12:38, schrieb Νίκος:
Στις 4/7/2013 12:50 μμ, ο/η Ulrich Eckhardt έγραψε:
Am 04.07.2013 10:37, schrieb Νίκος:
Why cant it decode the starting byte? what starting byte is that?
It's the 0xb6 but it's expecting the starting byte of a UTF-8 sequence.
Please do some resea
Am 04.07.2013 10:37, schrieb Νίκος:
I just started to have this error without changing nothing
Well, undo the nothing that you didn't change. ;)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0:
invalid start byte
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97
Am 18.06.2013 12:24, schrieb Aditya Avinash:
Hi. This is the last place where I want to ask a question.
You are probably not saying what you mean here. The meaning of your
sentence is more like "Here is the forum that I dislike more than any
other forum, but still I have to ask a question her
Am 12.06.2013 13:23, schrieb Νικόλαος Κούρας:
So, how many bytes does UTF-8 stored for codepoints > 127 ?
What has your research turned up? I personally consider it lazy and
respectless to get lots of pointers that you could use for further
research and ask for more info before you even follo
Am 11.06.2013 12:38, schrieb Νικόλαος Κούρας:
File "/home/nikos/public_html/cgi-bin/metrites.py", line 28, in ,
referer: http://xxxredactedxxx/
page = page.replace( '/home/nikos/public_html/', '' ), referer:
http://xxxredactedxxx/
AttributeError: 'list' object has no attribute 'replace', ref
Am 10.06.2013 15:37, schrieb Νικόλαος Κούρας:
Τη Δευτέρα, 10 Ιουνίου 2013 4:14:33 μ.μ. UTC+3, ο χρήστης Ulrich Eckhardt
έγραψε:
Am 10.06.2013 12:57, schrieb Νικόλαος Κούρας:
Τη Δευτέρα, 10 Ιουνίου 2013 12:40:01 μ.μ. UTC+3, ο χρήστης Ulrich
Eckhardt έγραψε:
for key in sorted
Am 10.06.2013 11:48, schrieb Νικόλαος Κούρας:
After many tried this did the job:
for key in sorted(months.items(),key=lambda num : num[1]):
print('''
%s
''' % (key[1], key[0]) )
This code is still sending a misleading message. What you are referring
to as "ke
Am 10.06.2013 12:57, schrieb Νικόλαος Κούρας:
>Τη Δευτέρα, 10 Ιουνίου 2013 12:40:01 μ.μ. UTC+3, ο χρήστης Ulrich
Eckhardt έγραψε:
for key in sorted( months.keys() ):
print('''
%s
''' % (months[key], key) )
this in fact wor
Am 10.06.2013 10:04, schrieb Νικόλαος Κούρας:
months = { 'Ιανουάριος':1, 'Φεβρουάριος':2, 'Μάρτιος':3, 'Απρίλιος':4,
'Μάϊος':5, 'Ιούνιος':6, \
'Ιούλιος':7, 'Αύγουστος':8, 'Σεπτέμβριος':9, 'Οκτώβριος':10,
'Νοέμβριος':11, 'Δεκέμβριος':12 }
for key in sorted( months.keys() ):
=
Am 10.06.2013 10:29, schrieb Νικόλαος Κούρας:
for key in sorted( months.values() ):
^^^ ^^
KeyError 1 ??!! All i did was to tell python to sort the dictionary values,
which are just integers.
...and which you then proceed to use as key, which is obviously wrong.
Am 26.05.2013 21:10, schrieb Daniel Gagliardi:
I want to know how to implement concurrent threads in Python
Have you tried searching the web or maybe looked on docs.python.org?
Seriously, show at least some effort before asking here.
Uli
--
http://mail.python.org/mailman/listinfo/python-lis
Am 22.05.2013 17:32, schrieb Charles Smith:
I'd like to subclass from unittest.TestCase. I observed something
interesting and wonder if anyone can explain what's going on... some
subclasses create null tests.
I can perhaps guess what's going on, though Terry is right: Your
question isn't ver
Am 16.05.2013 02:00, schrieb alex23:
My favourite is this one:
http://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python
Not only is this blog entry an interesting piece of art, there's other
interesting things to read there, too.
Thanks!
Uli
--
http://mail.python.org/m
Am 23.04.2013 10:26, schrieb Chris “Kwpolska” Warrick:
On Tue, Apr 23, 2013 at 9:46 AM, Ulrich Eckhardt
wrote:
Am 23.04.2013 06:00, schrieb Steven D'Aprano:
If it comes down to micro-optimizations to shave a few microseconds off,
consider using string % formatting rather than the f
Am 23.04.2013 09:13, schrieb inshu chauhan:
This statement is giving me the following error
Statement:
for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(),
pixel_count.iterkeys())):
Error:
Traceback (most recent call last):
File "C:\Users\inshu\Desktop\Training_segs_trial2.
Am 23.04.2013 06:00, schrieb Steven D'Aprano:
If it comes down to micro-optimizations to shave a few microseconds off,
consider using string % formatting rather than the format method.
Why? I don't see any obvious difference between the two...
Greetings!
Uli
--
http://mail.python.org/mailma
Am 11.04.2013 10:19, schrieb Steven D'Aprano:
if sys.version >= '3':
Use sys.version_info >= (3,), otherwise your code breaks when upgrading
to Python 10 and greater. ;^)
The second question that came up was if there is a way to keep a
metaclass defined inside the class or if the only way
Am 10.04.2013 11:52, schrieb Peter Otten:
It looks like this particular invocation relies on class attribute and
function __name__ being identical.
Please file a bug report.
http://bugs.python.org/issue17696
Uli
--
http://mail.python.org/mailman/listinfo/python-list
Am 10.04.2013 11:52, schrieb Peter Otten:
Ulrich Eckhardt wrote:
[...]
It looks like this particular invocation relies on class attribute and
function __name__ being identical.
Please file a bug report.
Thanks for confirming this and reducing the test case even more.
Now, concerning
Hi!
I'm having problems using a metaclass to generate test functions. This
works when I try to run all tests from the module or test case, but it
fails when I'm trying to specify a single test function. My environment
is Python 2.7.3 on MS Windows 7 at the moment. It should be upgraded to
at
Am 27.03.2013 06:44, schrieb Eric Parry:
I downloaded the following program from somewhere using a link from
Wikipedia and inserted the “most difficult Sudoku puzzle ever” string
into it and ran it. It worked fine and solved the puzzle in about 4
seconds. However I cannot understand how it works.
Am 01.03.2013 17:28, schrieb Isaac Won:
What I really want to get from this code is m1 as I told. For this
purpose, for instance, values of fpsd upto second loop and that from
third loop should be same, but they are not. Actually it is my main
question.
You are not helping yourself...
In any
Am 01.03.2013 09:59, schrieb Isaac Won:
try to make my triple nested loop working. My code would be:
c = 4
[...]
while c <24:
c = c + 1
This is bad style and you shouldn't do that in python. The question that
comes up for me is whether something else is modifying "c" in that loop,
Am 15.02.2013 08:51, schrieb Rick Johnson:
"How could a line in the "try" block ever be considered offensive?"
My suggestion of "offensive" does not imply ignorance on /my/ part[...]
Well, it seems to imply that you are not aware of the subtle difference
between "offending" and "offensive".
Am 13.02.2013 um 17:14 schrieb Rick Johnson:
Q1: How could a line in the "try" block ever be considered
offensive? Because it throws an error?
try:
rrick.go_and_fuck_yourself()
finally:
rrick.get_lost()
See, wasn't that difficult, was it? :D
Are you serious?
No, I just coul
Am 08.02.2013 14:03, schrieb gmspro:
One said, Python is not programming language, rather scripting language, is
that true?
That depends on your definition of scripting language and programming
language.
Python's not a language but an animal.
Uli
--
http://mail.python.org/mailman/listinfo
Am 08.02.2013 07:29, schrieb Chris Angelico:
On Fri, Feb 8, 2013 at 3:32 PM, iMath wrote:
which situations should we use thread. join() ?
http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/
why do we not put thread. join() in this code ?
I've no idea why you don't put thread.join() in that code. M
Heureka!
Am 06.02.2013 15:37, schrieb Dave Angel:
> def myfunc2(i):
def myfunc2b():
print ("myfunc2 is using", i)
return myfunc2b
Earlier you wrote:
There is only one instance of i, so it's not clear what you expect.
Since it's not an argument to test(), it has to be found
Dave and Terry,
Thanks you both for your explanations! I really appreciate the time you
took.
Am 05.02.2013 19:07, schrieb Dave Angel:
If you need to have separate function objects that already know a
value for i, you need to somehow bind the value into the function object.
One way to do it,
Hello Pythonistas!
Below you will find example code distilled from a set of unit tests,
usable with Python 2 or 3. I'm using a loop over a list of parameters to
generate tests with different permutations of parameters. Instead of
calling util() with values 0-4 as I would expect, each call uses
Am 05.02.2013 11:35, schrieb Peter Otten:
Ulrich Eckhardt wrote:
[...] use os.path.walk(), because that doesn't first build a list and
then iterate over the list but iterates over the single elements directly.
[...]
Not true. os.walk() uses os.listdir() internally.
Oh. 8|
Thank
Am 05.02.2013 01:09, schrieb Jabba Laci:
I like the context manager idea
There is a helper library for constructing context managers, see
http://docs.python.org/2/library/contextlib.html. That would have made
your code even shorter.
setting the sys.stdout back to the original value doesn
Am 05.02.2013 05:14, schrieb Anthony Correia:
I need to pick up a language that would cover the Linux platform. I use
Powershell for a scripting language on the Windows side of things. Very simple
copy files script. Is this the best way to do it?
import os
objdir = ("C:\\temp2")
Dro
Am 04.02.2013 18:12, schrieb Jabba Laci:
autoflush_on = False
def unbuffered():
"""Switch autoflush on."""
global autoflush_on
# reopen stdout file descriptor with write mode
# and 0 as the buffer size (unbuffered)
if not autoflush_on:
sys.stdout = os.fdopen(sys
Am 24.01.2013 18:06, schrieb tamn...@gmail.com:
Any suggestions for study?..: Is is possible to take a large
executable with GUI and real time data and images, to extract
modules, and it can run as if it looks like a monolithic application
(windows over main windows, or images over other images)
Am 23.01.2013 05:06, schrieb Isaac Won:
I have tried to use different interpolation methods with Scipy. My
code seems just fine with linear interpolation, but shows memory
error with quadratic. I am a novice for python. I will appreciate any
help.
>
#code
f = open(filin, "r")
Check out the "w
Am 21.01.2013 17:06, schrieb kwakukwat...@gmail.com:
please I need some explanation on sys.stdin and sys.stdout, and piping out
http://www.catb.org/esr/faqs/smart-questions.html
Uli
--
http://mail.python.org/mailman/listinfo/python-list
Am 15.01.2013 10:46, schrieb Levi Nie:
i want to interrupt the file sending. but i can't change the client. so i
need change the server.
All things go well, but the message i wanna response seem not work.
Ahem, what? It doesn't work, so does it sit on the couch all day?
is the self.transport
Am 14.01.2013 21:29, schrieb Paul Pittlerson:
map_textures = get_sprites( (48, 48) ,"spritesheet.png" , (0, 0) )
You forgot to include spritesheet.png in your message. Seriously,
condense your code down to a minimal example. This might help you
finding the problem yourself, otherwise
Am 09.01.2013 22:05, schrieb kwakukwat...@gmail.com:
pls I want to write a function that can compute for the sqrt root of
any number.bt it not working pls help.
Whenever describing an error, be precise. In this particular case, we
have some sourcecode (which is good!) but what is still missin
Am 13.12.2012 08:40, schrieb deep...@poczta.fm:
I have problem with using function from dll.
import ctypes
b = ctypes.windll.LoadLibrary("kernel32")
a = ""
b.GetComputerNameA(a,20)
GetComputerNameA takes a pointer to a writable char string. You give it
a pointer to an immutable string. You
Am 12.12.2012 16:00, schrieb inshu chauhan:
color = image[y,x]
if color == (0.0,0.0,0.0):
continue
else :
if color == (0.0,255.0,0.0):
classification = 1
elif color == (128.0, 0.0, 255.0):
classifi
Am 30.11.2012 12:11, schrieb andrea crotti:
I wrote a script, refactored it and then introducing a bug as below:
def record_things():
out.write("Hello world")
This is a function. Since "out" is not a local variable, it is looked up
in the surrounding namespace at the time the function is
Am 28.11.2012 07:43, schrieb Prakash:
copying C:\Python24\lib\site-packages\py2exe\run_w.exe
Python 2.4 was released 8 years ago and shouldn't be used for new
development or learning any longer. The first step I would take is to
upgrade to 2.7, which is the last in the 2
Am 21.11.2012 02:43, schrieb Steven D'Aprano:
On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote:
The source of bugs is not excessive complexity in a method, just
excessive lines of code.
Taken literally, that cannot possibly the case.
def method(self, a, b, c):
do_this(a)
do_tha
Am 18.11.2012 12:45, schrieb Chris Angelico:
(if you'll forgive the pun)
Nevarr!
Is IDLE named after Eric of that name, or is it pure coincidence?
Maybe. Interestingly, there is also
http://eric-ide.python-projects.org/, just to add some more unfounded
conspiracy theories to this discuss
Am 16.11.2012 13:06, schrieb chip9munk:
I would like to use conf file to get all the variables in my code. And
it works great. I use the following (simple example):
execfile("example.conf", config)
print config["value1"]
and it works like a charm.
This works, but in general importing con
Am 15.11.2012 13:29, schrieb chip9m...@gmail.com:
I have a python module, lets call it debugTest.py.
and it contains:
def test():
a=1
b=2
c=a+b
c
so as simple as possible.
Should that be "return c" instead of "c" on a line?
Now I would like to debug it in eclipse.. (I h
Am 14.11.2012 10:51, schrieb Kiran N Mallekoppa:
1. Is this information available somewhere?
2. I was pointed to PEP-11, which documents the platforms that are not
supported. So, can we take that all active versions of Python (2.7.3 and
3.3, i believe) are supported on all the OS flavors that Pyt
Am 09.11.2012 12:37, schrieb Steven D'Aprano:
In Python 3.3:
py> class X(int):
... def __init__(self, *args):
... super().__init__(*args) # does nothing, call it anyway
...
py> x = X(22)
Traceback (most recent call last):
File "", line 1, in
File "", line 3, in __init__
TypeE
Am 12.11.2012 14:12, schrieb F.R.:
Once in a while I write simple routine stuff and spend the next few hours
trying to understand why it doesn't behave as I expect. Here is an example
holding me up:
[...snip incomplete code...]
Trying something similar with a simpler class works as expected:
[
Am 11.11.2012 23:24, schrieb Cantabile:
I'm writing a small mail library for my own use, and at the time I'm
testing parameters like this:
Let's ignore the facts that there is an existing mail library, that you
should use real parameters if they are required and that exit() is
completely inap
Am 09.11.2012 12:37, schrieb Steven D'Aprano:
On Fri, 09 Nov 2012 08:56:22 +0100, Ulrich Eckhardt wrote:
Or, do you suggest I don't call super().__init__()? That would seem
unclean to me.
On the contrary: calling super().__init__ when the superclass does
something you don't wa
Am 08.11.2012 21:29, schrieb Terry Reedy:
On Thu, Nov 8, 2012 at 8:55 AM, Ulrich Eckhardt
wrote:
On 3.3, it gives me a "TypeError: object.__init__() takes no
parameters". To some extent, this makes sense to me, because the
int subobject is not initialized in __init__ but in __n
Hi!
Preparing for an upgrade from 2.7 to 3, I stumbled across an
incompatibility between 2.7 and 3.2 on one hand and 3.3 on the other:
class X(int):
def __init__(self, value):
super(X, self).__init__(value)
X(42)
On 2.7 and 3.2, the above code works. On 3.3, it gives me a "TypeErr
Hi!
I have two problems that are related and that I'd like to solve together.
Firstly, I have code that allows either a file or a string representing
its content as parameter. If the parameter is a file, the content is
read from the file. In Python 2, I used "isinstance(p, file)" to
determine
Am 05.11.2012 11:54, schrieb andrea crotti:
Quite often I find convenient to get a filename or a file object as
argument of a function, and do something as below:
def grep_file(regexp, filepath_obj):
"""Check if the given text is found in any of the file lines, take
a path to a file or
Hi everybody!
I was just smacked by some very surprising Python 2.7 behaviour. I was
assembling some 2D points into a list:
points = []
points += (3, 5)
points += (4, 6)
What I would have expected is to have [(3, 5), (4, 6)], instead I got [3,
5, 4, 6]. My interpretations thereof is that th
Am 02.11.2012 12:20, schrieb Jason Benjamin:
Anybody know of the appropriate place to troll and flame about various
Python related issues? I'm kind of mad about some Python stuff and I
need a place to vent where people may or may not listen, but at at least
respond. Thought this would be a stra
Am 02.11.2012 09:08, schrieb Martin Hewitson:
On 2, Nov, 2012, at 08:38 AM, Paul Rubin
wrote:
Martin Hewitson writes:
So, is there a way to put these methods in their own files and
have them 'included' in the class somehow? ... Is there an
official python way to do this? I don't like having s
Am 02.11.2012 09:20, schrieb Martin Hewitson:
Well, here we disagree. Suppose I have a class which encapsulates
time-series data. Below is a list of the absolute minimum methods one
would have to process that data.
[...]
> 'abs' 'acos' 'asin' 'atan' 'atan2' 'average' 'cohere' 'conv' 'corr'
> 'co
Am 30.10.2012 18:23, schrieb Jean-Michel Pichavant:
- Original Message -
[snip]
I haven't figured out the justification for staticmethod,
http://en.wikipedia.org/wiki/Namespace
+
"Namespaces are one honking great idea -- let's do more of those!"
Someone may successfully use only modul
Am 30.10.2012 14:47, schrieb Dave Angel:
I'd think the obvious solution is to move both the functions outside of
the class. I haven't figured out the justification for staticmethod,
except for java or C++ converts.
Although I come from a C++ background, I think static functions have
solid rea
Hi!
I can call a staticmethod f() of class C like "C.f()" or with an
instance like "C().f()". Inside that staticmethod, I have neither the
class (at least not the original one) nor do I have an instance, so I
can't call a different staticmethod from the same class. The obvious
solution is to
Am 29.10.2012 00:30, schrieb goldtech:
class Contact:
all_contacts = []
def __init__(self, name, email):
self.name = name
self.email = email
Contact.all_contacts.append(self)
Okay, a class that automatically registers all instances in a central list.
OK,
Hi!
General advise when assembling strings is to not concatenate them
repeatedly but instead use string's join() function, because it avoids
repeated reallocations and is at least as expressive as any alternative.
What I have now is a case where I'm assembling lines of text for driving
a pro
Some updates on the issue:
The etc/hosts file contains the following lines:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
As I understand it, those effectively mean that localhost is not
resolved via this hosts fil
Hi!
I noticed yesterday that a single HTTP request to localhost takes
roughly 1s, regardless of the actually served data, which is way too
long. After some digging, I found that the problem lies in
socket.create_connection(), which first tries the IPv6 ::1 and only then
tries the IPv4 127.0.0
Hi!
I need a little nudge in the right direction, as I'm misunderstanding
something concerning string literals in Python 2 and 3. In Python 2.7,
b'' and '' are byte strings, while u'' is a unicode literal. In Python
3.2, b'' is a byte string and '' is a unicode literal, while u'' is a
syntax
Am 12.10.2012 00:06, schrieb Wenhua Zhao:
On Wed, Oct 10, 2012 at 12:21 PM, Ian Kelly wrote:
Can you demonstrate an API bug that is caused by this?
A simple demo of this error is:
[...]
print "in main cv._is_owned: ", cv._is_owned()
That is kind of cheating, because as far as I can t
1 - 100 of 487 matches
Mail list logo