python gui ide under linux..like visual studio ;) ?

2010-01-19 Thread ryniek90



Il 18/01/2010 21:59, Mike Driscoll ha scritto:
   

>  On Jan 18, 8:32 am, ted  wrote:
 

>>  Hi at all...
>>  Can someone please give me some advice, about a good IDE with control
>>  GUI under Linux ?
>>
>>  Actually i know QT Creator by Nokia which i can use with Python (but i
>>  don't know how).
>>
>>  And, a good library for access to database (mysql, sql server, oracle) ?
>>
>>  Thank you very much !
>>
>>  bye
   
>  
>  Check out Dabo for the database stuff:http://dabodev.com/
>  
>  There is nothing like Visual Studio. The closest I've found are things

>  like the QT Creator and wxGlade / Boa Constructor / wxFormBuilder. I
>  know I've heard of another one that was commercial, but I can't recall
>  the name at the moment.
>  
>  ---

>  Mike Driscoll
>  
>  Blog:http://blog.pythonlibrary.org
>  
>  PyCon 2010 Atlanta Feb 19-21http://us.pycon.org/
 

Thank you very much.

Bye!


   


Hi, check this Python Wiki pages:
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments

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


"Advanced" Python programming book?

2010-01-10 Thread Ryniek90

> I've just finished reading a sort of beginner Python book, and I know 
> quite a bit now but I'm looking for a book that can teach me advanced 
> aspects of Python - code optimisation, threading, etc.
>
> Any recommendations?
>
> Cheers.
Check those link:
http://www.amazon.com/Beginning-Python-Visualization-Transformation-Professionals/dp/1430218436/ref=sr_1_11?ie=UTF8&s=books&qid=1263136036&sr=1-11

http://www.amazon.com/Gray-Hat-Python-Programming-Engineers/dp/1593271921/ref=sr_1_12?ie=UTF8&s=books&qid=1263136036&sr=1-12

http://www.amazon.com/Python-Cookbook-Alex-Martelli/dp/0596007973/ref=sr_1_4?ie=UTF8&s=books&qid=1263136036&sr=1-4

http://www.amazon.com/High-Performance-Python-Anthony-Lewis/dp/0596522088/ref=sr_1_14?ie=UTF8&s=books&qid=1263136082&sr=1-14

http://www.amazon.com/Natural-Language-Processing-Python-Steve/dp/0596516495/ref=sr_1_16?ie=UTF8&s=books&qid=1263136082&sr=1-16

http://www.amazon.com/Python-Scripting-Computational-Science-Engineering/dp/3540739157/ref=sr_1_17?ie=UTF8&s=books&qid=1263136082&sr=1-17

http://www.amazon.com/Expert-Python-Programming-practices-distributing/dp/184719494X/ref=sr_1_20?ie=UTF8&s=books&qid=1263136082&sr=1-20

http://www.djangobook.com/


Similar topics you can find in Google.
Check python technologies, like: PyCuda, SciPy, NumPy, PyGame, Django,
Pylons, Zope, TurboGears, Twisted, PyGTK, PyQt and so on.

Check this link: http://www.python.org/about/apps/  and this
http://wiki.python.org/moin/

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


Is pythonic version of scanf() or sscanf() planned?

2009-10-13 Thread ryniek90




In article ,
ryniek90   wrote:
  

But I remember that lambda function also was unwelcome in Python, but
finally it is and is doing well. So maybe someone, someday decide to
put in Python an alternative, really great implementation of scanf() ?



How long have you been using Python?  lambda has been there almost from
the beginning.
  


Otherwise - community wanted to kick of lambda, but ultimately left it.
Yes, i made mistake - lambda is almost from the beginning.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread ryniek90
On 6 Paź, 06:37, Dennis Lee Bieber  wrote:
> On Sun, 4 Oct 2009 15:48:16 -0700 (PDT), TerryP 
> declaimed the following in gmane.comp.python.general:
>
> > In the last 4 years, I have never missed functions like .*scanf() or
> > atoi().
>
> > It's probably a greeaaat thing that Python provides nether as built
> > ins (per se).
>
>         Uhm... Isn't the second one spelled "int()" 
> --
>         Wulfraed         Dennis Lee Bieber               KD6MOG
>         wlfr...@ix.netcom.com      HTTP://wlfraed.home.netcom.com/



Ok thanks all for answers. Not counting .split() methods and regexps,
there's nothing interesting.
But I remember that lambda function also was unwelcome in Python, but
finally it is and is doing well. So maybe someone, someday decide to
put in Python an alternative, really great implementation of scanf() ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Is pythonic version of scanf() or sscanf() planned?

2009-10-03 Thread ryniek90

Hi

I know that in python, we can do the same with regexps or *.split()*, 
but thats longer and less practical method than *scanf()*. I also found 
that ( http://code.activestate.com/recipes/502213/ ), but the code 
doesn't looks so simple for beginners. So, whether it is or has been 
planned the core Python implementation of *scanf()* ? (prefered as a 
batteries included method)


Thanks for any helpful answers.
--
http://mail.python.org/mailman/listinfo/python-list


Python and 3d

2009-09-13 Thread Ryniek90

>
> azrael wrote:
>   
>> Has anyone any exipience with python and 3d.
>>
>> I mean, is there a module to deal with popular 3d formats like 3ds, or
>> vrml. is it possible to import into python opengl models and then use
>> it in application for GUI purposes like through WX. I know that WX
>> supports OpenGL but how to import models from file.
>>   
>> 
> http://www.vrplumber.com/py3d.py
>
> There's a few older projects to load 3DS files, but I don't think any of
> them is currently PyOpenGL 3.x compatible.  OpenGLContext loads VRML97
> files (with SimpleParse installed).  Pyglet, OpenGLContext and Ian
> Mallet's game engine all load .obj models (I believe Ian's engine is the
> most advanced there).  Pivy should load VRML files as well, and has a
> very powerful engine (COIN) under the covers (OpenGLContext is more of a
> demo/testing system).  The big engines (Ogre, Soya, OpenSceneGraph,
> Crystal Space, etc) should all have content loaders, though I haven't
> played with them enough to be able to say what formats they support.
>
> HTH,
> Mike
>
>   

Maybe check out:

- Panda3D ( http://www.panda3d.org/ ),
- PyGame ( http://www.pygame.org/news.html ),
- PyKyra ( http://www.alobbs.com/pykyra ),
- PyOpenGL ( http://pyopengl.sourceforge.net/ ),

or

Blender ( http://www.blender.org/ ).

All above deserve attention.
-- 
http://mail.python.org/mailman/listinfo/python-list


TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-27 Thread Ryniek90
>
>>>>>> Ryniek90  (R) wrote:
>>>>>> 
>
>   
>> R> Hahah right. My fault. Must remember to read documentation so many times
>> R> until I find the solution.  Thanks, now works fine.  :-)
>> 
>
> And, by the way, how come the traceback refers to
> File "backuper.py", line 197, in 
> while the posted code has only 188 lines?
>   

Cuz my original code is bit longer - i've got some bookkeepings like
__author__, __version__ etc., just after module imports.
-- 
http://mail.python.org/mailman/listinfo/python-list


TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-26 Thread Ryniek90



[snip]

Here's my script code:
*http://paste.ubuntu.com/259310/

*Shouldn't that bug be patched already  :-?

Are you giving it the contents of the file when it's actually expecting
the filename?



Of course the content of the file:

[snip]

See? *backup_obj.add(read_obj.read())*
In previous pasted Traceback you can see 
*backup_obj.add(read_bin_obj)* - read_obj_bin was a reference to the 
*read_obj.read()* .



The documentation lists the methods "add" and "addfile". Pick one and
provide the values it's expecting. For example, if you choose "add" then
provide the filename, not the contents of the file.

Do only I have this problem or Python programming under Windows is 
nightmare?


It's only a nightmare if you don't follow the documentation. :-)



Hahah right. My fault. Must remember to read documentation so many times 
until I find the solution.  Thanks, now works fine.  :-)

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


TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-25 Thread Ryniek90


Ryniek90 wrote:

Referring to my earlier posts:
http://groups.google.pl/group/comp.lang.python/browse_thread/thread/4e34f995800f5352?hl=pl 



and

http://groups.google.pl/group/comp.lang.python/browse_thread/thread/abf5573b8fceb37e?hl=pl# 



I've dealt with those errors. but now have another.
When my backup scripts starts to backup chosen file, python gave me 
Traceback:


"
C:\Users\Ryniek's WinSe7en\Documents\My 
Dropbox\Aplikacje\Moje_aplikacje\Pythonowe_aplikacje\Skrypty>python ba

ckuper.py -f F:\APLIKACJE\nowegg.exe F:\ MyGGBackup
Checking permissions for reading and writing...
Have permissions on [F:\APLIKACJE\nowegg.exe] for reading.
Have permissions on [F:\] for writing.
Preparing for backup [nowegg.exe]...
Starting backup...
Now adding [nowegg.exe]...
Traceback (most recent call last):
 File "backuper.py", line 197, in 
   main_meth()
 File "backuper.py", line 189, in main_meth
   paq.backup_file(pars.options.filename[0], 
pars.options.filename[1], pars.options.filename[2])

 File "backuper.py", line 127, in backup_file
   backup_obj.add(read_bin_obj)
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\tarfile.py", line 1948, in add

   if self.name is not None and os.path.abspath(name) == self.name:
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\ntpath.py", line 458, in abspath

   path = _getfullpathname(path)
TypeError: _getfullpathname() argument 1 must be (buffer overflow), 
not str

"

I've searched over google, but found only that is bug in Python ( 
http://bugs.python.org/issue4071  - in that issue bug is inside 
Python 2.5.2 - i've got ActiveState Active Python with core Python 
2.6.2), and another  info:   *http://tinyurl.com/lvyn7o  and 
**http://tinyurl.com/kn49vk

*

Here's my script code:
*http://paste.ubuntu.com/259310/

*Shouldn't that bug be patched already  :-?

Are you giving it the contents of the file when it's actually expecting
the filename?




Of course the content of the file:
"
C:\Users\Ryniek's WinSe7en\Documents\My 
Dropbox\Aplikacje\Moje_aplikacje\Pythonowe_aplikacje\Skrypty>python ba

ckuper.py -f F:\APLIKACJE\nowegg.exe F:\ MyGGBackup
Checking permissions for reading and writing...
Have permissions on [F:\APLIKACJE\nowegg.exe] for reading.
Have permissions on [F:\] for writing.
Preparing for backup [nowegg.exe]...
Starting backup...
Now adding [nowegg.exe]...
Traceback (most recent call last):
 File "backuper.py", line 196, in 
   main_meth()
 File "backuper.py", line 188, in main_meth
   paq.backup_file(pars.options.filename[0], pars.options.filename[1], 
pars.options.filename[2])

 File "backuper.py", line 126, in backup_file
   backup_obj.add(read_obj.read())
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\tarfile.py", line 1948, in add

   if self.name is not None and os.path.abspath(name) == self.name:
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\ntpath.py", line 458, in abspath

   path = _getfullpathname(path)
TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str
"

See? *backup_obj.add(read_obj.read())*
In previous pasted Traceback you can see *backup_obj.add(read_bin_obj)* 
- read_obj_bin was a reference to the *read_obj.read()* .


Do only I have this problem or Python programming under Windows is 
nightmare? 
--

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


TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-25 Thread Ryniek90

Referring to my earlier posts:
http://groups.google.pl/group/comp.lang.python/browse_thread/thread/4e34f995800f5352?hl=pl

and

http://groups.google.pl/group/comp.lang.python/browse_thread/thread/abf5573b8fceb37e?hl=pl#

I've dealt with those errors. but now have another.
When my backup scripts starts to backup chosen file, python gave me 
Traceback:


"
C:\Users\Ryniek's WinSe7en\Documents\My 
Dropbox\Aplikacje\Moje_aplikacje\Pythonowe_aplikacje\Skrypty>python ba

ckuper.py -f F:\APLIKACJE\nowegg.exe F:\ MyGGBackup
Checking permissions for reading and writing...
Have permissions on [F:\APLIKACJE\nowegg.exe] for reading.
Have permissions on [F:\] for writing.
Preparing for backup [nowegg.exe]...
Starting backup...
Now adding [nowegg.exe]...
Traceback (most recent call last):
 File "backuper.py", line 197, in 
   main_meth()
 File "backuper.py", line 189, in main_meth
   paq.backup_file(pars.options.filename[0], pars.options.filename[1], 
pars.options.filename[2])

 File "backuper.py", line 127, in backup_file
   backup_obj.add(read_bin_obj)
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\tarfile.py", line 1948, in add

   if self.name is not None and os.path.abspath(name) == self.name:
 File "E:\WinSe7en Apps\APLIKACJE\ActiveState Python 
2.6\lib\ntpath.py", line 458, in abspath

   path = _getfullpathname(path)
TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str
"

I've searched over google, but found only that is bug in Python ( 
http://bugs.python.org/issue4071  - in that issue bug is inside Python 
2.5.2 - i've got ActiveState Active Python with core Python 2.6.2), and 
another  info:   *http://tinyurl.com/lvyn7o  and **http://tinyurl.com/kn49vk

*

Here's my script code:
*http://paste.ubuntu.com/259310/

*Shouldn't that bug be patched already  :-?
--
http://mail.python.org/mailman/listinfo/python-list


IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Ryniek90

>> John Machin wrote:

>>> Erik Max Francis  alcyone.com> writes:

>> I also suspect the "pipe" symbol. I don't know if it's an invalid
>> character to Windows, but it's certainly a bad idea.  The '|' character
>> means something special to the shell.

> The "pipe" character is not a valid character in a Windows file.
> Despite the OP's message wrapping the filename in "pipes",
> there are no pipes in the filename in the traceback to
> which he posted a link.  Wrapping the filename in "pipes"
> and the cryptic reference to "the '|\U' literal fault"
> appear to be side-issue bogglements.

>  >>> open('boggle|txt', 'wb')
>  Traceback (most recent call last):
>File "", line 1, in 
>  IOError: [Errno 22] invalid mode ('wb') or filename: 'boggle|txt'
>  >>> open('|boggle.txt|', 'wb')
>  Traceback (most recent call last):
>File "", line 1, in 
>  IOError: [Errno 22] invalid mode ('wb') or filename: '|boggle.txt|'

Sorry, but i don't know where those pipes came from  : P

The proper path is "C:\\Users\\Ryniek's
WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2"
and that string literal is "\U", without any pipes  :)

The truth is that script works on linux (ubuntu) but not on windows
(neither Win7 nor WinXP).
Maybe it's good idea to use raw string for specifing those paths?

As i mentioned later, some python users had the same problem with this
IOError ( like here: http://www.daniweb.com/forums/thread174552.html  or
here:
http://groups.google.com/group/sympy/browse_thread/thread/c42aca3eb53... 
 


).

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


Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Ryniek90



John Machin wrote:


Erik Max Francis  alcyone.com> writes:
  
  
  
I also suspect the "pipe" symbol. I don't know if it's an invalid 
character to Windows, but it's certainly a bad idea.  The '|' character 
means something special to the shell.



The "pipe" character is not a valid character in a Windows file.
Despite the OP's message wrapping the filename in "pipes",
there are no pipes in the filename in the traceback to
which he posted a link.  Wrapping the filename in "pipes"
and the cryptic reference to "the '|\U' literal fault"
appear to be side-issue bogglements.

 >>> open('boggle|txt', 'wb')
 Traceback (most recent call last):
   File "", line 1, in 
 IOError: [Errno 22] invalid mode ('wb') or filename: 'boggle|txt'
 >>> open('|boggle.txt|', 'wb')
 Traceback (most recent call last):
   File "", line 1, in 
 IOError: [Errno 22] invalid mode ('wb') or filename: '|boggle.txt|'



  


Sorry, but i don't know where those pipes came from  : P

The proper path is "C:\\Users\\Ryniek's 
WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2"

and that string literal is "\U", without any pipes  :)

