Re: GUI components in python

2012-03-08 Thread hackingKK

Hi Janaki,
Python will mostly use either the pygtk library or pyqt library for any 
rich and production quality GUI.

So you must try figuring out if either of these 2 libraries are used.
Other than this, there is tkinter which i guess comes with Python as 
default.

Happy hacking.
Krishnakant.


On 07/03/12 19:14, janaki rajamani wrote:

Hi

I am stuck with the brain workshop software implemented using python.
The code involves a lot of GUI elements and i am familar only with the
basic python programming.
I would like to know whether there are built in classes to support GUI
elements or arethey project dependant.



--
http://mail.python.org/mailman/listinfo/python-list


Re: Hot Girls are Looking for Sex

2011-08-20 Thread hackingKK
Well, they might be indented in the right places but i don't know if 
loops, conditions, functions, if they all happen or not.

:)
Happy hacking.
Krishnakant,

On 20/08/11 01:47, Matty Sarro wrote:

That's great - but do they program in python?

On Fri, Aug 19, 2011 at 2:38 PM, Sajjad Ahmadsajjad.ahmad...@gmail.com  wrote:

See All details on

http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html

.

See All details on

http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html

.

See All details on

http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html

.

See All details on

http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html

.

See All details on

http://hotelandtourism9.blogspot.com/2011/08/indian-hotels-wall-st-effect.html

.

--
http://mail.python.org/mailman/listinfo/python-list



--
http://mail.python.org/mailman/listinfo/python-list


can I use element tree for handling special characters in xml text?

2011-07-27 Thread hackingKK

Hello all.
I have been waiting a lot to ask this question and I did ask some days 
back but probably could not put it the proper way.
I want to know how I can safely include special characters like  or  
in xml text?

For example I store a small xml file containing list of organisations.
Many   names have an   in the name as in brian  turner.
so the xml noad will be orgname brian  turner /orgname
But I know this won't work directly.
my code naturally fails when I try to insert such data.
Can any one suggest the right way of parsing this kind  of strings and 
treat  like characters as part of the literal string?

Hope my question is clear this time.
Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Aw: Re: Aw: python.org back up ?(was Re: python.org is down?)

2011-07-25 Thread hackingKK
Infact the  first thing I ever did  with documentation on Python was to 
download it.
yes you are not uptodate but you can always do a download once in a 
while rather than putting load on the server every time you want to 
lookup a function reference.

Happy hacking.
Krishnakant.

On 25/07/11 14:32, David Zerrenner wrote:

Carl Banks wrote:

If you can't live without the docs, you should consider downloading them and 
accessing them locally.  That'll let you work whenever python.org goes down, 
and will help keep the load off the server when it's up.

Thanks for the pointer, i did not realize that until now... These days of 
always-on internet corrupted me so much.



--
http://mail.python.org/mailman/listinfo/python-list


how to get Python to insert special characters in an xml file?

2011-07-15 Thread hackingKK

Hello all.
I am currently developing a python application which reads and writes 
some data to an xml file.

I use the elementTree library for doing this.
My simple question is that if I have some thing like  as in kk  
company  as organisation name, how can I have Python take this as a 
litteral string including the  sign and put in the orgname /orgname 
tag?
Even same applies while reading the file.  I would like to have the  
come as a part of the literal string.

Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


can I package a distutil based python app in deb?

2011-06-26 Thread hackingKK

Hello all,
I guess the subject line says it all.
I want to package a python app to deb.
I have 3 interesting issues with it.
1, I would want it to run on Ubuntu 10.04, Ubuntu 10.10, Ubuntu 11.04 
and Debian 5.
2, the package depends on another python package which is also distutil 
based.

3, The second package needs to run in a virtual environment.
This means that I not only have to figure out the dependencies but also 
have the deb to include a script to get the virtual environment script, 
then create one for the package, then download all dependencies (Pylons 
0.9.7 in this case along with report lab) and finally put the package 
into this virtual environment.

Is this all possible?
Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


Re: python in school notebooks/laptops

2011-05-30 Thread hackingKK


On 30/05/11 15:45, John Thornton wrote:

Hello
Is it a waste of time to try to get school admins to put 
python in their school laptops?


   OK. Here's the crib for the rest[!] of the world. Here in 
