Hi Guys,
Finally I have decided to put best interview question and answers.
Please visit http://www.f2finterview.com/web/CorePython/ for core python and
http://www.f2finterview.com/web/PythonAdvanced/ for advanced python
On Tuesday, October 30, 2007 11:44:01 PM UTC+5:30, Krypto wrote:
> Hi,
>
On Tue, Sep 4, 2012 at 11:30 PM, Levi Nie wrote:
> my code:
> import os
> os.startfile(r'C:\Program Files\Internet Explorer.exe')
>
> the error:
> os.startfile(r'C:\Program Files\Internet Explorer.exe')
> WindowsError: [Error 2] : 'C:\\Program Files\\Internet Explorer.exe'
>
There's no such thing
Hi All,
I have a small library which supplies a metaclass superfixer, which when
applied to a class, provides every method with a variable __class__, which
refers to the class in which the method is defined.
This avoids the need to refer to the current class name in calls to super.
If there's any
On Tue, Sep 4, 2012 at 11:30 PM, Franck Ditter wrote:
> Hi !
> a is b <==> id(a) == id(b) in builtin classes.
> Is that true ?
> Thanks,
>
> franck
No. It is true that if a is b then id(a) == id(b) but the reverse is
not necessarily true. id is only guaranteed to be unique among objects
alive
Hi !
a is b <==> id(a) == id(b) in builtin classes.
Is that true ?
Thanks,
franck
--
http://mail.python.org/mailman/listinfo/python-list
my code:
import os
os.startfile(r'C:\Program Files\Internet Explorer.exe')
the error:
os.startfile(r'C:\Program Files\Internet Explorer.exe')
WindowsError: [Error 2] : 'C:\\Program Files\\Internet Explorer.exe'
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have attached python interview questions and answers for beginners.
Please visit http://www.f2finterview.com/web/CorePython/ for core python and
http://www.f2finterview.com/web/PythonAdvanced/ for advanced python
On Thursday, August 30, 2012 5:24:08 PM UTC+5:30, (unknown) wrote:
> Hello
Mathieu Courtois writes:
> Here is my example :
>
>
> import cPickle
>
> ParentClass = object # works
> ParentClass = Exception # does not
>
> class MyError(ParentClass):
> def __init__(self, arg):
> self.arg = arg
>
> def __getstate__(self):
> print '#DBG pass in get
loial writes:
> I have threaded python script that uses sockets to monitor network ports.
>
> I want to ensure that the socket is closed cleanly in all circumstances. This
> includes if the script is killed or interupted in some other way.
The operating system should close all sockets automatic
On Wednesday, 5 September 2012 09:35:43 UTC+5:30, Terry Reedy wrote:
> On 9/4/2012 11:22 PM, Ramchandra Apte wrote:
>
>
>
> > I was actually planning to write a bug on this.
>
>
>
> If you do, find the right place to submit it.
>
> bugs.python.org is for issues relating to the cpython repos
On Sep 5, 4:27 am, Mark Lawrence wrote:
> On 05/09/2012 00:05, Ben Finney wrote:
>
>
>
>
>
>
>
>
>
> > Andreas Perstinger writes:
>
> >> On 04.09.2012 11:34, Paolo wrote:
> >>> how do I know if a JTextField has the focus?
> >>> thank to all
>
> >> Look there:
> >>http://www.catb.org/esr/faqs/smar
On 9/4/2012 11:22 PM, Ramchandra Apte wrote:
I was actually planning to write a bug on this.
If you do, find the right place to submit it.
bugs.python.org is for issues relating to the cpython repository.'
I fairly sure that the website search code is not there.
If you do find the right place
How do I zoom in on a tkinter image?
And how do I change the selected pixel to a changeable color when the user
clicks or drags?
--
http://mail.python.org/mailman/listinfo/python-list
The generated code can be run without Python installed and does not embed
Python. For example:
print("Hello World to py2c!")
would be translated to
#include "iostream"
using namespace std; //If you want you can make py2c not add this and
use std::cout instead of cout
int main()
{
cout<<"Hell
On Tuesday, 4 September 2012 22:38:03 UTC+5:30, Sreenath k wrote:
> Error:
>
>
>
>
>
> Exception in thread Thread-1:
>
> Traceback (most recent call last):
>
> File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
>
> self.run()
>
> File
> "/usr/lib/python2.7/dis
On Tuesday, 4 September 2012 23:41:13 UTC+5:30, Grant Edwards wrote:
> On 2012-09-04, MRAB wrote:
>
> > On 04/09/2012 16:26, loial wrote:
>
> >> I have threaded python script that uses sockets to monitor network
>
> >> ports.
>
> >>
>
> >> I want to ensure that the socket is closed cleanly i
On Tuesday, 4 September 2012 23:29:26 UTC+5:30, David Hoese wrote:
> A friend made me aware of this:
>
> When a python beginner (2.x) quick searches for "print" on
>
> docs.python.org, the print function doesn't even come up in the top 20
>
> results. The print statement isn't even listed as
In article <-9cdnaqjtk6nktvnnz2dnuvz_gedn...@westnet.com.au>,
Neil Hodgson wrote:
> The memcpy patch was controversial as it broke Adobe Flash
An added benefit!
--
http://mail.python.org/mailman/listinfo/python-list
On 05/09/2012 03:18, Neil Hodgson wrote:
Roy Smith:
I'm wondering if it might be faster to start at the ends of the strings
instead of at the beginning? If the strings are indeed equal, it's the
same amount of work starting from either end.
Most people write loops that go forwards. This
Roy Smith:
I'm wondering if it might be faster to start at the ends of the strings
instead of at the beginning? If the strings are indeed equal, it's the
same amount of work starting from either end.
Most people write loops that go forwards. This leads to the
processor designers prioritiz
Steven D'Aprano writes:
> Gah! Brain meltdown! DDG does better on searches for Python terms with
> fewer extraneous meanings, e.g. "python print" finds many links about
> fashion, but https://duckduckgo.com/html/?q=python+tuple is all about
> Python tuples :)
Adding the “site:docs.python.org”
On Tue, 04 Sep 2012 08:57:00 -0700, Mathieu Courtois wrote:
> Here is my example :
>
>
> import cPickle
>
> ParentClass = object # works
> ParentClass = Exception # does not
[...]
> 1. With ParentClass=object, it works as expected.
>
> 2. With ParentClass=Exception, __getstate__/__setstat
On Tue, 04 Sep 2012 18:28:31 +, Steven D'Aprano wrote:
> https://www.google.com.au/search?q=python+print
> http://duckduckgo.com/html/?q=python+print
>
> In this case, google hits the right Python documentation on the first
> link. Duckduckgo doesn't do nearly so well, but it comes up with a
Just to play advocatus diaboli, what if some seemingly simple questions are
asked just to jump in and start talking python?
In other words, they just wanna talk shop, no matter what it is. An OT(off
topic) so to speak, and have an enlightened, and evolutionary(via brain
structured acceptance of da
On 4 September 2012 22:59, Chris Angelico wrote:
> On Wed, Sep 5, 2012 at 2:32 AM, Johannes Bauer
> wrote:
> > How do you arrive at that conclusion? When comparing two random strings,
> > I just derived
> >
> > n = (256 / 255) * (1 - 256 ^ (-c))
> >
> > where n is the average number of character
On Wed, Sep 5, 2012 at 9:28 AM, Mark Lawrence wrote:
> On 05/09/2012 00:05, Ben Finney wrote:
>>
>>> Look there:
>>> http://www.catb.org/esr/faqs/smart-questions.html#forum
>>
>> The “how to ask question the smart way” essay is not a blunt instrument
>> for beating people over the head with, and i
On 05/09/2012 00:05, Ben Finney wrote:
Andreas Perstinger writes:
On 04.09.2012 11:34, Paolo wrote:
how do I know if a JTextField has the focus?
thank to all
Look there:
http://www.catb.org/esr/faqs/smart-questions.html#forum
That is an unhelpful response. You aren't giving anything to he
On 9/4/2012 6:18 PM, Chris Angelico wrote:
On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy wrote:
io.open depends on a function the returns an open file descriptor. opener
exposes that dependency so it can be replaced.
I skimmed the bug report comments but didn't find an answer to this:
Why not j
Andreas Perstinger writes:
> On 04.09.2012 11:34, Paolo wrote:
> > how do I know if a JTextField has the focus?
> > thank to all
>
> Look there:
> http://www.catb.org/esr/faqs/smart-questions.html#forum
That is an unhelpful response. You aren't giving anything to help the
original poster improve
On 9/4/2012 6:32 PM, Terry Reedy wrote:
On Tue, Sep 4, 2012 at 1:58 PM, David Hoese wrote:
A friend made me aware of this:
When a python beginner (2.x) quick searches for "print" on
docs.python.org,
the print function doesn't even come up in the top 20 results.
In the Windows Help version o
On Tue, Sep 4, 2012 at 1:58 PM, David Hoese wrote:
A friend made me aware of this:
When a python beginner (2.x) quick searches for "print" on docs.python.org,
the print function doesn't even come up in the top 20 results.
In the Windows Help version of the docs, enter print in the index tab
On 9/4/2012 4:28 PM, channel727...@gmail.com wrote:
The Python C API function PyEval_EvalCode let's you execute compiled
Python code. I want to execute a block of Python code as if it were
executing within the scope of a function, so that it has its own
dictionary of local variables which don't a
On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy wrote:
> io.open depends on a function the returns an open file descriptor. opener
> exposes that dependency so it can be replaced.
I skimmed the bug report comments but didn't find an answer to this:
Why not just monkey-patch? When a module function ca
On Wed, Sep 5, 2012 at 2:32 AM, Johannes Bauer wrote:
> How do you arrive at that conclusion? When comparing two random strings,
> I just derived
>
> n = (256 / 255) * (1 - 256 ^ (-c))
>
> where n is the average number of character comparisons and c. The
> rationale as follows: The first character
On 04/09/2012 19:38, William R. Wing (Bill Wing) wrote:
On Sep 4, 2012, at 1:58 PM, David Hoese wrote:
A friend made me aware of this:
When a python beginner (2.x) quick searches for "print" on docs.python.org, the
print function doesn't even come up in the top 20 results. The print statemen
On Tuesday, September 4, 2012 1:45:55 PM UTC-7, Werner Thie wrote:
> On 9/4/12 9:49 AM, jimmyli1528 wrote:
>
> > I have a main program and a 3rd party module. Trying to import colorama,
> > where colorama is a folder with files in it, returns an ImportError: No
> > module named colorama. How sho
On 9/4/12 9:49 AM, jimmyli1...@gmail.com wrote:
I have a main program and a 3rd party module. Trying to import colorama, where
colorama is a folder with files in it, returns an ImportError: No module named
colorama. How should I import folders?
Do you have a (empty) __init__.py file present
The Python C API function PyEval_EvalCode let's you execute compiled Python
code. I want to execute a block of Python code as if it were executing within
the scope of a function, so that it has its own dictionary of local variables
which don't affect the global state.
This seems easy enough to
I have a main program and a 3rd party module. Trying to import colorama, where
colorama is a folder with files in it, returns an ImportError: No module named
colorama. How should I import folders?
--
http://mail.python.org/mailman/listinfo/python-list
On 9/4/2012 8:58 AM, Serhiy Storchaka wrote:
On 04.09.12 04:13, Steven D'Aprano wrote:
Why does the open builtin need this added complexity? Why not just call
os.open directly? Or for more complex openers, just call the opener
directly?
What is the rationale for complicating open instead of tel
On 2012-09-04, Joel Goldstick wrote:
> On Tue, Sep 4, 2012 at 1:58 PM, David Hoese wrote:
>> A friend made me aware of this:
>> When a python beginner (2.x) quick searches for "print" on
>> docs.python.org, the print function doesn't even come up in the top
>> 20 results.
>
> That's pretty intere
On 4 September 2012 19:07, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Tue, 04 Sep 2012 18:32:57 +0200, Johannes Bauer wrote:
>
> > On 04.09.2012 04:17, Steven D'Aprano wrote:
> >
> >> On average, string equality needs to check half the characters in the
> >> string.
> >
>
On 04.09.2012 11:34, Paolo wrote:
how do I know if a JTextField has the focus?
thank to all
Look there:
http://www.catb.org/esr/faqs/smart-questions.html#forum
Bye, Andreas
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 04 Sep 2012 20:27:38 +0200, Thomas 'PointedEars' Lahn wrote:
> ¹ The other mess they created (or allowed to be created) is this mashup
>of newsgroup and mailing list, neither of which works properly,
In what way do they not work properly?
>because
>the underlying protocols
On Sep 4, 2012, at 1:58 PM, David Hoese wrote:
> A friend made me aware of this:
> When a python beginner (2.x) quick searches for "print" on docs.python.org,
> the print function doesn't even come up in the top 20 results. The print
> statement isn't even listed as far as I can tell. Is ther
On Tue, 04 Sep 2012 13:58:43 -0400, David Hoese wrote:
> A friend made me aware of this:
> When a python beginner (2.x) quick searches for "print" on
> docs.python.org, the print function doesn't even come up in the top 20
> results. The print statement isn't even listed as far as I can tell. Is
David Hoese wrote:
> A friend made me aware of this:
> When a python beginner (2.x) quick searches for "print" on
> docs.python.org, the print function doesn't even come up in the top 20
> results. The print statement isn't even listed as far as I can tell.
> Is there something that can be done a
On Tue, Sep 4, 2012 at 1:58 PM, David Hoese wrote:
> A friend made me aware of this:
> When a python beginner (2.x) quick searches for "print" on docs.python.org,
> the print function doesn't even come up in the top 20 results.
> -Dave
> --
> http://mail.python.org/mailman/listinfo/python-list
T
On 2012-09-04, MRAB wrote:
> On 04/09/2012 16:26, loial wrote:
>> I have threaded python script that uses sockets to monitor network
>> ports.
>>
>> I want to ensure that the socket is closed cleanly in all
>> circumstances. This includes if the script is killed or interupted in
>> some other way.
On Tue, 04 Sep 2012 18:32:57 +0200, Johannes Bauer wrote:
> On 04.09.2012 04:17, Steven D'Aprano wrote:
>
>> On average, string equality needs to check half the characters in the
>> string.
>
> How do you arrive at that conclusion?
Take two non-empty strings of the same length, N. If the strin
A friend made me aware of this:
When a python beginner (2.x) quick searches for "print" on
docs.python.org, the print function doesn't even come up in the top 20
results. The print statement isn't even listed as far as I can tell.
Is there something that can be done about this to make it easi
On 9/4/2012 10:08 AM Sreenath k said...
Error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File
"/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/monitor.py",
line
2012.09.04. 19:08 keltezéssel, Sreenath k írta:
Error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File
"/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/monitor.py
Error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File
"/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/monitor.py",
line 575, in run
already_pickled=True)
File
On 04/09/2012 16:26, loial wrote:
I have threaded python script that uses sockets to monitor network
ports.
I want to ensure that the socket is closed cleanly in all
circumstances. This includes if the script is killed or interupted in
some other way.
As I understand it signal only works in the
On 04.09.2012 04:17, Steven D'Aprano wrote:
> On average, string equality needs to check half the characters in the
> string.
How do you arrive at that conclusion? When comparing two random strings,
I just derived
n = (256 / 255) * (1 - 256 ^ (-c))
where n is the average number of character co
Here is my example :
import cPickle
ParentClass = object # works
ParentClass = Exception # does not
class MyError(ParentClass):
def __init__(self, arg):
self.arg = arg
def __getstate__(self):
print '#DBG pass in getstate'
odict = self.__dict__.copy()
I have threaded python script that uses sockets to monitor network ports.
I want to ensure that the socket is closed cleanly in all circumstances. This
includes if the script is killed or interupted in some other way.
As I understand it signal only works in the main thread, so how can I trap
in
We invite participation and submissions to The International
Conference on Computing, Networking and Digital Technologies (ICCNDT
2012) that will be held at Gulf University, Sanad, Bahrain from Nov.
11-13, 2012. More details can be found at the conference's official
web site, visit http://sdiwc.net
> Personally, I wouldn't bother with SQLAlchemy for this. I'd just use
> Python as the front end, PostgreSQL for the database, and psycopg2
> for the interface.
Then you have to implement the entire logic, "event binding" etc.
yourself.
If you use e.g. Pypapi (the latest version), implementing
On Tuesday, September 4, 2012 8:16:33 AM UTC-4, Tim Williams wrote:
> On Sunday, August 26, 2012 9:23:49 PM UTC-4, Tim Roberts wrote:
>
> > Tim Williams wrote:
>
> >
>
> >
>
> >
>
> > >Hello all,
>
> >
>
> > >
>
> >
>
> > >I'm trying to use the ctypes module to call functions in a DL
On 03.09.12 15:32, Marco wrote:
Does anyone have an example of utilisation?
http://bugs.python.org/issue13424
--
http://mail.python.org/mailman/listinfo/python-list
On 04.09.12 04:13, Steven D'Aprano wrote:
Why does the open builtin need this added complexity? Why not just call
os.open directly? Or for more complex openers, just call the opener
directly?
What is the rationale for complicating open instead of telling people to
just call their opener directly
On Sunday, August 26, 2012 9:23:49 PM UTC-4, Tim Roberts wrote:
> Tim Williams wrote:
>
>
>
> >Hello all,
>
> >
>
> >I'm trying to use the ctypes module to call functions in a DLL. I've
>
> >figured out how to modify my path so the library is found, and I can
>
> >call LoadLibrary on it, b
Roy Smith writes:
> There's been a bunch of threads lately about string implementations, and
> that got me thinking (which is often a dangerous thing).
>
> Let's assume you're testing two strings for equality. You've already
> done the obvious quick tests (i.e they're the same length), and you
how do I know if a JTextField has the focus?
thank to all
--
http://mail.python.org/mailman/listinfo/python-list
Laszlo Nagy writes:
> but a threaded server cannot handle 100+ simultaneous (long running)
> requests, because that would require 100+ threads to be running.
On a reasonable server these days, 100 threads seems to be no big deal.
I've run several times that many. I think things get ragged at a f
On 04/09/2012 02:54, Roy Smith wrote:
There's been a bunch of threads lately about string implementations, and
that got me thinking (which is often a dangerous thing).
Let's assume you're testing two strings for equality. You've already
done the obvious quick tests (i.e they're the same length)
On 04/09/2012 05:56, Dan Sommers wrote:
That said, if I really wanted bloodshed, I would propose = for the third
string-equality operator! ;-)
Dan
Dan "agent provocateur" Sommers? :)
--
Cheers.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
What's wrong is the 1,135,775 calls to "method 'poll' of
'select.epoll' objects".
I was affraid you are going to say that. :-)
With five browsers waiting for messages over 845 seconds, that works
out to each waiting browser inducing 269 epolls per second.
Almost equally important is what the
70 matches
Mail list logo