The truth is that script works on linux (ubuntu) but not on windows 
(neither Win7 nor WinXP).

Maybe it's good idea to use raw string for specifing those paths?

As i mentioned later, some python users had the same problem with this 
IOError ( like here: http://www.daniweb.com/forums/thread174552.html  or 
here: 
http://groups.google.com/group/sympy/browse_thread/thread/c42aca3eb532928c 
).



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


IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Ryniek90

Hi
I've got my backup script which opens tarfile for add chosen file to it. 
But while setting it up, i've got Traceback:

here's the url: -->http://paste.ubuntu.com/258081/<--

I have searched among google's result but didn't found anything useful. 
Only found info that it may be the backslashes fault in path, but i have 
written proper the path.


Here's link to my script paste: http://paste.ubuntu.com/258087/

Is its the '|\U' literal fault in path '|C:\\Users\\Ryniek's 
WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2|' ?


Sorry if i'm annoying but i'm still learning.
|
--
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError while checking for permissions with os.access() on windows xp

2009-08-22 Thread ryniek90




WTF??
Why on IDLE it works, but when i run this script in cmd.exe, the
os.getenv('HOME') goes NoneType?
I'm to newbie yet to understand this  :/


HOME is simply not a standard environment variable that Windows 
provides. Any program can set/add environment variables as it deems 
fit; in this case it seems IDLE is setting one, but you can't rely on 
it outside of IDLE.


