Re: Read a gzip file from inside a tar file

2004-12-13 Thread Rohit
if I change fileText = fileLike.read() to fileText =
fileLike.readLines().

It works for a while before it gets killed of out of memory.

These are huge files. My goal is to analyze the content of the gzip
file in the tar file without having to un gzip.  If that is possible.

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


monitoring the filesystem for changes

2007-06-02 Thread rohit
hello,
i have designed a desktop search utility in python and a file system
monitoring using readdirectorychangesw from win32api but for eg. it
has a high cpu utilization (using a 2GHz processor).
a solution ntfs change journal proposed here works only for ntfs
partitions
is there another low (processor) cost alternative that works on fat32
partitions as well.
Rohit

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


Re: monitoring the filesystem for changes

2007-06-03 Thread rohit
hello
well in my implementation of readdirectorychangesw i am using
threading that is multiple programs run simultaneously each program
monitoring one drive for changes.
is their a way around this...one program for all drives?
thanks
rohit

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


service for file monitoring

2007-04-20 Thread rohit
hi,
i am designing a desktop search engine using python.
i am having a query , is there a package available that contains
functions for retrieving the files being edited , created,deleted  in
the file system.

thanks

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


Re: service for file monitoring

2007-04-20 Thread rohit
On Apr 21, 1:36 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 20 Apr 2007 17:06:51 -0300, rohit <[EMAIL PROTECTED]>
> escribió:
>
>
> For windows you can use the techniques described 
> here:http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_fo...
>
> --
> Gabriel Genellina

hi,
well i tried reading that but that way i'll have to make the program
monitor each and every directory.
when a file is created or deleted or filename modified , a call must
be made to the os kernel .
isn't there any way i can utilize that with any api or package
functions so that i can monitor the whole filesystem but at lesser
expense of cpu n memory

regards

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


randomly write to a file

2007-05-07 Thread rohit
hi,
i am developing a desktop search.For the index of the files i have
developed an algorithm with which
 i should be able to read and write to a line if i know its line
number.
i can read a specified line by using the module linecache
but i am struck as to how to implement writing to the n(th) line in a
file EFFICIENTLY
which means i don't want to traverse the file sequentially to reach
the n(th) line

Please help.
Regards
Rohit

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


Re: randomly write to a file

2007-05-07 Thread rohit
nick,
i just wanted to ask for time constrained applications like searching
won't sqlite be a expensive approach.
i mean searching and editing o the files is less expensive by the time
taken .
so i need an approach which will allow me writing randomly to a line
in file without using a database
On May 8, 2:41 am, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote:
> Rohit,
>
> Consider using an SQLite database. It comes with Python 2.5 and
> higher.  SQLite will do a nice job keeping track of the index. You can
> easily find the line you need with a SQL query and your can write to
> it as well. When you have a file and you write to one line of the
> file, all of the rest of the lines will have to be shifted to
> accommodate, the potentially larger new line.
>
> -Nick Vatamaniuc
>

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


Re: randomly write to a file

2007-05-07 Thread rohit
hi gabriel,
i am utilizing file names and their paths which are written to a file
on a singe line.
now if i use records that would be wasting too much space as there is
no limit on the no. of characters (at max) in the path.
next best approach i can think of is reading the file in memory
editing it and writing the portion that has just been altered and the
followiing lines
but is there a better approach you can highlight?

> You can only replace a line in-place with another of exactly the same
> length. If the lengths differ, you have to write the modified line and all
> the following ones.
> If all your lines are of fixed length, you have a "record". To read record
> N (counting from 0):
>a_file.seek(N*record_length)
>return a_file.read(record_length)
> And then you are reinventing ISAM.
>
> --
> Gabriel Genellina


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


too much memory use

2007-05-22 Thread rohit
hi ,
i am making a program for desktop search.
in order to make it more effective im implementing the records in the
form of a tree(files starting with 'a','b','c'have different
trees ..so 26 trees in all) in memory and writing it down in file.
the max size file has 16000 records...now to implement the tree in
list i'm using line no as index ..and empty child nodes are
represented as "\n"
all this work is going on in the memory..
problem is the system eats up my 512 mb RAM +1gb virtual store n hangs
cant think of an effective way to implement tree in memory(i can
compact it on disk by writing just the index no..along with the record
from which tree in memory can be reconstructed, but i have to
implement tree as previous to implement random access)
please help..
rohit sethi
delhi college of engineering

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