Australia most secondary schools [that is kids from age approx 12-18] 
have some sort of netbook/laptop program. I have looked at a few 
schools and they put visual basic in  but not python. [unless of 
course it's a mac where python may already be in it] . This is a 
curious omission when Blender needs python to run.


Even better, try convincing them to use Ubuntu instead of  a virus 
called Where I Never Do Operations With Safety, or WINDOWS for short.

That way Python will come by default  and VB will be out of question
Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Need the list of XML parsers

2011-01-17 Thread hackingKK

Hi Venu,
Use element tree module.
This comes with Python itself and does all that you need with presision.
I have already used it and it does a very very good job.
Happy hacking.
Krishnakant.

On 17/01/11 23:05, Venu wrote:

Hi,

I am getting into serious Python programming for Electronic CAD tools,
I am trying to find the best XML parser modules available. I need good
searching capability for attributes, nodes and block of XML. I am
looking for either a recommendation or previous forum links.

Thanks
Venu
   


--
http://mail.python.org/mailman/listinfo/python-list


no line breaks in xml file with elementTree

2010-10-31 Thread hackingKK

Hello all.
I want to know if there is a way to have the ElementTree module write to 
an xml file with line breaks?
I find that when I use the write function from the module on a tree 
object, the resulting file has no line breaks.  I don't want to use 
prittyprint because it is adding extra tabs to the file and they are 
either counted as extra nodes or in case of element.text with 
elementtree, they are rendered as a part of the text, both being 
impractical results.
So is there a middle approach where we can have some  thing similar to 
prityprint but without the extra tabs and yet having a properly line 
breaked xml file?
Further more, I just was curious why elementtree is not having the 
namespace facility?

xml.dom.minidom has a way to generate tags with namespaces.
Any thing similar in elementTree?

happy hacking.
Krishnakant.



--
http://mail.python.org/mailman/listinfo/python-list


Re: no line breaks in xml file with elementTree

2010-10-31 Thread hackingKK

On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote:

In messagemailman.412.1288509358.2218.python-l...@python.org, hackingKK
wrote:

   

I want to know if there is a way to have the ElementTree module write to
an xml file with line breaks?
 

Why does it matter? The XML files you generate are not for humans to look
at, are they?
   


So is there a function to generate tags with namespace?

happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


is elementTree really a part of python 2.6?

2010-10-28 Thread hackingKK


Hello all,
Some days back I had asked a few questions about parsing xml files using 
python.
I have tryed dom.minidom module but I did not like the prittyPrint way 
of writing nodes.
There were many other things I did not quite like about dom.minidom, so 
now trying to use elementTree.
But to my surprise, I could not import xml.elementtree in my default 
python 2.6 setup.

is it possible that I have broken some thing?
I had to later on do an easy_install for elementree.
But I hear that elementtree is a part of python?
So has my import gone wrong?  or is some thing broken in my python setup?

happy hacking.
Krishnakant.


--
http://mail.python.org/mailman/listinfo/python-list


how to write an xml file without dom.ext?

2010-10-07 Thread hackingKK

Hello all.
I need to create an xml file.
I am using dom.minidom module.
It works fine as long as the xml tree is created.
But I get the import error for dom.ext.
I searched through the python docs but can't find a solution.
I am pritty sure that there is way to write the file to disk without 
using the ext module.
Since there are so many software doing this with python 2.6 I am sure it 
works.
So can some one tell me if there is a way to avoide ext and prittyprint 
and still write a file to the disk?


Happy hacking.
Krishnakant.




--
http://mail.python.org/mailman/listinfo/python-list


Re: how to write an xml file without dom.ext?

2010-10-07 Thread hackingKK

On Thursday 07 October 2010 03:49 PM, Nitin Pawar wrote:
why not just convert it to string with print pretty and then normal 
write to a file




Can you give an example.

happy hacking.
Krishnakant.

On Thu, Oct 7, 2010 at 3:36 PM, hackingKK hackin...@gmail.com 
mailto:hackin...@gmail.com wrote:


Hello all.
I need to create an xml file.
I am using dom.minidom module.
It works fine as long as the xml tree is created.
But I get the import error for dom.ext.
I searched through the python docs but can't find a solution.
I am pritty sure that there is way to write the file to disk
without using the ext module.
Since there are so many software doing this with python 2.6 I am
sure it works.
So can some one tell me if there is a way to avoide ext and
prittyprint and still write a file to the disk?

Happy hacking.
Krishnakant.




-- 
http://mail.python.org/mailman/listinfo/python-list





--
Nitin Pawar



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Should I Learn Python or Ruby next?

2010-06-23 Thread hackingKK
Ruby is a nice language to learn, but I seem to find it less matured.  
That might be my own personal perception.
But looking at its success which you can read on Pythonology, I think it 
is going to be my choice and of many others for a long time to come.

Besides ruby is more popular due to the rails attached to it.
Happy hacking.
Krishnakant.

On Wednesday 23 June 2010 02:10 PM, Jean-Michel Pichavant wrote:

rantingrick wrote:

---

On Jun 22, 4:29 am, Jean-Michel Pichavant jeanmic...@sequans.com
wrote:
This is a python list, fully dedicated to our dutch semi God. So how 
can

you even immagine that someone here will suggest you to go for rub...
sorry I can't prononce this blasphemous name.


---


...After reading these comments i reminisce back to a time when a good
friend of this community r said basically the same things but was
lynched for them. 


That's because r is the first letter of Ruby, try p and everybody 
will love you (that makes me think that Perl should be renamed as it 
outrageously share the same 1st character with Python).


JM

PS : I have no idea about Ruby, never used it, so I still don't 
understand why you quote me in  your anti-ruby post


--
http://mail.python.org/mailman/listinfo/python-list


any python libraries for rendering open office spreadsheet to html

2010-03-16 Thread hackingKK

Hello,
Is there a python library which can render ods to html.
(I would even prefer javascript library to do this).
The reason I am more interested in a python library is because, I am 
developing a web application in pylons.
It is a financial software and initially on the desktop based client, I 
used odfpy to create spreadsheets.

But now I would want to render those sheets to the web front end.

Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


Re: xml-rpc

2010-03-14 Thread hackingKK

Instead of using the library directly,
isn't python-twisted a better choice?

happy hacking.
Krishnakant.

On Sunday 14 March 2010 03:47 PM, Martin P. Hellwig wrote:

On 03/14/10 08:14, ahmet erdinc yilmaz wrote:

Hello,

Recenetly we are developing a senior project and decide to use 
xmlrpclib.

However I have some questions. In the documentation I could not find any
clue about
handling requests? Does the server handles each request in a separate
thread? Or is
there some queuing mechanism for client calls? Thanks in advance.


--erdinc


How I usually tackle stuff like this:
[mar...@aspire8930 /usr/home/martin]$ python
Python 2.6.4 (r264:75706, Jan 31 2010, 20:52:16)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type help, copyright, credits or license for more information.
 import SimpleXMLRPCServer
 help(SimpleXMLRPCServer)
read it and somewhere at CLASSES it says
CLASSES

BaseHTTPServer.BaseHTTPRequestHandler(SocketServer.StreamRequestHandler)
SimpleXMLRPCRequestHandler
SimpleXMLRPCDispatcher
CGIXMLRPCRequestHandler
SimpleXMLRPCServer(SocketServer.TCPServer, 
SimpleXMLRPCDispatcher)

SocketServer.TCPServer(SocketServer.BaseServer)
SimpleXMLRPCServer(SocketServer.TCPServer, 
SimpleXMLRPCDispatcher)


Aah so it is based on SocketServer, lets have a look at that:

 import SocketServer
 help(SocketServer)
Help on module SocketServer:
reading it and then it says

There are five classes in an inheritance diagram, four of which 
represent

synchronous servers of four types:

++
| BaseServer |
++
  |
  v
+---++--+
| TCPServer |---| UnixStreamServer |
+---++--+
  |
  v
+---+++
| UDPServer |---| UnixDatagramServer |
+---+++

So the base of all these servers is BaseServer, hmm somebody must have 
a laugh right now :-)