If you do os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] it may be 
what you want.


Start up cmd.exe, type 'set' -- that's the default/standard 
environment variables you have to work with. That's it.


--S


Yep, now that variable works fine. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError while checking for permissions with os.access() on windows xp

2009-08-22 Thread ryniek90



First, some nitpicking: Include the whole traceback when posting about
errors please.  Don't write "if some_boolean_expression != True:"
instead prefer "if not some_boolean_expression:".  Also, in your code
"except (Except), ex: return ex" the parentheses are redundant,
there's no "Except" Exception (unless you created one yourself) and
why are you catching and returning the Exception object?  (Also,
what's that "sys.exit(0)" doing in there? And why exit with 0 if there
was a problem? Exit code 0 means "no problem".)


Second, from what you've said backup_dest must be None:

 

import os
os.access(None, os.W_OK)



Traceback (most recent call last):
  File "", line 1, in 
os.access(None, os.W_OK)
TypeError: coercing to Unicode: need string or buffer, NoneType found

  


No, backup_dest is destination for backup. It's this variable: 
*backup_dest = self.__backup_dest* .
*self.__backup_dest = os.getenv('HOME')*  -  as you can see, 
self.__backup_dest is a reference to the home directory which is a 
string. Then backup_dest is a reference to the variable 
self.__backup_dest. But that second reference seems to be recognised 
as a NoneType ??


