Affichage des articles dont le libellé est python. Afficher tous les articles
Affichage des articles dont le libellé est python. Afficher tous les articles

dimanche 9 mars 2014

[RELEASED] Python 3.3.5 topic




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On behalf of the Python development team, I'm very happy to announce
the release of Python 3.3.5.

Python 3.3.5 includes fixes for these important issues:

* a 3.3.4 regression in zipimport (see http://bugs.python.org/issue20621)
* a 3.3.4 regression executing scripts with a coding declared and Windows
newlines (see http://bugs.python.org/issue20731)
* potential DOS using compression codecs in bytes.decode() (see
http://bugs.python.org/issue19619 and http://bugs.python.org/issue20404)

and also fixes quite a few other bugs.

Python 3.3 includes a range of improvements of the 3.x series, as well
as easier porting between 2.x and 3.x. In total, almost 500 API items
are new or improved in Python 3.3. For a more extensive list of
changes in the 3.3 series, see

http://docs.python.org/3.3/whatsnew/3.3.html

To download Python 3.3.5 visit:

http://www.python.org/downloads/release/python-335/


This is a production release, please report any bugs to

http://bugs.python.org/

The final release is scheduled one week from now.


Enjoy!

- --
Georg Brandl, Release Manager
georg at python.org
(on behalf of the entire python-dev team and 3.3's contributors)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlMcRNEACgkQN9GcIYhpnLAVqACeMoOOuuNX5i P6at9zbIZDnkqK
idwAoKb2FxAJlirhs2BmdESEaQiqBDJd
=smeC
-----END PGP SIGNATURE-----





samedi 8 mars 2014

Python performance topic




I did some work in c# and java and I converted some application to Python; I noticed Python is much slower than the other languages.

Is this normal ?
Thanks





lundi 24 février 2014

python topic




I worked as a weblogic administrator and now i am changing to development and i am very much interested in python ......... please suggest me what arethe things i need to learn more rather than python to get an I.T job. I came to know about Django but i am in a confusion please help me .........





dimanche 23 février 2014

[RELEASED] Python 3.3.5 release candidate 1 topic




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On behalf of the Python development team, I'm happy to announce
the release of Python 3.3.5, release candidate 1.

Python 3.3.5 includes a fix for a regression in zipimport in 3.3.4
(see http://bugs.python.org/issue20621) and a few other bugs.

Python 3.3 includes a range of improvements of the 3.x series, as well
as easier porting between 2.x and 3.x. In total, almost 500 API items
are new or improved in Python 3.3. For a more extensive list of
changes in the 3.3 series, see

http://docs.python.org/3.3/whatsnew/3.3.html

To download Python 3.3.5 visit:

http://www.python.org/download/releases/3.3.5/


This is a preview release, please report any bugs to

http://bugs.python.org/

The final release is scheduled one week from now.


Enjoy!

- --
Georg Brandl, Release Manager
georg at python.org
(on behalf of the entire python-dev team and 3.3's contributors)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlMKIPEACgkQN9GcIYhpnLCjXACfQwbC/eD/lhKAZ+XCwTwYPVWj
GMwAnjWkbdk7hqsKoh12EiagpGApEPSA
=2BCx
-----END PGP SIGNATURE-----





mercredi 12 février 2014

Re: Top down Python topic




I've realised that the best way to do this is to use a web browser for
the graphical front end: high end graphics are simply not a necessity
here, so one does not need to leave the confines of the browser. Thus
we need a simple server script.

I'm still minimalist, so I guess we want xmlrpc and a python server,
with a bit of javascript in the browser to sort out the drawing end.
This now seems way simpler than trying to play with Gtk or Qt.

Basically the lesson is to use a web browser engine as a graphics engine
unless you have performance issues. Hopefully in future html rendering
engines will not be so strongly coupled to browsers, or even to the html
format itself, but will be a general purpose user graphics engine (an
ncurses for bitmapped displays).

Can anybody suggest the quickest way to learn the bits of xmlrpc (in
python) that I need to do this. Once it's working, I'll stick a source
code download on my website. There will be only one version released:
the one that works properly. Thus there is no need to github this.

All the best,

def my_sig():
print("--")
print(signame(['n','o','h',uppercase('j')]).written_backwards)

On 12/02/2014 07:05, John Allsup wrote:
> What is needed for proper learning is near-absolute simplicity.
> Even one toy too many to play with is an intolerable distraction,
> but one too few massively hampers learning and induces boredom.
>
> I want to be able to say:
> 1. Put a nice picture on the background.
> 2. Put a terminal window with, say, 64x20 lines, dead centre.
> 3. Run a simple REPL program written in Python or Ruby within it.
> I do not really want to write any more lines of code than I need to.
> Why do we not have langauges and libraries that can do the above
> with only five lines of code (line 0 == setup, line 4 == cleanup).
>
> Programming should be that efficient if we learn to make things
> beautiful and not tolerate wastes of lines and characters, on
> a global scale as well as locally to our projects.
>
> Consider
> ====
> #!/usr/bin/env python3
>
> from myappfw import app
> from myapp1 import repl
> app.background = "Moutains1"
> t = app.terminal.open(title="Typing commands One Oh One",position="centre",
> width="80%",height="72%",rows="20",columns="64")
> exit(t.run(repl))
> ====
>
> What Python would I need to write, as concise but readable as
> practically possible, so that the above program works as desired (for
> any repl that obeys the basic input-process-output behaviour of a repl)?
>
> This is top-down design done right IMO (as described in Thinking Forth,
> by the way).







lundi 10 février 2014

Send commands to USB device in Python topic




Hi fellows,
I am facing difficulties in order to send USB commands to an RFID reader.
This is the command reference of the device: https://github.com/mti-rfid/RFID_Explorer

I am working with the MTI RU-824 model.

The manufacturer of the device only provide a driver for Windows (using .Net), but we need to run the device on Linux. That's why I need to write few lines of code in Python as a new "driver".

I am using PyUSB for accessing the device, and this is few lines of my code:

================================================== ==========================

import usb.core
import usb.util
import sys

VENDOR_ID = 0x24e9
PRODUCT_ID = 0x0824

device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)

if device is None:
sys.exit("Could not find Id System Barcode Reader.")
else:
print 'Device detected'

device.set_configuration()

cfg = device.get_active_configuration()
interface_number = cfg[(0, 0)].bInterfaceNumber
alternate_setting = usb.control.get_interface(device, interface_number)
usb_interface = usb.util.find_descriptor(
cfg, bInterfaceNumber=interface_number,
bAlternateSetting=alternate_setting
)

endpoint_out = usb.util.find_descriptor(
usb_interface,
# match the first OUT endpoint
custom_match=lambda e: usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_OUT
)

endpoint_in = usb.util.find_descriptor(
usb_interface,
# match the first IN endpoint
custom_match=lambda e: usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN
)

endpoint_out.write('0x01')
print endpoint_in.read(len('0x01'), 1000)

================================================== ===========================
My question is on the last 2 lines.
I am using endpoint_out to send a command and endpoint_in to read data from the reader. Am I correct?

The problem is, when I run the code, there is an error message like this:
usb.core.USBError: [Errno 110] Operation timed out

Anyone can give a clue?
Thank you.






Error getting while running python function topic




On Tue, Feb 11, 2014 at 3:07 PM, Jaydeep Patil <(E-Mail Removed)> wrote:
> I have defined one function as below.
>
> def InfoDir(msg):
> msg1 = wx.MessageDialog(msg)
> msg1.ShowModal()
> msg1.Destroy()
>
> InfoDir("Testing")
>
>
> It gives below error.
> msg1 = wx.MessageDialog(msg)
> File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 2922, in __init__
> _windows_.MessageDialog_swiginit(self,_windows_.ne w_MessageDialog(*args, **kwargs))
> TypeError: Required argument 'message' (pos 2) not found
>
> Process finished with exit code 1


It looks like you're missing a required argument :)

http://www.wxpython.org/docs/api/wx.....html#__init__

Try passing it a parent window as well as the message.

ChrisA





[RELEASED] Python 3.3.4 topic




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On behalf of the Python development team, I'm very happy to announce
the release of Python 3.3.4.

Python 3.3.4 includes several security fixes and over 120 bug fixes
compared to the Python 3.3.3 release.

This release fully supports OS X 10.9 Mavericks. In particular, this
release fixes an issue that could cause previous versions of Python to
crash when typing in interactive mode on OS X 10.9.

Python 3.3 includes a range of improvements of the 3.x series, as well
as easier porting between 2.x and 3.x. In total, almost 500 API items
are new or improved in Python 3.3. For a more extensive list of
changes in the 3.3 series, see

http://docs.python.org/3.3/whatsnew/3.3.html

To download Python 3.3.4 visit:

http://www.python.org/download/releases/3.3.4/


This is a production release, please report any bugs to

http://bugs.python.org/


Enjoy!

- --
Georg Brandl, Release Manager
georg at python.org
(on behalf of the entire python-dev team and 3.3's contributors)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlL5PMwACgkQN9GcIYhpnLCv4wCePNVqwsOYCH dJBix2bKk4PNpK
GBoAnRML2x6obCssnUJe5xwuUZYw8ZSY
=+/Nz
-----END PGP SIGNATURE-----





mercredi 5 février 2014

Python 3 for development topic




Is it possible to develop android applications using Python 3? I know it is possible with Python 2.6/2.7





jeudi 30 janvier 2014

Help with some python homework... topic




On Fri, Jan 31, 2014 at 4:12 PM, <(E-Mail Removed)> wrote:
> **If I leave my house at 6:52 am and run 1 mile at an easy pace (8:15 per mile), then 3 miles at tempo (7:12 per mile) and 1 mile at easy pace again, what time do I get home for breakfast?**
>
>
>
> seconds = 1
> hours = seconds / (60*60)
> seconds = seconds - hours*60*60
> minutes = seconds / 60
> seconds = seconds - minutes *60
>
> time_left_house = 6 * hours + 52 * minutes
>
> miles_run_easy_pace = 2 * (8 * minutes + 15 * seconds)
>
> miles_run_fast_pace = 3 * (7 * minutes + 12 * seconds)
>
>
> total_time_run = miles_run_easy_pace + miles_run_fast_pace + time_left_house


Thanks for being up-front about it being homework. I'll give you one
broad hint, and see if you can figure it out from there.

Your beginning work is not actually achieving anything useful. To make
your next steps work, what you actually want is two very simple
assignments that will mean that "6 * hours" comes out as the number of
seconds in six hours. Then, when you've added all the different pieces
together, you'll have a final time that's measured in seconds - and
since that final time includes the time_left_house, it's actually
going to be the number of seconds since midnight. This is actually an
excellent way to represent time (number of seconds since some
"beginning point" aka epoch). There's then just one last step: Convert
it into hours, minutes, and seconds, for display. You have most of the
code for doing that.

So, work on this in two parts. In the first part, make your program
calculate how many seconds after midnight you'll get home. (The
correct answer there is 27006, according to my calculations. Of
course, you need to have a program that produces the correct answer,
not just the answer.) Then work out how to make that display as
hh:mm:ss.

I think you can probably get it from there - you're already a lot of
the way toward it. But if not, you know where to find us :)

ChrisA





Re: Python shell wont open IDLE or an exisiting .py files topic




On 1/29/2014 11:16 PM, Ben Finney wrote:
> Terry Reedy <(E-Mail Removed)> writes:
>
>> On 1/29/2014 6:26 PM, (E-Mail Removed) wrote:
>>> > If I launch the Python GUI it opens a Python Shell fine. But as
>>> > soon as I try to open a file (including a "new" file), it closes
>>> > the Shell.

>>
>> This I do not. What is 'Python GUI'? What is 'Python Shell'?

>
> Those are (part of) the names of menu entries created by the Python
> installer for MS Windows. I am not sure exactly what programs they
> invoke.


One entry is 'IDLE (Python GUI)'. I have never seen Idle referred to as
'Python GUI' as the later is non-specific and could refer to wxpython or
pyqt or some other Python GUI.

Idle open a window called Python x.y.z Shell (until recently just Shell).

The other menu entry is 'Python (Command line)' and I am guessing that
the paragraph above has nothing to do with this entry.

--
Terry Jan Reedy






mercredi 29 janvier 2014

Re: Python shell wont open IDLE or an exisiting .py files topic




On 1/29/2014 6:26 PM, (E-Mail Removed) wrote:
> I am on Windows 8, Python 3.3.4 and 3.3.3 and all previous versions
> exhibit the same problem on my Windows 8 PC. This problem occurred out
> of nowhere overnight. It was working fine for months until today.


Try the following, which I believe I said before.

1. Start the normal console interpreter 'Python (command interpreter)'
in the Start Menu.
2. In the interpreter, type
>>> import idlelib.idle

3. Open a file. If Idle quits,
4. If Idle quits, look in the console for an exception message.
5. If you do not understand it, *copy and paste the entire message* here.
6. If the Python console also closes, report here.


> > I tried to open a file and nothing happened. If I tried to open a

> .py file
> > (any .py file) from an existing instance of IDLE, it briefly flashed up a
> > new window and then closed both the new window and the existing window
> > (normally it opens the requested in a new window leaving the existing

> window
> > untouched).


This much I understood.

> > If I launch the Python GUI it opens a Python Shell fine. But as soon as I
> > try to open a file (including a "new" file), it closes the Shell.


This I do not. What is 'Python GUI'? What is 'Python Shell'?


> > I rebooted the machine. Same problem.
> >
> > I repaired the Python installation and rebooted. Same problem.
> >
> > I uninstalled Python. Rebooted. Deleted the Python33 directory entirely.
> > Rebooted. Installed Python. Rebooted. Same problem.
> >
> > Everything else on the system appears to be working just fine.
> >
> > Any ideas what the problem might be or how else I might go about fixing
> > things?

>
>
>
> Sent from Windows Mail
>
>
>



--
Terry Jan Reedy






Re: [RELEASED] Python 3.3.4 release candidate 1 topic




29.01.14 18:55, Andrew Svetlov написав(ла):
> Would you to accept fixes for http://bugs.python.org/issue20434 and
> http://bugs.python.org/issue20437 before 3.3.4 final?


And http://bugs.python.org/issue20440.







Re: [python-committers] [RELEASED] Python 3.3.4 release candidate 1 topic




Would you to accept fixes for http://bugs.python.org/issue20434 and
http://bugs.python.org/issue20437 before 3.3.4 final?

On Mon, Jan 27, 2014 at 9:36 AM, Georg Brandl <(E-Mail Removed)> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On behalf of the Python development team, I'm reasonably happy to announce the
> Python 3.3.4 release candidate 1.
>
> Python 3.3.4 includes several security fixes and over 120 bug fixes compared to
> the Python 3.3.3 release.
>
> This release fully supports OS X 10.9 Mavericks. In particular, this release
> fixes an issue that could cause previous versions of Python to crash when typing
> in interactive mode on OS X 10.9.
>
> Python 3.3 includes a range of improvements of the 3.x series, as well as easier
> porting between 2.x and 3.x. In total, almost 500 API items are new or improved
> in Python 3.3. For a more extensive list of changes in the 3.3 series, see
>
> http://docs.python.org/3.3/whatsnew/3.3.html
>
> and for the detailed changelog of 3.3.4, see
>
> http://docs.python.org/3.3/whatsnew/changelog.html
>
> To download Python 3.3.4 rc1 visit:
>
> http://www.python.org/download/releases/3.3.4/
>
> This is a preview release, please report any bugs to
>
> http://bugs.python.org/
>
> The final version is scheduled to be released in two weeks' time, on or about
> the 10th of February.
>
> Enjoy!
>
> - --
> Georg Brandl, Release Manager
> georg at python.org
> (on behalf of the entire python-dev team and 3.3's contributors)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (GNU/Linux)
>
> iEYEARECAAYFAlLmDI4ACgkQN9GcIYhpnLAr6wCePRbHF80k5g oV4RUDBA5FfkwF
> rLUAnRg0RpL/b6apv+Dt2/sgnUd3hTPA
> =Z4Ss
> -----END PGP SIGNATURE-----
> _______________________________________________
> python-committers mailing list
> (E-Mail Removed)
> https://mail.python.org/mailman/list...hon-committers




--
Thanks,
Andrew Svetlov





lundi 27 janvier 2014

Web service in Python topic




I installed rapidsms in local for send messages. The application tested with local server. Now i would like to store the incoming messages in another database via a php application. Means when a message received in rapidsms (Django-Python) app, i want to call a php application function and store message in php app database. For this which method is best?

Thanks





Run python script with CMD error topic




I m using Python 3.3 and the script is not written by me therefore i'm gonna try to install 2.7 instead and i will let you know the result.
Thank you Peter





Re: [RELEASED] Python 3.3.4 release candidate 1 topic




On 27/01/2014 07:36, Georg Brandl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On behalf of the Python development team, I'm reasonably happy to announce the
> Python 3.3.4 release candidate 1.
>


"Reasonably" happy? Is there a smiley missing there, or what? :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence






Re: Help: python 3.3.3 (AMD64) scripts fail as non-admin user onWindows Server 2012 R2 topic




On 26/01/2014 22:30, Luis Marsano wrote:
> I've installed python for all users with full permissions to all users
> (see picture).
> Python runs for all users.
> However, scripts only work when I run as Administrator.
> Running a script always results in an "ImportError: cannot import name" error.


As Steven's pointed out, this looks more like a Windows permissions
issue. However, it would still be worth identifying what's going on, as
I haven't run Python on a 2012 box (and I doubt if many other people
have either). I'm getting a VM run up to try it out but that will take a
while.

It may be that some hardened security is preventing Python from reading
its own files. Could you, please, do the simplest of imports which
fails, and post the traceback from the console in its entirety? (In
other words, something like this):

"""
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import willnotimport

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'willnotimport'
>>>

"""

It would be good to know whether *anything* imports, ie whether stdlib
imports work, or whether it's just user-installed modules.


Thanks

TJG





[RELEASED] Python 3.3.4 release candidate 1 topic




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On behalf of the Python development team, I'm reasonably happy to announce the
Python 3.3.4 release candidate 1.

Python 3.3.4 includes several security fixes and over 120 bug fixes compared to
the Python 3.3.3 release.

This release fully supports OS X 10.9 Mavericks. In particular, this release
fixes an issue that could cause previous versions of Python to crash when typing
in interactive mode on OS X 10.9.

Python 3.3 includes a range of improvements of the 3.x series, as well as easier
porting between 2.x and 3.x. In total, almost 500 API items are new or improved
in Python 3.3. For a more extensive list of changes in the 3.3 series, see

http://docs.python.org/3.3/whatsnew/3.3.html

and for the detailed changelog of 3.3.4, see

http://docs.python.org/3.3/whatsnew/changelog.html

To download Python 3.3.4 rc1 visit:

http://www.python.org/download/releases/3.3.4/

This is a preview release, please report any bugs to

http://bugs.python.org/

The final version is scheduled to be released in two weeks' time, on or about
the 10th of February.

Enjoy!

- --
Georg Brandl, Release Manager
georg at python.org
(on behalf of the entire python-dev team and 3.3's contributors)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlLmDI4ACgkQN9GcIYhpnLAr6wCePRbHF80k5g oV4RUDBA5FfkwF
rLUAnRg0RpL/b6apv+Dt2/sgnUd3hTPA
=Z4Ss
-----END PGP SIGNATURE-----





dimanche 26 janvier 2014

Re: Help: python 3.3.3 (AMD64) scripts fail as non-admin user onWindows Server 2012 R2 topic




On Sun, 26 Jan 2014 17:30:21 -0500, Luis Marsano wrote:

> I've installed python for all users with full permissions to all users
> (see picture).
> Python runs for all users.
> However, scripts only work when I run as Administrator. Running a script
> always results in an "ImportError: cannot import name" error. Here, for
> example, is the output of "pip -h" run as an unprivileged user:



This does not appear to be a Python problem. This appears to be a generic
Windows permissions problem. My guess is that you've made sure that the
Python .exe is executable by all users, but the standard library files
are only readable by the Administrator user.



--
Steven