Okay lets have a look at that then:

 import BaseServer
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named BaseServer

Hmmm okay, lets have a look at the SocketServer source itself then, 
but where is it?

 SocketServer.__file__
'/usr/local/lib/python2.6/SocketServer.pyc'

I bet that the non compiled file is in the same directory, let's have 
a look at it with less.


 quit()
[mar...@aspire8930 /usr/home/martin]$ less 
/usr/local/lib/python2.6/SocketServer.py


And there it says among other interesting stuff:

# The distinction between handling, getting, processing and
# finishing a request is fairly arbitrary.  Remember:
#
# - handle_request() is the top-level call.  It calls
#   select, get_request(), verify_request() and process_request()
# - get_request() is different for stream or datagram sockets
# - process_request() is the place that may fork a new process
#   or create a new thread to finish the request
# - finish_request() instantiates the request handler class;
#   this constructor will handle the request all by itself

def handle_request(self):
Handle one request, possibly blocking.

Respects self.timeout.

# Support people who used socket.settimeout() to escape
# handle_request before self.timeout was available.
timeout = self.socket.gettimeout()
if timeout is None:
timeout = self.timeout
elif self.timeout is not None:
timeout = min(timeout, self.timeout)
fd_sets = select.select([self], [], [], timeout)
if not fd_sets[0]:
self.handle_timeout()
return
self._handle_request_noblock()