I'm using optparse in my script (that code for checking for 
permission is a part of my backup script).


Maybe i post my complete code:
"
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#MyBackUper

import os, sys, tarfile
import datetime
from optparse import OptionParser


class Except(Exception):
   pass


class Packer(Except):

   def __init__(self):
   self.__backup_dest = os.getenv('HOME')
   __current_time = datetime.datetime.today().strftime('%Y-%m-%d 
%H:%M:%S')

   Except.__init__(self)

   def doc_note(self):

   print """

   DOCUMENTATION

   'Backuper' is a script for doing backups.
   You can backup with it single files or whole directories.
   For available commands type 'backuper.py -h' or 'backuper.py 
--help'.


   Using it is simple:

   - to backup single file, type:
   'backuper.py -f FILE_PATH BCKP_NAME [DEST_PATH]',
   where 'FILE_PATH' is exact path to prefered file which you 
want to backup and 'BCKP_NAME' is the name for backup output file. 
Default 'DEST_PATH' is placed in home directory, it can't be changed. 
'BCKP_NAME' must be given;


   - to backup whole directory, type:
   'backuper.py -d DIR_PATH BCKP_NAME [DEST_PATH]', where 
'DIR_PATH' is exact path to prefered directory, which you want to 
backup and 'BCKP_NAME' is the name for backup output file. Default 
'DEST_PATH' is placed in home directory, it can't be changed. 
'BCKP_NAME' must be given;


   """

   def __check_set_perm(self, rd_obj_path, backup_dest):

   try:

   if os.path.exists(rd_obj_path):
   if not os.access(rd_obj_path, os.R_OK):
   print "Have no permissions on [%s] for reading 
operation.\nTrying to set them..." % os.path.split(rd_obj_path)[1]

   if not os.path.isdir(rd_obj_path):
   os.chmod(rd_obj_path, stat.S_IREAD)
   else:
   for root, dirs, files in os.walk(rd_obj_path):
   for f in files:
   os.chmod(os.path.join(root, f), 
stat.S_IREAD)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(rd_obj_path)[1]

   else:
   print "Have permissions on [%s] for reading." % 
os.path.split(rd_obj_path)[1]


   if not os.access(backup_dest, os.W_OK):
   print "Have no permissions on [%s] for writing 
operation.\nTrying to set them..." % os.path.split(backup_dest)[1]

   os.chmod(backup_dest, stat.S_IWRITE)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(backup_dest)[1]

   else:
   print "Have permissions on [%s] for writing." % 
os.path.split(backup_dest)[1]

   else:
   return "Can't find specified path - [%s]." % rd_obj_path
   sys.exit(1)

   except (Except), ex:
   return ex


   def backup_file(self, rd_obj_path, bkp_obj_name):

   try:

   if os.name == "nt":
   rd_obj_path = rd_obj_path.replace('~/', '%s\\' % 
os.getenv('HOME')).replace('\\', '')

   backup_dest = self.__backup_dest
   print "Checking permissions for reading and writing..."
   self.__check_set_perm(rd_obj_path, backup_dest)
   backup_obj = tarfile.open("%s\\%s(%s).tar.bz2" % 
(backup_dest, bkp_obj_name, __current_time), 'w:bz2')


   else:
   rd_obj_path = rd_obj_path.replace('~/', '%s/' % 
os.getenv('HOME'))

   backup_dest = self.__backup_dest
   print "Checking permissions for reading and writing..."
   self.__check_set_perm(rd_obj_path, backup_dest)
   backup_obj = tarfile.open("%s/%s(%s).

Re: TypeError while checking for permissions with os.access() on windows xp

2009-08-22 Thread ryniek90



First, some nitpicking: Include the whole traceback when posting about
errors please.  Don't write "if some_boolean_expression != True:"
instead prefer "if not some_boolean_expression:".  Also, in your code
"except (Except), ex: return ex" the parentheses are redundant,
there's no "Except" Exception (unless you created one yourself) and
why are you catching and returning the Exception object?  (Also,
what's that "sys.exit(0)" doing in there? And why exit with 0 if there
was a problem? Exit code 0 means "no problem".)


Second, from what you've said backup_dest must be None:

  

import os
os.access(None, os.W_OK)



Traceback (most recent call last):
  File "", line 1, in 
os.access(None, os.W_OK)
TypeError: coercing to Unicode: need string or buffer, NoneType found

  


No, backup_dest is destination for backup. It's this variable: 
*backup_dest = self.__backup_dest* .
*self.__backup_dest = os.getenv('HOME')*  -  as you can see, 
self.__backup_dest is a reference to the home directory which is a 
string. Then backup_dest is a reference to the variable 
self.__backup_dest. But that second reference seems to be recognised as 
a NoneType ??


I'm using optparse in my script (that code for checking for permission 
is a part of my backup script).


Maybe i post my complete code:
"
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#MyBackUper

import os, sys, tarfile
import datetime
from optparse import OptionParser


class Except(Exception):
   pass


class Packer(Except):

   def __init__(self):
   self.__backup_dest = os.getenv('HOME')
   __current_time = datetime.datetime.today().strftime('%Y-%m-%d 
%H:%M:%S')

   Except.__init__(self)

   def doc_note(self):

   print """

   DOCUMENTATION

   'Backuper' is a script for doing backups.
   You can backup with it single files or whole directories.
   For available commands type 'backuper.py -h' or 'backuper.py 
--help'.


   Using it is simple:

   - to backup single file, type:
   'backuper.py -f FILE_PATH BCKP_NAME [DEST_PATH]',
   where 'FILE_PATH' is exact path to prefered file which you want 
to backup and 'BCKP_NAME' is the name for backup output file. Default 
'DEST_PATH' is placed in home directory, it can't be changed. 
'BCKP_NAME' must be given;


   - to backup whole directory, type:
   'backuper.py -d DIR_PATH BCKP_NAME [DEST_PATH]', where 
'DIR_PATH' is exact path to prefered directory, which you want to backup 
and 'BCKP_NAME' is the name for backup output file. Default 'DEST_PATH' 
is placed in home directory, it can't be changed. 'BCKP_NAME' must be given;


   """

   def __check_set_perm(self, rd_obj_path, backup_dest):

   try:

   if os.path.exists(rd_obj_path):
   if not os.access(rd_obj_path, os.R_OK):
   print "Have no permissions on [%s] for reading 
operation.\nTrying to set them..." % os.path.split(rd_obj_path)[1]

   if not os.path.isdir(rd_obj_path):
   os.chmod(rd_obj_path, stat.S_IREAD)
   else:
   for root, dirs, files in os.walk(rd_obj_path):
   for f in files:
   os.chmod(os.path.join(root, f), 
stat.S_IREAD)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(rd_obj_path)[1]

   else:
   print "Have permissions on [%s] for reading." % 
os.path.split(rd_obj_path)[1]


   if not os.access(backup_dest, os.W_OK):
   print "Have no permissions on [%s] for writing 
operation.\nTrying to set them..." % os.path.split(backup_dest)[1]

   os.chmod(backup_dest, stat.S_IWRITE)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(backup_dest)[1]

   else:
   print "Have permissions on [%s] for writing." % 
os.path.split(backup_dest)[1]

   else:
   return "Can't find specified path - [%s]." % rd_obj_path
   sys.exit(1)

   except (Except), ex:
   return ex


   def backup_file(self, rd_obj_path, bkp_obj_name):

   try:

   if os.name == "nt":
   rd_obj_path = rd_obj_path.replace('~/', '%s\\' % 
os.getenv('HOME')).replace('\\', '')

   backup_dest = self.__backup_dest
   print "Checking permissions for reading and writing..."
   self.__check_set_perm(rd_obj_path, backup_dest)
   backup_obj = tarfile.open("%s\\%s(%s).tar.bz2" % 
(backup_dest, bkp_obj_name, __current_time), 'w:bz2')


   else:
   rd_obj_path = rd_obj_path.replace('~/', '%s/' % 
os.getenv('HOME'))

   backup_dest = self.__backup_dest
   print "Checking permissions for reading and writing..."
   self.__check_set_perm(rd_obj_path, backup_dest)
   backup_obj = tarfile.open("%s/%s(%s).

TypeError while checking for permissions with os.access() on windows xp

2009-08-21 Thread ryniek90

I've got some code that checks priviliges on two paths:
First - chosen by user
Second - hardcoded home directory represented by **os.getenv('HOME')** - 
(os.getenv('HOME') works both on Linux and Windows)


Here's the code:
"
def __check_set_perm(self, rd_obj_path, backup_dest):

   try:

   if os.path.exists(rd_obj_path):
   if os.access(rd_obj_path, os.R_OK) != True:
   print "Have no permissions on [%s] for reading 
operation.\nTrying to set them..." % os.path.split(rd_obj_path)[1]

   if not os.path.isdir(rd_obj_path):
   os.chmod(rd_obj_path, stat.S_IREAD)
   else:
   for root, dirs, files in os.walk(rd_obj_path):
   for f in files:
   os.chmod(os.path.join(root, f), 
stat.S_IREAD)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(rd_obj_path)[1]

   else:
   print "Have permissions on [%s] for reading." % 
os.path.split(rd_obj_path)[1]


   if os.access(backup_dest, os.W_OK) != True:
   print "Have no permissions on [%s] for writing 
operation.\nTrying to set them..." % os.path.split(backup_dest)[1]

   os.chmod(backup_dest, stat.S_IWRITE)
   print "Get permissions for reading on [%s] 
successfully." % os.path.split(backup_dest)[1]

   else:
   print "Have permissions on [%s] for writing." % 
os.path.split(backup_dest)[1]

   else:
   return "Can't find specified path - [%s]." % rd_obj_path
   sys.exit(0)

   except (Except), ex:
   return ex
"


This code is part of my backup script. When script checks for reading 
permission on 'user chosen path' it seems ok, but when it checks for 
writing permissions on 'home directory', (this line: **if 
os.access(backup_dest, os.W_OK) != True**), i get error:

**TypeError: coercing to Unicode: need string or buffer, NoneType found**
The second os.access check fails, but don't know why. When i turned 
os.W_OK to integer, i get the same error.
But when changed os.W_OK or that int to string, i get error that integer 
is required. I'm launching this code on WinXP Prof+SP3, on Administrator 
account. Is it bug in os.acces() or my code is written wrong?
Btw. i kow that os.chmod in windows can set only read-olny flag, so 
later i'll change the line with **os.chmod(path, stat.S_IWRITE)**


Thanks and cheers.
--
http://mail.python.org/mailman/listinfo/python-list


How to write replace string for object which will be substituted? [regexp]

2009-08-06 Thread Ryniek90



2) If you really want to learn regexes, get a copy of _Mastering Regular
Expressions_ by Friedl (either 2nd or 3rd edition)
  


I made preview of that book, but some pages are disabled from preview. 
Has that book topics about Python regexp's?

If so, i must buy it.
--
http://mail.python.org/mailman/listinfo/python-list


How to write replace string for object which will be substituted? [regexp]

2009-08-04 Thread ryniek90

Hi.
I started learning regexp, and some things goes well, but most of them 
still not.


I've got problem with some regexp. Better post code here:

"
>>> import re
>>> mail = '\nn...@mail.com\nname1 [at] mail [dot] com\nname2 [$at$] 
mail [$dot$] com\n'

>>> mail
'\nn...@mail.com\nname1 [at] mail [dot] com\nname2 [$at$] mail [$dot$] 
com\n'

>>> print mail

n...@mail.com
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com

>>> maail = re.sub('^\n|$\n', '', mail)
>>> print maail
n...@mail.com
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com
>>> maail = re.sub(' ', '', maail)
>>> print maail
n...@mail.com
name1[at]mail[dot]com
name2[$at$]mail[$dot$]com
>>> maail = re.sub('\[at\]|\[\$at\$\]', '@', maail)
>>> print maail
n...@mail.com
na...@mail[dot]com
na...@mail[$dot$]com
>>> maail = re.sub('\[dot\]|\[\$dot\$\]', '.', maail)
>>> print maail
n...@mail.com
na...@mail.com
na...@mail.com
>>> #How must i write the replace string to replace all this regexp's 
with just ONE command, in string 'mail' ?
>>> maail = re.sub('^\n|$\n| |\[at\]|\[\$at\$\]|\[dot\]|\[\$dot\$\]', 
*?*, mail)

"

How must i write that replace pattern (look at question mark), to maek 
that substituion work? I didn't saw anything helpful while reading Re 
doc and HowTo (from Python Doc). I tried with 'MatchObject.group()' but 
something gone wrong - didn't wrote it right.

Is there more user friendly HowTo for Python Re, than this?

I'm new to programming an regexp, sorry for inconvenience.


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


Re: how to embed the python interpreter into web App (Mehndi, Sibtey)

2009-07-29 Thread Ryniek90



Hi All

I am trying to embed the python interpreter in to a web app but could 
not get the way, any one can suggest me how to do this.


 


Thanks,

Sibtey Mehdi

 


This e-mail (and any attachments), is confidential and may be privileged. It 
may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person.



  


Here's example: http://try-python.mired.org/

Contact with author of that website/webapp.

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


Re: Python-list Digest, Vol 70, Issue 282

2009-07-22 Thread Ryniek90



When i use this class in Python IDLE, i've got this error: "


...
  

Traceback (most recent call last):
  File "", line 1, in 
mod.print_module('socket')
  File "", line 48, in print_module
module_open = open(self._this_module, 'rb')
IOError: [Errno 2] No such file or directory: ''
 >>>
"

As You can see, i can't assign the new value "os.path.join(root, f)" to
the 'self._this_module variable'.



In the __init__ method, you successfully set the `_this_module` attribute:

self._this_module = ''

That works, so it proves that you *can* set a private attribute.

Later on, you call the `_SetVar` method, which does this:

def _SetVar(self, attr, val):
self.attr = val   


In English, this method does this:

(1) Take two arguments, and store them in variables called "attr" and 
"val".


(2) Assign the value stored in "val" to an attribute named exactly "attr".

What you actually want is:

(1) Take two arguments, and store them in variables called "attr" and 
"val".


(2) Assign the value stored in "val" to an attribute with the name stored 
in the variable "attr".


Can you see the difference?

What you actually want is:

def _SetVar(self, attr, val):
setattr(self, attr, val)


Your code is terribly complicated. This will probably do what you want. 
(Warning -- I haven't tested it, so there may be a few errors.)



class ModPrint(object):
u"""
This will be the doc.
"""
def __init__(self, default_search_path=''):
self.default_search_path = ''

   def find_module(self, modulename, search_path=''):
   if search_path == '':
   # Try the default search path instead.
   search_path = self.default_search_path
if search_path == '':  # still blank.
# Try the Python search path instead.
   search_path = sys.exec_prefix
for root, dirs, files in os.walk(search_path):
for f in files:
if f == "%s.py" % modulename:
return os.path.join(root, f)

def get_module_text(self, modulename, search_path=''):
filename = self.find_module(modulename, search_path)
module_open = open(filename, 'rb')
module_text = module_open.read()
module_open.close()
return module_text


I changed the name of print_module_text because it doesn't actually print 
anything.
  


Thanks for ready class - it works great, but that code:
"

What you actually want is:

   def _SetVar(self, attr, val):
   setattr(self, attr, val)


"
Didn't worked, so i wil reuse your class, and modify it later. Now i see 
that working on private objects complex.


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


Re: Changing the private variables content

2009-07-22 Thread Ryniek90


Got it:

exec('self.' + attr + '=\'' + val + '\'')

That worked. I think it'll do what you want now ;)

Ching-Yun "Xavier" Ho, Technical Artist

Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com 
Website: http://xavierho.com/


To bad, that didn't worked in my class. Still the same error:
"
>>> mod.print_module('socket')

Traceback (most recent call last):
 File "", line 1, in 
   mod.print_module('socket')
 File "", line 51, in print_module
   module_open = open(self._this_module, 'rb')
IOError: [Errno 2] No such file or directory: ''
>>>
"

:-/

What is the point of the _SetVar method?

Instead of:

self._SetVar(self._this_module, os.path.join(root, f))

just do:

self._this_module = os.path.join(root, f)

(unless I'm misunderstanding what you're trying to do!)



Of course i;ve tried, but still get the same error:

"
>>> mod.print_module('socket')

Traceback (most recent call last):
 File "", line 1, in 
   mod.print_module('socket')
 File "", line 51, in print_module
   module_open = open(self.this_module, 'rb')
IOError: [Errno 2] No such file or directory: ''
>>>
"

It looks like private variable have specific naure, that prevent from 
traditional editing them.

Still searching for some tuts about private methods and variables.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Re: Changing the private variables content

2009-07-22 Thread Ryniek90




Temat:
Re: Changing the private variables content
Od:
Gary Herron 
Data:
Tue, 21 Jul 2009 14:14:44 -0700
Do:
Ryniek90 

Do:
Ryniek90 
Kopia:
python-list@python.org


Ryniek90 wrote:

Hi.
I'm writing some class, and decided to use inside private method and 
some private variables. While with method i haven't got any problem's 
with variables i have.

Maybe some example.
A class with private method and private variable:

"
>>> class Secret(object):
   #
   def __init__(self):
   self._number = 1
   #
   def _secret(self):
   print self._number
   def showit(self):
   print "Secret number is:\n"
   self._secret()

>>> sec = Secret()
>>> sec.showit()
Secret number is:

1
>>> sec._number
1
>>> sec._number = 2
>>> sec._number
2
>>> sec._number += 3
>>> sec._number
5
>>>
"

As You can see, i made class with private method and private variable 
inside __init__ constructor. I've changed also the variable value, 
but outside class.
I've got problem with changing some variable value _inside__my_ 
class, which i'm writing.


Not sure this is what you are asking, but a method (which is how I 
interpret "_inside__my_ class") changes the value by normal assignment 
like this:


class Secret(object):
 ...
 def SetNumber(self,value):
   self._number = value

Is that what you were asking?


Gary Herron



I've searched over google, some tuts with topics about operations on 
private variables, but didn't found anything - only how to make them, 
but no how to assign new objects/override them with new content (and 
other advanced and helpful options).


If someone could help me, it would be great.

Thanks.






Thanks for hint, but looks like i can't do what i want.

Maybe i show You my class:

"

class ModPrint(object):
  
   u"""

   This will be the doc.
   """
  
   def __init__(self):
  
   #Assign the Python installation directory - sys.exec_prefix - to 
variable

   self._default_search_path=sys.exec_prefix
   self._chosen_module = ''
   self._user_search_path = ''
   self._this_module = ''
  
   def _SetVar(self, attr, val):
   self.attr = val   
  
   def _search_for_module(self, *args):
  
   """Private method which walks through default Python 
installation directories, and search for prefered module."""
  
   #walking thru all directories available in path '_user_search_path'

   for root, dirs, files in os.walk(self._user_search_path):
   for f in files:
  
   #if found file 'f' is THAT module,

   #full path to THAT file is assigned to variable
   if f == ("%s.py" % self._chosen_module):
   self._SetVar(self._this_module, os.path.join(root, f))
  
  
   def print_module(self, _chosen_module='', _user_search_path='', 
_default_search_path=sys.exec_prefix,):
  
   """Reads module chosen by user, and returns full content of this 
module, as it is."""
  
  
   #if custom search path hasn't been assigned,

   #default path is being assigned as custom path
   if self._user_search_path == '':
   self._user_search_path = self._default_search_path
  
   #using private method '_search_for_module' with 'self.' preffix

   #to search for prefered module
   self._search_for_module(_chosen_module, _user_search_path)
  
   #opening prefered module with read-only binary mode

   #and assigning it to 'module_open' variable
   module_open = open(self._this_module, 'rb')
  
   #reading this file and assigning it to variable

   module_text = module_open.read()
  
   #closing read file; the read content is still available

   #it's stored in variable 'module_text'
   module_open.close()
  
   #returning the read content

   return module_text

"

When i use this class in Python IDLE, i've got this error:
"
>>> mod = ModPrint()
>>> import socket
>>> mod.print_module('socket')

Traceback (most recent call last):
 File "", line 1, in 
   mod.print_module('socket')
 File "", line 48, in print_module
   module_open = open(self._this_module, 'rb')
IOError: [Errno 2] No such file or directory: ''
>>>
"

As You can see, i can't assign the new value "os.path.join(root, f)" to 
the 'self._this_module variable'.

So for sure i've made some mistak

Changing the private variables content

2009-07-21 Thread Ryniek90

Hi.
I'm writing some class, and decided to use inside private method and 
some private variables. While with method i haven't got any problem's 
with variables i have.

Maybe some example.
A class with private method and private variable:

"
>>> class Secret(object):
   #
   def __init__(self):
   self._number = 1
   #
   def _secret(self):
   print self._number
   def showit(self):
   print "Secret number is:\n"
   self._secret()

>>> sec = Secret()
>>> sec.showit()
Secret number is:

1
>>> sec._number
1
>>> sec._number = 2
>>> sec._number
2
>>> sec._number += 3
>>> sec._number
5
>>>
"

As You can see, i made class with private method and private variable 
inside __init__ constructor. I've changed also the variable value, but 
outside class.
I've got problem with changing some variable value _inside__my_ class, 
which i'm writing.
I've searched over google, some tuts with topics about operations on 
private variables, but didn't found anything - only how to make them, 
but no how to assign new objects/override them with new content (and 
other advanced and helpful options).


If someone could help me, it would be great.

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


Re: What text editor is everyone using for Python

2009-05-25 Thread Ryniek90






Temat:
Re: What text editor is everyone using for Python
Od:
Esmail 
Data:
Mon, 25 May 2009 14:07:24 -0400
Do:
python-list@python.org

Do:
python-list@python.org


LittleGrasshopper wrote:


So what do you guys use, and why? Hopefully we can keep this civil.


I use Emacs, just because I have been using this editor for
all sorts of things in the last 20+ years.

I haven't been able to get the python mode to work for Windows
(do most of my work under Linux anyway), but other than that I'm
pretty happy with it :-)

HTH,
Esmail




I'm using Geany (sort of small IDE) and I'm glad using it. But for big 
projects, NetBeans or Eclipse are better. There are also Komodo EDIT or 
Stani's Python Editor. Of course if someone like GUI editors/IDE's. 
Otherwise, use Vi/Emacs. Like someone previously said, search the Google.

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


Re: Python servlet for Java applet ?

2009-04-24 Thread ryniek90




Temat:
Python servlet for Java applet ?
Od:
Linuxguy123 
Data:
Fri, 24 Apr 2009 11:34:09 -0600
Do:
python-list@python.org

Do:
python-list@python.org


Hi guys.

Is there a way to use a python application as the back end (ie rpc) for
a Java based applet ?

How does it work compared to a Java servlet with a Java applet ?

Thanks
  



Maybe look at Jython  ?

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


Python interpreter speed

2009-04-19 Thread Ryniek90

Hi.

Standard Python interpreter's implementation is written in C language. C 
code while compilation, is compilled into machine code (the fastest 
code). Python code is compiled into into byte-code which is also some 
sort of fast machine code. So why Python interpreter is slower than Java 
VM? Being written in C and compilled into machine code, it should be as 
fast as C/Asm code.

What's wrong with that?

Greets and thank you.
--
http://mail.python.org/mailman/listinfo/python-list


Sending directory with files in it via sockets

2009-04-17 Thread Ryniek90

Hi.
Last time i've got problem with sending big files, but i've already 
dealt with it.
Now, when i want send directory (with some files in it) i iterate that 
directory for files in it, and then in while loop open iterated files, 
read them and send. But something's not working. It iterate's first file 
from directory and sends it all the time (only first file). So, the 
iteration is written bad. Could you tell me how to modify it?


Here's that method:

def send_dir(self):
   print "Gathering information's..."
   self.direc = os.walk(self.data)
   for files in self.direc:
   lst_files = files[2]
   for fl in lst_files:
   print "Sending %s from directory %s" % (fl, 
os.path.split(self.data)[1])

   while True:
   files = open("%s/%s" % (self.data,fl), 'rb')
   self.read = files.read(51200)
   self.konn.send(self.read)
   if not self.read:
   break
   files.close()

"self.data" is variable for the "self.konn.recv(4096")  method.  
self.konn is from "self.konn, self.addr = self.sok.accept()"


"self.direc = os.walk(self.data)
   for files in self.direc:
   lst_files = files[2]"

Iteration result looks like this:

>>> import os
>>> direc = os.walk('/media/DOWNLOAD/Obrazy płyt/Half-Life 2')
>>> for files in direc:
   lst_files = files[2]

  
>>> lst_files

['hl2_1.nrg', 'hl2_2.nrg', 'hl2_4.nrg', 'hl2_5.nrg']
>>> for fl in lst_files:
   print fl

  
hl2_1.nrg

hl2_2.nrg
hl2_4.nrg
hl2_5.nrg
>>>

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


Re: What IDE support python 3.0.1 ?

2009-04-16 Thread Ryniek90





Temat:
Re: What IDE support python 3.0.1 ?
Od:
Fabio Zadrozny 
Data:
Wed, 15 Apr 2009 22:25:36 -0300
Do:
Deep_Feelings 

Do:
Deep_Feelings 
Kopia:
python-list@python.org



I want to start learning python and not wanna waste my time learning
python 2.x ,so i need your advise to what IDE to use for python 3.0.1




Pydev supports Python 2.x and 3.x.

Cheers,

Fabio

  


Komodo IDE, Wing IDE, PyDev, don't know if NetBeans too.
Imo, you should give a chance to Python 2.x.
Turning to the need of rewriting code for Py3k: check the py2to3 script.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python-list Digest, Vol 67, Issue 192

2009-04-12 Thread Ryniek90

Chris Rebert pisze:

On Sun, Apr 12, 2009 at 3:38 PM, Ryniek90  wrote:
  

Paul Rubin <http://phr...@nospam.invalid>
Ryniek90  writes:

  

When i wanted to send an .iso file of 4GB length, i had traceback:
"OverflowError: requested number of bytes is more than a Python string
can hold"



You're not supposed to put the 4GB all in one string.  Open the
socket and send smaller packets through it.

 
  

Ok, so i will split that data for smaller files. But i've still haven't got
answer for question: "What's the max. length of string bytes which Python
can hold?



sys.maxsize
The largest positive integer supported by the platform’s
Py_ssize_t type, and thus the maximum size lists, strings, dicts, and
many other containers can have.

Cheers,
Chris

  


Thanks. I've wanted to check very carefully what's up, and i found this: 
"strings (currently restricted to 2GiB)".
It's here, in PEP #353 (PEP 0353 
<http://www.python.org/dev/peps/pep-0353/>). Besides of this, i've found 
in sys module's docstring this:


maxint = 2147483647
maxunicode = 1114111

Which when added gives us 2148597758.0 bytes, which are equal to 
2049.0624980926514  MiB's.
So files larger than 2049.06 MiB's should be splitted into smaller ones 
and sent partially.

Correct me if i'm wrong.

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


Re: Python-list Digest, Vol 67, Issue 192

2009-04-12 Thread Ryniek90





Temat:
Re: OverflowError while sending large file via socket
Od:
Paul Rubin <http://phr...@nospam.invalid>
Data:
12 Apr 2009 15:28:43 -0700
Do:
python-list@python.org

Do:
python-list@python.org


Ryniek90  writes:
  

When i wanted to send an .iso file of 4GB length, i had traceback:
"OverflowError: requested number of bytes is more than a Python string
can hold"



You're not supposed to put the 4GB all in one string.  Open the
socket and send smaller packets through it.

  

Ok, so i will split that data for smaller files. But i've still haven't 
got answer for question: "What's the max. length of string bytes which 
Python can hold?

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


OverflowError while sending large file via socket

2009-04-12 Thread Ryniek90

When i wanted to send an .iso file of 4GB length, i had traceback:
"OverflowError: requested number of bytes is more than a Python string 
can hold"


Sockets are being used in every network app, i.e: p2p progs (like 
BitTorrent), and exchanged data is often bigger than 4GB. So why i've 
had that Traceback? How many number of bytes Python string can hold?

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


Re: GUI Programming

2009-04-12 Thread Ryniek90
I think you should get involved with Eagle Python GUI 
 
or Kiwi GUI Framework  . Good luck.

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