Hello,
I'm trying to make an HTTPS request with urllib.
OS: Gentoo
Python: 3.6.1
openssl: 1.0.2l
This is my test code:
= CODE BLOCK BEGIN =
import ssl
import urllib.request
from lxml import etree
PROXY = 'proxy.vpn.local:'
URL = "https://google.com";
proxy = urllib.request.ProxyHa
On Tuesday, 1 November 2016 20:09:14 UTC+3, Peter Otten wrote:
> Pavel Velikhov wrote:
>
> > On Tuesday, 1 November 2016 12:50:37 UTC+3, Peter Otten wrote:
> >> Pavel Velikhov wrote:
> >>
> >> > We have released PythonQL, a query language extension to
On Tuesday, 1 November 2016 20:16:43 UTC+3, Michael Torrie wrote:
> On 11/01/2016 02:56 AM, Pavel Velikhov wrote:
> > Hi Folks,
> >
> > We have released PythonQL, a query language extension to Python (we
> > have extended Python’s comprehensions with a full-fledged
On Tuesday, 1 November 2016 12:50:37 UTC+3, Peter Otten wrote:
> Pavel Velikhov wrote:
>
> > We have released PythonQL, a query language extension to Python (we have
> > extended Python’s comprehensions with a full-fledged query language,
> > drawing from the useful fea
Hi Folks,
We have released PythonQL, a query language extension to Python (we have
extended Python’s comprehensions with a full-fledged query language,
drawing from the useful features of SQL, XQuery and JSONiq). Take a look at the
project here: http://www.pythonql.org and lets us know what you
python and especially in Jupyter notebooks. Would you have any
advise on how to approach these?
Thanks in advance!
Pavel Velikhov
P.S. Here's the demo site for our project,if you're interested: www.pythonql.org
--
https://mail.python.org/mailman/listinfo/python-list
If you're familiar with C++, I recommend to have a look at Boost::Python.
Sample program:
#include
#include
void world()
{
std::cout << "hello world" << std::endl;
}
BOOST_PYTHON_MODULE( hello )
{
using namespace ::boost::python;
def( "world", &world );
}
Usage:
python -c "i
> but what about integers or strings?
Can you provide example?
---
No matter if __all__ uses names or objects, I think it should be validated not
only when importing '*', but always.
Frankly, do you always unit-test if __all__ works?
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I today uncovered subtle bug and would like to share it with you.
By a mistake, I forgot to put comma into '__all__' tuple of some module. Notice
missing comma after 'B'.
# module foo.py
__all__ = (
'A',
'B'
'C',
)
class A: pass
class B: pass
class C: pass
If you try to import
Have you considered to use rather WSGI-based solution? (for Apache Httpd is
mod_wsgi). Mod_python is totally obsolete.
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
can you explain, why is the attribute 'fired' class-level and not
instance-level? There must be good reason for modifying class attribute from
instance.
Dne pondělí 6. června 2016 15:26:08 UTC+2 Chris Withers napsal(a):
> Hi All,
>
> errorhandler is a tiny but useful logging handler for th
Suppose, I have some resource-intensive tasks implemented as functions in
Python.
Those are called repeatedly in my program.
It's guranteed that a call with the same arguments always produces the same
return value.
I want to cache the arguments and return values and in case of repititive
call i
On суббота, 21 ноября 2015 г. 6:30:02 MSK, Dylan Riley wrote:
Also some more notes:
heads = int("1")
tails = int("2")
Why use this strange initialization? The usual way:
heads = 1
tails = 2
gives the same result.
while flips != 0:
flips -= 1
There's no need to use while and flips vari
On суббота, 21 ноября 2015 г. 6:30:02 MSK, Dylan Riley wrote:
i am learning python and was tasked with making a program that
flips a coin 100 times and then tells you
the number of heads and tails.
First, you have a syntax error:
if result = heads:
should be:
if result == heads:
Second, ther
I don't understand why all of you are telling him about '\r\n\, write(),..'
instead of recommending to use take library which already has all problems
resolved (python-gammu / wammu).
When one will write custom templating stuff, you would also recommend him to
take jinja.
--
https://mail.pytho
On Tuesday, September 22, 2015 at 1:20:07 PM UTC+2, Timon Rhynix wrote:
> Hello, I have used pyserial, sms0.4 and other libraries to send sms via
> huawei E1750 modem.
> The code runs well and no error is thrown but the text message is not
> sent/delivered to the number.
> One of my code is as fo
Hi Chris, yeah, I have to stick on the software which my employer provides to
me (we're enterprise company). I'm not root on that system. I'm happy with 2.6
now, two years ago we were on older RHEL with python 2.4 and it was a real pain
:)
> > $ cat /etc/redhat-release
> > Red Hat Enterprise Li
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
$ python --version
Python 2.6.6
> Incidentally, why Python 2.6?
>
> ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
True if True if True if True ]
Dne středa 5. srpna 2015 8:49:20 UTC+2 Pavel S napsal(a):
> Hi,
>
> I recently found interesting GOTCHA while doing list comprehension in python
> 2.6:
>
> >>> values = ( True, False, 1, 2, 3, None )
> >>> [ value for valu
Hi,
I recently found interesting GOTCHA while doing list comprehension in python
2.6:
>>> values = ( True, False, 1, 2, 3, None )
>>> [ value for value in values if value if not None ]
[True, 1, 2, 3]
I was wondering why this list comprehension returns incorrect results and
finally found a typ
Hello everybody!
We're looking for a well-experienced python developer who'd like to participate
in educational startup in Moscow, Russia. It's going to be a contractor's job
position for 6 months with possible prolongation.
Here is the link: http://edumate.ru
Main milestones for work complet
I checked my modules with pylint and saw the following warning:
W: 25,29: Used builtin function 'map' (bad-builtin)
Why is the use of map() discouraged?
It' such a useful thing.
--
https://mail.python.org/mailman/listinfo/python-list
There are some basics about Python objects I don't understand.
Consider this snippet:
class X: pass
...
x = X()
dir(x)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__', '_
On Saturday 23 November 2013 02:01:26 Steven D'Aprano wrote:
> * Python is not Java, and Java is not Python either:
>
> http://dirtsimple.org/2004/12/python-is-not-java.html
> http://dirtsimple.org/2004/12/java-is-not-python-either.html
Thanks for all those references.
There's this statement in t
b.
New release is coming in one or two weeks.
Cheers,
Pavel
On Wed, Nov 21, 2012 at 4:34 PM, Alec Taylor wrote:
> Dear Prof. Solin,
>
> Can you put your website—http://femhub.com/textbook-python/—on your
> github—https://github.com/femhub/nclab-textbook-python?
>
> I will then
Hi Ian,
thank you for your comments.
On Mon, Nov 19, 2012 at 11:46 PM, Ian Kelly wrote:
> On Sun, Nov 18, 2012 at 10:30 PM, Pavel Solin
> wrote:
> > I would like to introduce a new Python textbook
> > aimed at high school students:
> >
> > http://femhub.com
, every contributor becomes automatically
a co-author.
Best regards,
Pavel
--
Pavel Solin
Associate Professor
Applied and Computational Mathematics
University of Nevada, Reno
http://hpfem.org/~pavel
--
http://mail.python.org/mailman/listinfo/python-list
import calendar
print 366 if calendar.isleap(2003) else 365
On 22 April 2012 13:37, contro opinion wrote:
> i want to know how many days in one year,
> import time
> import datetime
> d1= datetime.datetime(2003, 1, 1)
> d2=datetime.datetime(2003, 21, 31)
> print (d2-d1).days+1
>
> i can get t
zip(*d.values())
On 12 April 2012 20:28, wrote:
> I using Python 3.2 and have a dictionary
d = {0:[1,2], 1:[1,2,3], 2:[1,2,3,4]}
>
> whose values are lists I would like to zip into a list of tuples. If I
> explicitly write:
list(zip([1,2], [1,2,3], [1,2,3,4])
> [(1, 1, 1), (2, 2, 2)]
lab-u...@googlegroups.com. We hope to
hear from you!
Best,
Pavel
--
Pavel Solin
University of Nevada, Reno
http://hpfem. <http://hpfem.math.unr.edu/people/pavel/>org/~pavel
--
http://mail.python.org/mailman/listinfo/python-list
On 21 окт, 13:50, Ian Kelly wrote:
> On Thu, Oct 20, 2011 at 10:17 PM, Yosifov Pavel wrote:
> > Little silly example:
>
> > class MyFile(file):
> > šdef __init__(self, *a, **ka):
> > š šsuper(MyFile, self).__init__(*a, **ka)
> > š šself.commented =
On 21 окт, 00:42, Ian Kelly wrote:
> On Thu, Oct 20, 2011 at 11:28 AM, Yosifov Pavel wrote:
> > In the Python 2.x was simple to create own file object:
>
> > class MyFile(file):
> > špass
>
> > for example to reimplement write() or something else. How to do it in
In the Python 2.x was simple to create own file object:
class MyFile(file):
pass
for example to reimplement write() or something else. How to do it in
Python 3.x?
--
http://mail.python.org/mailman/listinfo/python-list
Hi Friends,
For Windows and Linux Tips, Please Visit:
www.windowsandlinuxtips.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Is it possible to override a class in the module or the module itself
that is imported across the project to add new methods to it?
For example I've got
module 'a' with class A
from a import A
but I don't want to add a method to that A class not just in this
unit, but across the project, so eve
> This is what whe world has created namespace-packages for. At least if
> you can live with the namespace "pya" being otherwise empty.
That seems like a good solution. Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Before you flame me, I know that what I'm trying to do is beyond evil.
But I nonetheless want to do it. Feel free to rant if you must. :)
I have a package that I want to install into another package. For
example, I have the packages pya and pyb.
pya is guaranteed to be installed before pyb is, so
On Aug 18, 5:11 pm, "Jan Kaliszewski" wrote:
> 18-08-2009 o 22:27:41 Nat Williams wrote:
>
>
>
> > On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha
> > wrote:
>
> >> I want a dictionary that will transparently "inherit" from a pa
On Aug 18, 4:23 pm, "Jan Kaliszewski" wrote:
> 18-08-2009 o 21:44:55 Pavel Panchekha wrote:
>
>
>
> > I want a dictionary that will transparently "inherit" from a parent
> > dictionary. So, for example:
>
> > """
> > a = I
I want a dictionary that will transparently "inherit" from a parent
dictionary. So, for example:
"""
a = InheritDict({1: "one", 2: "two", 4: "four"})
b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
a[1] # "one"
a[4] # "four"
b[1] # "one"
b[3] # "three"
b[4] # "foobar"
"""
I've written
On Apr 18, 9:43 pm, Aaron Brady wrote:
> On Apr 17, 9:41 pm, Steven D'Aprano
> cybersource.com.au> wrote:
> > On Fri, 17 Apr 2009 18:22:49 -0700, Pavel Panchekha wrote:
> > > I've got an object which has a method, __nonzero__ The problem is, that
> > >
On Apr 18, 4:01 pm, Piet van Oostrum wrote:
> But you can give each object its own class and then put the special
> methods in that class:
>
> >>> def create_special_object(bases, *args):
>
> ... if not isinstance(bases, tuple):
> ... bases = bases,
> ... cls = type("SpecialClass", bases,
> The docs don't say you can do that:
Thanks, hadn't noticed that.
> Should you be able to?
I'd say so. In my case, I need a class that can encapsulate any
object, add a few methods to it, and spit something back that works
just like the object, but also has those extra methods. I can't just
add
I've got an object which has a method, __nonzero__
The problem is, that method is attached to that object not that class
> a = GeneralTypeOfObject()
> a.__nonzero__ = lambda: False
> a.__nonzero__()
False
But:
> bool(a)
True
What to do?
--
http://mail.python.org/mailman/listinfo/python-list
ulong,),{})
>>> x = t1()
>>> y = t2()
>>> type(x)==type(y)
False
The problem:
1st way work in complex using of ctypes (interfacing with some DLLs),
but doesn't allow to determine real type!
2st way allows to determine real type, but "access violation
sorry, pls forget ...
--
geon
Pavel Kosina
--
http://mail.python.org/mailman/listinfo/python-list
h.c, line 354
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Patchuje někdo tady pod Windows? Díky
--
geon
Pavel Kosina
--
http://mail.python.org/mailman/listinfo/python-list
小楼 napsal(a), dne 1.1.2009 10:32:
#coding="utf-8"
#中国
print('a')
saved in utf8
alt+x,destroyed IDLE...
me too,why?
Are you sure? Run (F5) with print('a') is OK here. Maybe you have
redefined key bindings in IDLE ...
--
geon
Pavel Kosina
--
http://mail.pyth
IDLE window without any error message.
--
geon
Pavel Kosina
--
http://mail.python.org/mailman/listinfo/python-list
janislaw napsal(a):
Um, I could be only guessing what are you meant to do, unless you
describe your problem in more detailed way. I.e. describe the desired
behaviour, show code which you have, and describe the current
behaviour.
well, I am working on a tutorial for youngster (thats why i ne
janislaw napsal(a):
Use google to find the appropriate site, or browse this site, there
are plenty of examples. You may want to examine the code I wrote to
you to catch the idea:
#--
import Tkinter
import pprint
tk = Tkinter.Tk()
f = Tkinter.Frame(tk, width=100, height=100)
m
janislaw napsal(a):
On 26 Gru, 05:52, Pavel Kosina wrote:
Is it possible to catch in an event more that one key from keyboard? In
my code, I can handle always the only one, the first I press, the others
are omitted. Say, I press both "4" and "8" and only "4&quo
Is it possible to catch in an event more that one key from keyboard? In
my code, I can handle always the only one, the first I press, the others
are omitted. Say, I press both "4" and "8" and only "4" is catched.
def movePlayer(event):
print (event.keysym)
Th
On 16 июл, 11:32, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Tue, 15 Jul 2008 19:54:30 -0700, Yosifov Pavel wrote:
> > Kay, can you show example of such generator? ReIter, for example, work
> > with usual generators.
>
> > But for "bi
tate, side-
effects)...
Best regards, Pavel
--
http://mail.python.org/mailman/listinfo/python-list
On 14 июл, 23:36, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
> (snip)
>
> > defcloneiter( it ):
> > """return (clonable,clone)"""
> > return tee
external state (side-effects) or not, may be is needed
some new class-protocol for it... or something else. Or another way:
iterators may be re-iterable always, but if programmer need to point
to the extra- (external) state, he has to raise some a special
exception in __iter)) method... OK, it
e
method for copy itself (the tee() implementation) or be "re-
startable". Why not?
Concrete problem was to generate iterators (iterator of slices). It
was solved with ReIter.
--Best regards,
--pavel
--
http://mail.python.org/mailman/listinfo/python-list
On 13 июл, 14:12, Peter Otten <[EMAIL PROTECTED]> wrote:
> Yosifov Pavel wrote:
> > Whats is the way to clone "independent" iterator? I can't use tee(),
> > because I don't know how many "independent" iterators I need. copy and
> > deepcop
Whats is the way to clone "independent" iterator? I can't use tee(),
because I don't know how many "independent" iterators I need. copy and
deepcopy doesn't work...
--pavel
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 3, 1:19 am, [EMAIL PROTECTED] wrote:
> On Jun 2, 12:41 pm, [EMAIL PROTECTED] wrote:
>
>
>
> > On Jun 2, 7:15 pm, Michael Ströder <[EMAIL PROTECTED]> wrote:
>
> > Here are benchmarks for FreeBSD 6.2, amd64
>
> > packet_size x y
> > 0499.57 1114.54
> >10
On Jun 2, 7:15 pm, Michael Ströder <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > To benchmark this I used a simple tcp server which writes a small
> > (16k)
> > string to the client and closes the connection.
>
> Just a general note: When benchmarking such a network service it would
> b
On Jun 2, 7:09 pm, [EMAIL PROTECTED] wrote:
> On May 31, 9:13 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote:
>
> > On May 30, 2:40 pm, [EMAIL PROTECTED] wrote:
>
> > > Hi, everybody!
>
> > > I wrote a useful class ThreadPoolingMixIn which can be used to create
> > > fast thread-based servers. This mi
):
"""Mix-in class to handle requests in a thread pool.
The pool grows and thrinks depending on load.
For instance, a threadpooling TCP server class is created as
follows:
class ThreadPoolingUDPServer(ThreadPoolingMixIn, TCPServer): pass
""&
s created as
follows:
class ThreadPoolingUDPServer(ThreadPoolingMixIn, UDPServer):
pass
"""
__author__ = 'Pavel Uvarov <[EMAIL PROTECTED]>'
def init_thread_pool(self, min_workers = 5,
max_workers = 100, min_spare_workers = 5):
On 24 май, 12:58, bukzor <[EMAIL PROTECTED]> wrote:
> On May 23, 6:31 pm, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
>
> > Does somebody know existent tool for checking unhandled exceptions?
> > Like in Java when method throws exception but in code using this
> >
Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?
--
/Pavel
--
http://mail.python.org/mailman/listinfo/python-list
.log' for more details.
It appears you have no C compiler installed. You should be able to get one
of those from your distribution's repositories. If you can't, upgrade to
something debian-based.
/pavel
--
http://mail.python.org/mailman/listinfo/python-list
I think that doc strings are the most important way in which you should
be commenting on your code. Once the code works, you can elimainate
most inline comments, leaving only doc string for everything and a few
comments on some particularly confusing parts. Other than that,
comments usually only cl
://www.bani.com.br
> MSN: [EMAIL PROTECTED]
> GTalk/Jabber: [EMAIL PROTECTED]
> Linux User #114432
Hi,
in listen project Makefile is shown how to make this thing. URL for SVN
view of Makefile for listen 0.4.3 is:
http://svn.sourceforge.net/viewvc/listengnome/releases/0.4.x/0.4.3/Makefile?view=markup
Cheers, Pavel
--
http://mail.python.org/mailman/listinfo/python-list
--
geon
Pavel Kosina
from livewires import *
from random import randint
def makePlayer():
global player_body, player_x, player_y
player_x=randint(0,640)
player_y=randint(0,480)
player_body=circle(player_x, player_y,5, filled=1)
def movePlayer():
global finito, player_body
Hi,
I have tried this:
import ConfigParser
fp = file("test.conf","w+")
cp = ConfigParser.ConfigParser()
cp.add_section("Section1")
cp.set("Section1","Value1",12345)
cp.write(fp)
and works fine for me.
--
http://mail.python.org/mailman/listinfo/python-list
72 matches
Mail list logo