read file to a dictionary

2007-05-23 Thread rohit
i want to implement a dictionary in python
the query is :
without explicitly doing the following steps
1. reading from file to list
2. processing list to dictionary
 is there a module or a built in function that helps me "read" a file
directly into a dictionary
or any module that implements the above 2 steps

thanks
rohit

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


Re: read file to a dictionary

2007-05-24 Thread rohit
ohh i think i forgot to include intricate details
in dictionary i use the following:
value: name of a file existing on disk
Key : a unique number assigned to each file ,with no. assigned in
increasing order to file appearing earlier in the "english dictionary"
thanks
rohit

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


File monitoring for all drive

2007-05-24 Thread rohit
hi
i want to detect all file change operations(rename,delete,create)
on ALL THE DRIVES of the hard disk
using the method ReadDirectoryChanges API , i.e program no. 3 in the
webpage 
http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html
.
Please suggest some modification to the program so that i can detect
changes to ALL the drives
(to detect changes on c:\   set
path_to_watch = "." to "c:\\"   but this works for only one drive

thanks
rohit

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


Database intensive application

2007-08-11 Thread Rohit
I am a novice. I want to know whether Python can be used to develop
client/server database and web applications like .NET. Which is the
best book/source to learn Python?

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


newbie string conversion question

2006-04-01 Thread Rohit
As part of a proprietary socket based protocol I have  to convert a
string of length 10,

say, "1234567890"

to send it as 5 characters such that their hex values are

0x21 0x43 0x65 0x87 0x09

(Hex value of each character is got by transposing two digits at a
time)

 How can I do this in python? I would like the result to be available
as a string since I am concatenating it to another string before
sending it out. 

Thanks,
Rohit

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


Opportunity in Open-Source Development

2005-08-26 Thread Rohit, Careernet



Hi Madhu,
 
I came across your reference on the net 
and wanted to get in touch with you regarding an interesting possibility in the 
open-source space.
 
We are working with one of our client, 
which is starting its engineering operations in Bangalore. The focus is on 
building open source solutions.
 
The challenge for open source software is 
to provide the chain of accountability that IT organizations require for 
mission-critical systems. Open source offers direct access to source code and the engineers who wrote it, 
but the availability and cost of accessing such expert support varies widely. 
Enterprise IT customers need 
on-demand support, up-to-date 
documentation, and extreme reliability. Our client offers integrated, validated, 
and certified open source stacks with ongoing 
maintenance and enterprise-class support 
services. It also offers open source interoperability testing and management 
tools. They value and honor the efforts of the 
open source community, and are proud to 
contribute by extending open source efforts and by productizing open source 
solutions. This makes open source even more 
reliable, easy, and safe to 
deploy.
 
I would like to discuss this opportunity 
with you in detail. Please let me know if I can reach you on any number to 
discuss this. You can reach me at +91-9880731941
 
Looking forward to your 
response.
 
Regards,Rohit+91-9880731941
 
Contact us: [EMAIL PROTECTED]Visit us at www.careernet.co.in 
 BANGALORECareerNet Technologies Pvt. Ltd# 8, SBI Colony, 
7th "A" Main3rd Block, Koramangala ( On Sarjapur Road). Bangalore -- 560 
034. Voice :+91-80-51991599 (Board 
Number)  HYDERABADPlot #60, Chikoti Gardens, Begumpet, 
Hyderabad. Voice: +91-40-55332825. +91-93464-86575. 
 
 
-- 
http://mail.python.org/mailman/listinfo/python-list

Job opportunity - Sr. Python Developer - Morrisville, NC

2016-02-25 Thread Rohit Koul
Title: Senior Python Developer
Location: Morrisville, NC, United States
Contract : 6+ months

Description: 
Qualifications:

The Senior Python Developer will lead and serve as part of a team supporting 
established projects and creating products from the ground up. The ideal 
candidate is leader, a team player and is passionate about learning and 
applying their technical skills and experience to solve real-world problems.
Responsibilities:
- Contribute to the Architecture, Design and Development across the full stack 
of products.
- Work with multiple teams to guide and influence the architecture and design 
of the various products
- Investigating technologies that could benefit our development and success of 
our products

Thanks and regards,
Rohit

Rohit Koul 
Technical Recruiter
Email:[email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Current trends in python

2013-08-22 Thread Rohit Chormale
Dear friends,
can anybody help me to know latest trends in python...back,middle,front end 
softwares...frameworks etc
also how exactly python based projects are developed?
thank u
-- 
http://mail.python.org/mailman/listinfo/python-list


File System Redirection Windows x 64 box.

2009-05-15 Thread Rohit Srivastava
Hi,

In Windows 2003 x64, I want to call iscsicli.exe which is there only
in system32 directory.
Now since in x64 system windows actually redirect the 32 bit
application to sysWOW64 directory, if it is looking for system32. For
more information look for
<http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx >

Now my application is being redirected to this directory and from
python I am always getting an error saying, The program can not find
the file specified.

Any idea, how  can I overcome this, using python? (Condition :: I must
complie for 32 bit system only)
Thanks in Advance

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


Re: File System Redirection Windows x 64 box.

2009-05-15 Thread Rohit Srivastava
On May 15, 12:05 pm, Rohit Srivastava 
wrote:
> Hi,
>
> In Windows 2003 x64, I want to call iscsicli.exe which is there only
> in system32 directory.
> Now since in x64 system windows actually redirect the 32 bit
> application to sysWOW64 directory, if it is looking for system32. For
> more information look for
> <http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx>
>
> Now my application is being redirected to this directory and from
> python I am always getting an error saying, The program can not find
> the file specified.
>
> Any idea, how  can I overcome this, using python? (Condition :: I must
> complie for 32 bit system only)
> Thanks in Advance
>
> Regards
> Rohit

Apologies for the last statement in the previous post.
Please read it as (I need to comply with 32 bit Windows system also).

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


Re: Python-list Digest, Vol 77, Issue 7 *

2010-02-01 Thread Rohit Roger$
Hello
Help for datetime module

Source code is :
*from *datetime *import *datetime
d = datetime(datetime.now().year, datetime.now().month, datetime.now().day,
11, 59, 0 )
print d


On Mon, Feb 1, 2010 at 3:44 PM,  wrote:

>  Junk Score: 2 out of 10 (below your Auto Allow 
> threshold)
> | Approve sender  | Block
> sender  | Block
> domain 
>
> Send Python-list mailing list submissions to
>[email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
>[email protected]
>
> You can reach the person managing the list at
>[email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
> Today's Topics:
>
>   1. Re: whassup? builtins? python3000? Naah can't be right?
>  (Andrej Mitrovic)
>   2. gmtime (gazza)
>   3. Re: A performance issue when using default value (keakon)
>   4. Re: HTML Parser which allows low-keyed local changes?
>  (Stefan Behnel)
>   5. how long a Str can be used in this python code segment?
>  (Stephen.Wu)
>   6. Re: gmtime (Gary Herron)
>   7. Re: how long a Str can be used in this python code segment?
>  (Chris Rebert)
>   8. Re: how long a Str can be used in this python code segment?
>  (Gary Herron)
>   9. Re: Keyboard input (Dennis Lee Bieber)
>  10. Re: how long a Str can be used in this python code segment?
>  (Stephen.Wu)
>  11. Re: how long a Str can be used in this python code segment?
>  (Stefan Behnel)
>  12. Re: PEP 3147 - new .pyc format (Daniel Fetchinson)
>
>
> -- Forwarded message --
> From: Andrej Mitrovic 
> To:
> Date: Sun, 31 Jan 2010 20:01:57 -0800 (PST)
> Subject: Re: whassup? builtins? python3000? Naah can't be right?
> Hey, it's really simple! Just like the excerpt from the Learning
> Python book says:
>
> "Really, the built-in scope is just a built-in module called builtins,
> but
> you have to import builtins to query built-ins because the name
> builtins is not itself
> built-in"
>
> :)
>
>
>
> -- Forwarded message --
> From: gazza 
> To:
> Date: Sun, 31 Jan 2010 13:27:46 -0800 (PST)
> Subject: gmtime
> Hi,
>
> I am trying to discover how to obtain the correct time of say CST/
> America and EST/America in python?
>
> Any help on this would be appreciated.
>
>
> Thanks,
> Garyc
>
>
>
> -- Forwarded message --
> From: keakon 
> To:
> Date: Sun, 31 Jan 2010 21:20:28 -0800 (PST)
> Subject: Re: A performance issue when using default value
> Even this style is 41 times faster than h2():
>
> def i2(x=[]):
>  y = x
>  if not y: # add this line
>y = []  # add this line
>  y.append(1)
>  return y + []
>
> print Timer('i2()','from __main__ import f2, g2, h2, i2').timeit
> (TIMES)
>
> Time: 0.00742356919664
>
>
>
> -- Forwarded message --
> From: Stefan Behnel 
> To:
> Date: Mon, 01 Feb 2010 09:34:28 +0100
> Subject: Re: HTML Parser which allows low-keyed local changes?
> Robert, 31.01.2010 20:57:
> > I tried lxml, but after walking and making changes in the element tree,
> > I'm forced to do a full serialization of the whole document
> > (etree.tostring(tree)) - which destroys the "human edited" format of the
> > original HTML code. makes it rather unreadable.
>
> What do you mean? Could you give an example? lxml certainly does not
> destroy anything it parsed, unless you tell it to do so.
>
> Stefan
>
>
>
> -- Forwarded message --
> From: "Stephen.Wu" <[email protected]>
> To: [email protected]
> Date: Mon, 1 Feb 2010 01:17:09 -0800 (PST)
> Subject: how long a Str can be used in this python code segment?
> tmp=file.read() (very huge file)
> if targetStr in tmp:
>print "find it"
> else:
>print "not find"
> file.close()
>
> I checked if file.read() is huge to some extend, it doesn't work, but
> could any give me some certain information on this prolbem?
>
>
>
>
> -- Forwarded message --
> From: Gary Herron 
> To: "[email protected]" 
> Date: Mon, 01 Feb 2010 01:23:31 -0800
> Subject: Re: gmtime
> gazza wrote:
>
>> Hi,
>>
>> I am trying to discover how to obtain the correct time of say CST/
>> America and EST/America in python?
>>
>> Any help on this would be appreciated.
>>
>>
>> Thanks,
>> Garyc
>>
>>
> The datetime module should give you all you need.
>
> Gary Herron
>
>
>
>
>
> -- Forwarded message --
> From: Chris Rebert 
> To: "Stephen.Wu" <[email protected]>
> Date: Mon, 1 Feb 2010 01:26:55 -0800
> Subject: Re: how long a Str can be used in this python code segment?
> On Mon, Feb 1, 2010 at 1:17 AM, Stephen.Wu <[email protected]> wrot

RE: Qt with PyDev

2011-01-05 Thread Rohit Coder

Seen both, but do I need to install the binaries or add a link in Pydev to 
PySide source-code?

Date: Tue, 4 Jan 2011 07:09:53 -0800
From: [email protected]
To: [email protected]
Subject: Re: Qt with PyDev



  



  
  
On 01/04/2011 12:00 AM, RP Khare wrote:

  
  I installed Aptana PyDev plugin to Aptana Studio 3 Beta. I want to
  write my first GUI application using Python and I want to use Qt
  for it. How to integrate Qt into PyDev, or is there any other
  alternative IDE to work with Qt?
  
element

  

  Font


  font-family
  


  font-size
  


  font-style
  


  font-variant
  


  font-weight
  


  letter-spacing
  


  line-height
  


  text-decoration
  


  text-align
  


  text-indent
  


  text-transform
  


  white-space
  


  word-spacing
  


  color
  


  Background


  bg-attachment
  


  bg-color
  


  bg-image
  


  bg-position
  


  bg-repeat
  


  Box


  width
  


  height
  


  border-top
  


  border-right
  


  border-bottom
  


  border-left
  


  margin
  


  padding
  


  max-height
  


  min-height
  


  max-width
  


  min-width
  


  outline-color
  


  outline-style
  


  outline-width
  


  Positioning


  position
  


  top
  


  bottom
  


  right
  


  left
  


  float
  


  display
  


  clear
  


  z-index
  


  List


  list-style-image
  


  list-style-type
  


  list-style-position
  


  Table


  vertical-align
  


  border-collapse
  


  border-spacing
  


  caption-side
  


  empty-cells
  


  table-layout
  


  Effects


  text-shadow
  


  -webkit-box-shadow
  


  border-radius
  


  Other


  overflow
  


  cursor
  


  visibility
  

  

  
  

  
  ...
  Rohit



See either of these packages:

  PyQt: http://qt.nokia.com/products/

  PySide: http

Attaching C++ libraries to Python app.

2011-01-05 Thread Rohit Coder

Is it possible to use C++ libraries within a Python application? I am planning 
to write an encryption program and want to use GnuPG C++ 
libraries.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
...Rohit.   
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Attaching C++ libraries to Python app.

2011-01-05 Thread Rohit Coder

I am just asking. In future I may need to import any C++ library, not a Crypto, 
but some other. Is it possible?

> Date: Wed, 5 Jan 2011 22:44:15 +0100
> Subject: Re: Attaching C++ libraries to Python app.
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> 
> You don't need to reinvent the wheel:
> 
> http://www.dlitz.net/software/pycrypto/
> 
> Am Mi, 5.01.2011, 22:21 schrieb Rohit Coder:
> >
> > Is it possible to use C++ libraries within a Python application? I am
> > planning to write an encryption program and want to use GnuPG C++
> > libraries.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
> > ...Rohit.   
> >   --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> 
> 
> -- 
> MfG,
> 
> Stefan Sonnenberg-Carstens
> 
> IT Architect
elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
  -- 
http://mail.python.org/mailman/listinfo/python-list


How suitable is Python to write system utilities?

2011-01-06 Thread Rohit Coder

Is Python suitable to write low-level system utilities like Defrag, Malware 
Removal Tools and Drivers?
  -- 
http://mail.python.org/mailman/listinfo/python-list


Working with PyQt and Pydev

2011-01-06 Thread Rohit Coder

I installed the PyDev plugin into Aptana Stdui 3 Beta. Someone suggested me to 
use PyQt for Python GUI app, and so I downloaded and installed PyQt. But when I 
open Aptana Studio, I could see a new menu added with the name "PyDev", but 
there is nothing for PyQt.
In the Windows Start Meny item list, I could see a folder named PyQt and when I 
open it, there are few tools like Designer.
When Designer is run, it opens Qt IDE for designing Forms like Visual Studio 
and the files have the extension .ui.I want to know how to integrate PyQt and 
PyDev. Do I need to use them separately by adding the .ui files to PyDev and 
then adding Python core code for functionality?
...Rohit.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
 -- 
http://mail.python.org/mailman/listinfo/python-list


Create a class to position a window on the screen.

2011-01-08 Thread Rohit Coder

Hi,elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
I am new to Python and this is my fist Python class. I am using PyQt4 framework 
on Windows 7.
I don't know whether the code below is correctly written or not. I want to 
modify it further as:
 1. In the arguments, I want to pass the name of another opened Window (.py) on 
the screen. 2. I want to pass the x-coord., y-coord. and the name of the window 
to position on the screen.
How to modify the code to fulfill these requirements?
**Attempted Code**
class PositionWindow:def __init__(self, xCoord, yCoord, windowName, 
parent = None):  self.x = xCoord  self.y = yCoord  
self.wName = windowName;def center(self):screen 
= QtGui.QDesktopWidget().screenGeometry()size = self.geometry() 
   self.move((screen.width()-size.width())/2, 
(screen.height()-size.height())/2)
...Rohit.
  -- 
http://mail.python.org/mailman/listinfo/python-list


Centering a window

2011-01-10 Thread Rohit Coder

I am using PyQt4 for GUI apps.
I created a class that contains a function to center any window (Form) whose 
name is passed to this class. I have two questions:
How to modify the below given code to center the window whose name we passed as 
an argument.How to pass window name to this class from another file that 
imports this class?
= CODE BLOCK STARTS HERE ===from PyQt4 import QtGui
class PositionWindow:def __init__(self, xCoord, yCoord, windowName, parent 
= None):  self.x = xCoord  self.y = yCoord  self.wName = 
windowName;def center(self):screen = 
QtGui.QDesktopWidget().screenGeometry()size = self.geometry()
self.move((screen.width()-size.width())/2, 
(screen.height()-size.height())/2)= CODE BLOCK ENDS HERE ===
Rohit 
K.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
  -- 
http://mail.python.org/mailman/listinfo/python-list