u want to special case dictionaries? If Python is doing it
for dictionaries, sooner or later someone will ask for the names of lists
or any arbitrary object.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Jiang Nutao
wrote:
> To convert list
> aa = [0x12, 0x34, 0x56, 0x78]
> into
> [0x34, 0x12, 0x78, 0x56]
>
> How to do it fast? My real list is huge.
Use the `array` module and the `array.byteswap()` method.
Ciao,
Marc
all pages in the page , and
> modify all the links to conrespond local disk links and ...
Why don't you just use the `wget` program. Not written in Python but much
easier to use instead of writing the functionality yourself.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
to strings. The
equivalent to the second example without string formatting would be::
print 'There are' + str(number) + ' ways to skin a ' + str(furryanimal)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
most of it. Python itself is a RAD tool.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
compare a unicode string `val` with a byte
string in the list. The unicode string will be converted to a byte string
for this comparison with the default encoding: ASCII. But 'ó' is not
contained in ASCII.
> Can any one please tell me why is this error, and how to get rid of
> this error. Because I have some files which containing some more
> special characters.
Either use an unicode string in the list search too or explicitly encode
the unicode string `val` with the appropriate encoding before using it to
search the list.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, John Machin
wrote:
> Marc 'BlackJack' Rintsch wrote:
>
>> Because you are trying to compare a unicode string `val` with a byte
>> string in the list. The unicode string will be converted to a byte string
>> for this com
d__()` method that returns an iterator.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ancy formatting %s" \
> ... ))
>
> This works syntactically.
It works just fine without the trailing backslash. A "logical line" does
not end until all opened parenthesis and brackets are matched by their
closing counterpart.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
g into your account. CGI
scripts are executed by the web server which usually has its own user and
group, `wwwrun` or something like that, and does not read the `.profile`
in your home directory.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Wijaya Edward
wrote:
>
> I tried to call pydoc from my Linux box.
> To my realization that it doesn't contain
> pydoc.
>
> I thought this module should be a default module.
Yes it is part of the standard library. What distribution are y
t; Is there a way to get rid of the i processing in this script?
for i, e in enumerate(l):
print i, e
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
is quite fragile. If you redirect stdin or
stdout the encoding is set to None for example because the interpreter
can't tell what encoding the "other side" of the redirection produces or
expects.
BTW the US-ASCII isn't wrong but just limiting as everything in the ASCII
range is the same in ISO-8859-1.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
> Yes, OK I guess NTFS would be of most interest to me.
Then you'll have a hard time because NTFS specs are not available for
free. Just reverse engineered stuff.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ary of names
mapped to values and another that maps the names to default values for the
modulo operation.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
252/Untitled-1_copy.png.html
Do you want to change the characters in a picture!? Your question still
is *very* vague. Please provide a more detailed description of the
problem at hand.
What do you have? A text file? In which encoding? And what do you want
to achieve?
Ciao,
Marc
complain that you have to type and probably
change 'a_method' twice instead of once. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
onsole encoding (sys.stdout.encoding) is
> ignored.
Nope, it is not ignored. This would not work then::
In [2]: print 'K\xc3\xb6nig'.decode('utf-8')
König
In [3]: import sys
In [4]: sys.getdefaultencoding()
Out[4]: 'ascii'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
27;span', {'class': 'nametext'}).contents
Out[12]: [u'Hello']
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
#x27;San Francisco'
>> print state
>> # 'California'
>
> Yes, I understand that. What confused me was if it had been written like
> this:
>
> pair = (("California","San Francisco"))
Uhm, you mean::
pair = (("California",&qu
? If you use ``print repr(bytes)``
everything outside ASCII will be printed as escape sequence.
But why do you want to "print" JPEG images anyway?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ile is not too big it's better to load
it into memory completely. And if you need the byte value of every single
byte you should read the file into an `array.array()` of type 'B'.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t; ... for i in listObj:
> ... if i is value:
> ... return value
> ... return False
> ...
def my_in(value, sequence):
if value in sequence:
return value
else:
return False
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
e strings* and bytes have values in the range
0..255. Why would you restrict them to ASCII only?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nd there's
no standard way to find out which it was.
The `sys.stdin.encoding` approach isn't very robust because this will only
be set if the interpreter can find out what encoding is used on `stdin`.
That's impossible if the `stdin` is the input from another file.
Make it explici
ame here but prefixing names with
"type information" is "unpythonic" too, again IMHO, because this can get
very misleading if you change the type. Then you have to change all
occurrences of the name or end up with names like `lstObj` bound to a
set object or something similar.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
myfile.close(), with identation error.
> This error doesn't occur when commenting (#) is not in use.
>
> Why so? Is there away to do the commenting in correct way
> under this circumstances?
There has to be code in the ``else`` block. So either comment out the
``else`` line too,
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote:
> Whatever lunix is, […]
An operating system for the Commodore 64. `LUnix NG` Website:
http://lng.sourceforge.net/
:-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
w")
text = text.replace("Left_RefAddr", "FromLeft")
text = text.replace("Left_NonRefAddr", "ToLeft")
# ...
file.write(text)
file.close()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ement to your file:
from Tkinter import Frame, Button
You use `Button` too and this also lives in the `Tkinter` module.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
;m not listed in the headers.
This is irrelevant because the whole paragraph is about emails and not
about newsgroup postings. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
iterators.
>
>>>> it = iter([0])
>>>> bool(it)
> True
>>>> it.next()
> 0
>>>> bool(it)
> False
It works for *this* iterator. By accident.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
the outer
one and on those objects it is possible to inspect and read the docs.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ontain other object that may contain other
> objects
See the `copy` module especially `copy.deepcopy()`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ppens, a is actually 3 elements when the print
> statement is only expecting to print one value. I tried
>
> print "a = %s" %(a)
>
> but I got the same error.
>
> How can I print a tuple with a single string format?
Put the tuple in a tuple:
print 'a = %s" % (a
third instance has been created?
Put your objects into a list. Each time the user presses the `New` Button
append a new researcher object to it.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, tobiah wrote:
> What else is available for sharing complex structures
> with processes running programs that were written in
> other languages?
Corba?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Jorge Vargas
wrote:
> and please please don't go to corba we need to kill that.
Have you real reasons or is this a religious thing? As I see it Corba is
much better supported by Python libs than SOAP is.
Ciao,
Marc 'BlackJack' Rintsch
--
d
to run from memory without a real file backing it on some platforms. A
pure Python program/package should be possible without temporary files.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
. ::
This is an example of "tail text" in
XHTML.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rd "webservice"
was yet to be invented.
A huge part of the SOAP popularity comes from marketing and shoving down
the buzzwords "webservices" and "XML" down everyone's throat and has
nothing to do with technical advantages or disadvantages. Well, IMHO at
least.
E
Traceback (most recent call last):
File "", line 1, in
TypeError: exceptions must be classes, instances, or strings (deprecated),
not type
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
get_key(row))
if row_to_be_updated is not None:
for column in columns_to_be_updated:
row_to_be_updated[column] = row[column]
def main():
table_a = [[1, 4, 5, 7, 7],
[3, 4, 0, 0, 0]]
table_b = [[2, 2, 8, 8, 8],
[1, 4, 9, 9, 9]]
update_table(table_a, table_b, (0, 1), (2, 4))
for row in table_a:
print row
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, skip wrote:
>
> Irmen> So there. Finally back on the original subject ;-)
>
> And without satisfying Godwin's Law. Pretty good.
Which was very hard with all those language nazis out there. Ooops…
SCNR,
Marc 'BlackJack'
uffle(lst)
If you *really* want to be sure it's not sorted after shuffling. :-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch
wrote:
> lst = [1, 2, 3, 4, 5]
> tmp = list(lst)
> while lst == tmp:
> random.shuffle(lst)
Argh, that fails if the list is empty or contains just one item.
lst = [1, 2, 3, 4, 5]
if len(lst) > 1:
tmp =
t()
> I think the colon could be omitted from every type of compound
> statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything?
I would miss auto-indenting in my editor to which the colon at the line
end is an important clue.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
you'll see there's a function
`open_local_file()` involved. This function is chosen by `urllib` because
your path looks like a local file, i.e. it lacks the protocol information.
You don't want 'en.wikipedia.org/robots.txt', you want
'http://en.wikipedia.org/robots.txt'!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, ronrsr wrote:
> def connect():
>
>
>return = MySQLdb.connect (host = "db91x..com",
^
You can't assign to a keyword. Just leave this ``=`` out.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
lt:
> isinstance(x,X)
> False
> type(x) is X
> False
>
> list
Define "doesn't work". Obviously lists are not instances of your `X`
class. So where's the problem? What did you expect and why?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
language supports the serial 'or' (and
>> 'and') and looks just like that.
>
> Python also supports it.
No it doesn't -- look again at the example given above. It's legal syntax
in Python but doesn't have the semantics implied by the example.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
TML control chars.
Look up the `tostring()` method on `array.array` objects and
`str.replace()` for replacing the line ends by ''.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
roperties directly from the instances. I can either def
> __setattr__ , __getattr__ or I can define function for each property
> like setWidth(), setHeight() .
Or you can use `property()` to create "computed attributes".
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
u have.
And with 2 GiB and 40 objects you have about 5 KiB per object. If
you pickle that huge list there has to be enough memory to hold the
pickled data in memory before it is written to disk.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rom another person.
What do you mean by "C wrapper"? You know that Python uses reference
counters to manage memory and that you are responsible for these counters
if you are dealing with Python objects in your C extension?
Ciao,
Marc 'BlackJack' Rintsch
--
http://m
r(path)
except UnicodeError, e:
files = os.listdir(path.encode(sys.getfilesystemencoding()))
# Decode and filter the list "manually" here.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ed to implement your
own. You can get an MD5 `HashAlgorithm` object this way::
HashAlgorithm algorithm = HashAlgorithm.Create("MD5");
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
.e. many threads
waiting for blocking IO then just use Python threads. If your task is
computational intensive then it may be better to use processes and some
form of inter process communication.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
]:
In [6]:file = 'foo.txt'
In [7]:file
Out[7]:'foo.txt'
In [8]:file('x')
---
exceptions.TypeError Traceback (most recent call last)
/home/bj/
TypeError: 'str' obje
Python? Which C
library/wrapper do you use?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
olys.append(lambda x: polys[i](x)*x)
The `i` is the problem. It's not evaluated when the lambda *definition*
is executed but when the lambda function is called. And then `i` is
always == `n`. You have to explicitly bind it as default value in the
lambda definition:
polys.append(
f` is called. That's a
problem if you create more than one function in `outer` and use a name
from outer's locals that changes:
In [7]:def pitfall():
.7.:functions = list()
.7.:for i in range(3):
.7.:functions.append(lambda: i)
.7.:print 'pitfall: i=%d' % i
.7.:return functions
.7.:
In [8]:for function in pitfall():
.8.:print function()
.8.:
pitfall: i=2
2
2
2
At the time the list with the functions is returned `i` is 2. So if you
call any of the functions it looks up this `i`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
int('76',16))+chr(int('d3',16))+chr(int('12',16))+chr(int('26',16))+chr(int('a1',16))+chr(int('e3',16))+chr(int('ba',16))+chr(int('b0',16)))
> testo = str(testo)
> c = crypt.encrypt(testo)
>
> I don't know if this is the best way , but anyway it work
In [26]:import binascii
In [27]:binascii.unhexlify('ea523a664dabaa4476d31226a1e3bab0')
Out[27]:'\xeaR:fM\xab\xaaDv\xd3\x12&\xa1\xe3\xba\xb0'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
e2 datatype is
> string which need to be conerted into date fromat which i am not able
> to do so please help me.
from datetime import date
date_str_1 = '2006-01-10'
date_str_2 = '2005-12-15'
date_1 = date(*map(int, date_str_1.split('-')))
date_2 = date(
#x27;peter', 'parker'], ['bruce', 'wayne']]
for name, surname in fullnames:
name2hero[name].append(surname)
for hero in heroes:
print 'Hello %s a.k.a %s %s' % tuple(hero)
IMHO you shouldn't try to program C++ in Python. Take a step back and
describe *what* you want to achieve and not *how* you do it in another
language. And then implement it in Python.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>In <[EMAIL PROTECTED]>,
>>rsutradhar_python wrote:
>>> date1="2006-01-10"
>>>
Explicit is better than implicit.
In the face of ambiguity, refuse the temptation to guess.
And don't mix up weakly and dynamically typed. Python is dynamically and
strictly typed.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, bryan rasmussen
wrote:
> It should hopefully be as high level as Wget, not download the pages
> but just follow the links, and output graphs.
How do you get at the links without downloading the page!?
Ciao,
Marc 'BlackJack' Rintsch
--
gt; import os
> from pysqlite2 import dbapi2
> print dbapi2.version
>
> db = dbapi2.connect("bla.db")
> c = db.cursor()
>
> c.execute("create table b (c integer)")
>
> for i in xrange(1000):
> c.execute("insert into b values (%d)"
.nz/pyfcp
I get: Unknown host www.python.org.nz
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t `fix` it. Importing an already imported module doesn't reload
the module.
> 2) Once I assign mymodule.test with override, will modules that
> imported my module *PRIOR* to the assignment get override, or will they
> keep the original function test()?
They see the `override()` f
In <[EMAIL PROTECTED]>, Pekka Karjalainen wrote:
> Suppose I had no idea what sys.stdout.closed was and wanted to find out.
> Where would I look it up?
`sys.stdout` is a file (like) object:
http://docs.python.org/lib/bltin-file-objects.html
Ciao,
Marc 'BlackJack&
In <[EMAIL PROTECTED]>, Dan Stromberg wrote:
> What's the deal here?
Very hard to tell without more details.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t at 0x405b15f8>
I have copy and pasted you code.
For debugging re's in Python you might take a
look at http://kodos.sourceforge.net/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
OS thing but a a GUI thing.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ut the ``print`` because printing
unicode strings means they have to be encoded into a byte string again.
And whatever encoding the target of the print (your console) uses, it
does not contain the unicode character u'\xd8'. From the traceback it
seems your terminal uses `cp4
ot
exist::
In [1]: a = [1, 2, 3]
In [2]: a[0]
Out[2]: 1
In [3]: a[1]
Out[3]: 2
In [4]: a[2]
Out[4]: 3
In [5]: a[3]
-
exceptions.IndexErrorTraceback (most recent call last)
/home/marc/
IndexError: list index out of range
So from the
D1=82=D0=B5=D1=81=D1=82?= а.
>
> Please note that the last character (before dot) is not quoted, and
> resulting string is not 8bit clean.
Why should a simple ASCII 'a' be quoted? And what do you mean by "not
8bit clean"? The string is even 7-bit clean!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
return type(name, bases, dict)
> ...
> hello
>>>>
>
> instead of defining a separate metaclass function/class, you can do
> it inline. isn't that cool?
But why use a metaclass? If the meta class is only applied to *one*
class, can't you do at class level
In <[EMAIL PROTECTED]>, arvind wrote:
> i've created the myclass instance and calles the "function second()".
> i want to access the text entered in 'w' through Entry widget in
> "function third()"
> i am getting the 'fuction not having 'w' attribute error.
> how to overcome it?
Make `w` an attri
uot; with a ''. in html, the
> ' ' char is not a valid ascii char...
>
> in perl, i'd do 's / //' and be done with it!!!
And in Python I'd use the `replace()` method on strings and be done with
it!!!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
eformats'? A script that automagically converts
*anything* to text? What about pictures?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, K.S.Sreeram
wrote:
> Marc 'BlackJack' Rintsch wrote:
>> But why use a metaclass? If the meta class is only applied to *one*
>> class, can't you do at class level whatever the metaclass is doing!?
>
> The very fact that you
and 'b'.
>
> btw, the example seems to work even with old-style classes.
Yes, but setting properties works only with new-style classes. So I use
them whenever I use properties. In my mind properties and new-style
classes are linked together.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
iface lo[\w\t\n\s]+?(?=(iface)|$)
Now only "iface lox " is matched in the example above.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, bruce wrote:
> does python provide regex handling similar to perl. can't find anything in
> the docs i've seen to indicate it does...
The `re` module handles Perl compatible regexes.
Ciao,
Marc 'BlackJack' Rintsch
--
http://
nt to catch the
`ImportError`\s. If you stop the program anyway this leads to much less
cluttered source code.
And it maybe would make sense to print the actual catched `IOError`\s too
because it may be a valueable information for the user *why* it failed.
For example because he has no rights or the file system is full.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
C(object):
def __init__(self):
self.a=A()
self.b=B()
def c(self):
self.b.interClassCall(self)
Much less magic involved this way.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
to do? The main loop isn't
running yet. If you just call `show_ui()` you should get some windows.
The ``global`` is unnecessary by the way. It even generates a warning:
test.py:0: SyntaxWarning: name 'root' is assigned to before global
declaration
Ciao,
Marc
ary << Dict(OPEN_BRACE + OneOrMore(item) + CLOSE_BRACE)
result = dictionary.parseString(source)
print result['Contacts']['Class']
Output is: IPF.Contact
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
def wow(self, n):
return k + n
f = Foo()
k = f.wow(55)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
able way to get the time zone information from
the viewer of the website with just HTTP. So you need a JavaScript
solution I guess. Send the end time as UTC time to the browser an use
JavaScript's `Date` object to display the countdown in local time.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ONS
> 'bcdfgh'
>>>>
Little warning: It works only on module level as assigning to `locals()`
return value in functions and methods has no effect on the "real" locals.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nto data until there's a match and the the
`replace()` starts again from the start and searches/replaces through the
whole data.
You can get rid of the indexes and make the code a bit clearer by the way:
for old, new in find:
data = data.replace(old, new)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
www.bittorrent.org/protocol.html
.. _BitTorrent Economics Paper:
http://www.bittorrent.com/bittorrentecon.pdf
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nt the GIL be locked when the rehash occurs?
If there is a GIL then maybe yes. But the GIL is an implementation
detail. It's not in Jython nor IronPython and maybe not forever in
CPython. Don't know about PyPy.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ally the Python way I'd say. What if `c` is of type `long` for
instance? Your code would stop with an assertion error for a value that
should work. Strict type checking prevents "duck typing" which is a quite
fundamental concept in Python.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
m a bit complicated for a simple line oriented input...
This is already done in the `asyncore` and `asynchat` modules of the
standard library.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
module from the standard library?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
gt; IOError: [Errno 2] No such file or directory: 'veryBigFile.dat'
>
> Is it a BUG or a FEATURE?
It's the error number Windows returns for that operation.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 1811 matches
Mail list logo