def _handle_request_noblock(self):
Handle one request, without blocking.

I assume that select.select has returned that the socket is
readable before this function was called, so there should be
no risk of blocking in get_request().

try:
request, client_address = self.get_request()
except socket.error:
return
if self.verify_request(request, client_address):
try:
self.process_request(request, client_address)
except:
self.handle_error(request, client_address)
self.close_request(request)


I leave the remaining parts of your question as an exercise :-)



--
http://mail.python.org/mailman/listinfo/python-list


Re: When will Python go mainstream like Java?

2010-02-23 Thread hackingKK

On Tuesday 23 February 2010 03:10 PM, Richard Lamboj wrote:

Am Tuesday 23 February 2010 09:07:43 schrieb Krister Svanlund:
   

On Tue, Feb 23, 2010 at 1:01 AM, Edward A. Falkf...@mauve.rahul.net
 

wrote:
   

You mean it's not?

--
-Ed Falk, f...@despams.r.us.com
http://thespamdiaries.blogspot.com/
   

Javas popularity was very much a product of its time. It was something
new and exciting and people got a bit too excited maybe, Python just
does the same thing but better really, therefor it will not become as
popular.
 

Good morning,

i don't like Java/JSP, the synthax is blown up and the programs are damn slow.
For ecllipse you should buy a cluster. There is C/C++/D, Python, Ruby,
Gambas, TCL, PHP, SmallTalk and some other nice Programming Languages, so i
don't understand why people use Java. Java is the one an only OOP Language,
the best one - Yeah and whats with multiple inheritance? I'am in love with
Python ;-)
   


There are a few reasons why we don't see python as a buz word.  Java 
was well marketed and the time when it came out with libraries like 
swing, there was no popularly known alternative.
As a matter of fact I don't really go by popularity with technologies, 
specially when it comes to programming languages.
Just show me 2 or 3 big apps or web sites which are scalable and take 
multiple requests.  show me just 2 instances where heavy number 
crunching is done efficiently and I am convinced.
I don't care how many apps are developed using java as long as they 
remain heavy and slw.

google runs on python and so do many other big applications.
marketing is more about exaggeration, which Sun did for Java.
Python was always in the hands of programmers who wanted their work done 
and wanted scalable apps.
So the conclusion is that all that is popular need not be good for 
every thing .


Happy hacking.
Krishnakant.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Ruby

2010-01-27 Thread hackingKK

On Thursday 28 January 2010 08:11 AM, rantingrick wrote:

On Jan 27, 5:31 pm, Jonathan Gardnerjgard...@jonathangardner.net
wrote:

   

To add to that, Python is the type of language where experienced
programmers can pick it up by reading code, and newbies won't get
hopelessly lost. I've taught less-than-formal introductory programming
classes to people who are new to programming. Python gets out of the
way, and allows you to focus on the programming concepts, such as
variable, functions, parameters, classes, and algorithms.
 

Well said Jonathan!! Well said!! (both posts)
   


I share the same experience.
As pointed out in the how to think like a computer scientist in Python 
I found that when I was teaching first time programmers, Python was the 
best choice.


Not just the clean syntax but preciseness of the language itself was 
very helpful.
as I callit get in get your work done and get out! methodology works 
very well for absolute beginner students for programming.
new comers to this list might be happy to note that python reads very 
closely to spoken English.
But I want to add more.  while it is great tool for beginners, it is a 
power box for advanced users who have the attitude of cut the crap off 
and come to the point For such programmers python is extremly good,
I teach all types of students and now have convinced a few univercities 
here in India to include python in engineering curriculam.



Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Is python not good enough?

2010-01-15 Thread hackingKK

On Saturday 16 January 2010 08:01 AM, Nobody wrote:

On Fri, 15 Jan 2010 12:34:17 -0800, John Nagle wrote:

   

 Actually, no.  It's quite possible to make a Python implementation that
runs fast.  It's just that CPython, a naive interpreter, is too primitive
to do it.  I was really hoping that Google would put somebody good at
compilers in charge of Python and bring it up to production speed.
production?
 




 Look at Shed Skin, a hard-code compiler for Python
 

A hard-code compiler for the subset of Python which can easily be compiled.

Shed Skin has so many restrictions that it isn't really accurate to
describe the language which it supports as Python.
+1
   




Hardly any real-world Python code can be compiled with Shed Skin. Some of
it could be changed without too much effort, although most of that is the
kind of code which wouldn't look any different if it was implemented in
C++ or Java.
   



Happy hacking.
Krishnakant.

--
http://mail.python.org/mailman/listinfo/python-list