SEARCH YOUR SOLUTION HERE  

Why gives "k = 09" a syntax error ?

hello, Why gives "k = 09" a syntax error

Posted On: Saturday 24th of November 2012 01:06:51 AM Total Views:  245
View Complete with Replies




Related Messages:

Re: Why gives "k = 09" a syntax error ?   (91 Views)
Stef Mientki wrote: > hello, > > Why gives "k = 09" a syntax error You have gotten the 2.x answer. In 3.0, 0b,0o,0x prefixes are valid and required for binary, octal, and hexadecimal literals. 0digits is invalid. tjr
Re: Why gives "k = 09" a syntax error ?   (94 Views)
2008/10/29 Stef Mientki : > hello, > > Why gives "k = 09" a syntax error Because leading zero means that the number is octal, and there is no 9 among octal digits. > > thanks, > Stef Mientki > -- > http://mail.python.org/mailman/listinfo/python-list > -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk.
Re: Why gives "k = 09" a syntax error ?   (88 Views)
Guilherme Polo wrote: > On 10/29/08, Stef Mientki wrote: > >> hello, >> >> Why gives "k = 09" a syntax error >> >> > > 09 is not a valid octal number. Instead use 011. > > Ok, I guess you were not aware that prefixing a number with a '0' > would cause python to parse it as an octal and now you know. >
ftplib.nlst gives error on empty directory   (176 Views)
Trying to use ftplib.FTP.nlst() method to list the files in a directory on a FTP server. It works fine except when there are no files in the directory. Then it gives the error ftplib.error_perm: 550 No files found. How can I handle this cleanly
Logging module gives duplicate log entries   (126 Views)
I am getting duplicate log entries with the logging module. The following behaves as expected, leading to one log entry for each logged event: logging.basicConfig(level=logging.DEBUG, filename='/tmp/foo.log') But this results in two entries for each logged event: applog = logging.getLogger() applog.setLevel(logging.DEBUG) hdl = logging.FileHandler('/tmp/foo.log') applog.addHandler(hdl) The app is based on the web.py framework, so I guess my problem may be connected to be some interaction with other uses of logging within the framework. This is not specific to the root logger, the same happens with logging.getLogger('foo'). Any clue would be more than welcome. best, ShiaoBu , > > You need to remove the handler from the logging object > > # remove the handler once you are done > applog.removeHandler(hdl) > > Cheers, > amit. > I'm not sure how this could help.
Re: why ctypes+dll gives a strange result   (358 Views)
En Sun, 11 Nov 2007 08:21:25 -0300, oyster escribi: > import ctypes > mydll=ctypes.windll.LoadLibrary("mydll.dll") > > _TwoTimes=getattr(mydll,'TWOTIMES@8') > _TwoTimes.argtypes=[ctypes.c_double] > def TwoTimes(i): > return _TwoTimes(i) > > in fact, twotimes function return double*2, but when I use > print TwoTimes(10) > in python, I get 2226880 I think you should declare the result type also, if it's not an integer. _TwoTimes.restype=ctypes.c_double -- Gabriel Genellina
python-dev Summary for 2004-09-01 through 2004-09-15   (251 Views)
python-dev Summary for 2004-09-01 through 2004-09-15 ++++++++++++++++++++++++++++++++++++++++++++++++++++ This is a summary of traffic on the `python-dev mailing list`_ from September 01, 2004 through September 15, 2004. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-list@python.org which is a gateway to the newsgroup) with a subject line mentioning what you are discussing. python-dev members are interested in seeing ideas discussed by the community, so don't hesitate to take a stance on something. And if all of this really interests you then get involved and join `python-dev`_! This is the forty-eighth summary written by Brett Cannon (hopefully school won't drown my this quarter). To contact me, please send email to brett at python.org ; I do not have the time to keep up on comp.lang.python and thus do not always catch follow-ups posted there. summaries are archived at http://www.python.org/dev/summary/ . Please note that this summary is written using reStructuredText_ which can be found at http://docutils.sf.net/rst.html . Any unfamiliar punctuation is probably markup for reST_ (otherwise it is probably regular expression syntax or a typo =); you can safely ignore it, although I suggest learning reST; it's simple and is accepted for `PEP markup`_ and gives some perks for the HTML output. Also, because of the wonders of programs that like to reformat text, I cannot guarantee you will be able to run the text version of this summary through Docutils_ as-is unless it is from the `original text file`_. ... _PEP Markup: http://www.python.org/peps/pep-0012.html The in-development version of the documentation for Python can be found at http://www.python.org/dev/doc/devel/ and should be used when looking up any documentation on new code; otherwise use the current documentation as found at http://docs.python.org/ . PEPs (Python Enhancement Proposals) are located at http://www.python.org/peps/ . To view files in the Python CVS online, go to http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/ . Reported bugs and suggested patches can be found at the SourceForge_ project page. The `Python Software Foundation`_ is the non-profit organization that holds the intellectual property for Python. It also tries to forward the development and use of Python. But the PSF_ cannot do this without donations. You can make a donation at http://python.org/psf/donations.html . Every penny helps so even a small donation (you can donate through PayPal or by check) helps. ... _python-dev: http://www.python.org/dev/ ... _SourceForge: http://sourceforge.net/tracker/group_id=5470 ... _python-dev mailing list: http://mail.python.org/mailman/listinfo/python-dev ... _comp.lang.python: http://groups.google.com/groupsq=comp.lang.python ... _Docutils: http://docutils.sf.net/ ... _reST: ... _reStructuredText: http://docutils.sf.net/rst.html ... _PSF: ... _Python Software Foundation: http://python.org/psf/ ... contents:: ... _last summary: http://www.python.org/dev/summary/20...004-08-31.html ... _original text file: http://www.python.org/dev/summary/20..._2004-09-15.ht ===================== Summary Announcements ===================== Python 2.4a3 has been released. Go to http://www.python.org/2.4/ and give it twirl. Sorry for this summary being so short, but school has started back up again so I am in the middle of suddenly having to switch back into homework mode after spending the summer just having a 9:00-17:00 job. And since it is a new school year I am going to abuse this space and say that anyone in San Luis Obispo, including students, should join the `SLO Meetup`_ coming up on October 14. ... _SLO Meetup: http://python.meetup.com/95/ ========= Summaries ========= -------------------- Movement in PEP Land -------------------- `PEP 334`_ (Simple Coroutines via SuspendIteration) came into existence. `PEP 328`_ (Relative Imports) got some discussion on postponing making imports absolute instead of the relative/absolute semantics they have now. As it stands it looks like the changeover might get pushed off. `PEP 292`_ (Simpler String Substitutions) seems to finally be done and locked down. `PEP 335`_ (Overloadable Boolean Operators) came into existence. ... _PEP 334: http://www.python.org/peps/pep-0334.html ... _PEP 328: http://www.python.org/peps/pep-0328.html ... _PEP 292: http://www.python.org/peps/pep-0292.html ... _PEP 335: http://www.python.org/peps/pep-0335.html Contributing threads: - `PEP 334 - Simple Coroutines via SuspendIteration `__ - `PEP 328 - Relative Imports `__ - `Re: Alternative Implementation for PEP 292:Simple String Substitutions `__ - `ANN: PEP 335: Overloadable Boolean Operators `__ ------------------------------------------------------ __str__, __unicode__, and how to have them play nicely ------------------------------------------------------ Did you know that __str__ methods are allowed to return Unicode objects Well, it turns out they can, but that str() (which calls PyObject_Str()) automatically tries to convert the value returned by __str__ into ASCII. Basically __str__ shouldn't return Unicode if you can help it and you should use __unicode__ instead and reserve __str__ to return str objects only. Contributing threads: - unicode and __str__ (couldn't find in archives) ---------------------- Backporting C APIs bad ---------------------- Somebody (*cough* Guido *cough*) asked if the datetime C API could be backported to 2.3 . The argument was that the only person who would probably use it is the person who asked for it, the author of cx_Oracle. Well, pretty much spoke up against this. The argument went that adding an API would just be bad since there would suddenly be a point in the 2.3 releases where backwards compatibility was broken. People brought up the point of 2.2 where in 2.2.1 booleans were added and how that has caused compatibility headaches for some people. In the end the API was not backported. Contributing threads: - `Re: [Python-checkins] python/dist/src/Modules threadmodule.c, 2.56, 2.56.8.1 `__ ---------------------------------------------------------------------- Got to love race conditions thanks to the filesystem and external apps ---------------------------------------------------------------------- Tim Peters found a race condition one can have on Windows if you have an app that uses the low-level hooks into the filesystem. If you create a file, delete it, and then try to delete the directory the directory deletion will fail since the file is not deleted yet. What can happen is an indexing program can still be indexing the file before the filesystem is allowed to delete it and thus the directory is not truly empty when the directory deletion is executed. Fun stuff. Contributing threads: - `Coernic Desktop Search versus shutil.rmtree `__ ------------------------------- Python 2.4a3 is out the door!!! ------------------------------- Go to http://www.python.org/2.4/ , download it (using the bz2 version if possible so as to save on bandwidth), and run it against your code, run the test suite, put it on your head and sell yourself to an art gallery, etc. Contributing threads: - `RELEASED Python 2.4, alpha 3 `__ ---------------------------- Cleaning the Exception House ---------------------------- The idea of reorganizing the exceptions hierarchy came up again (see http://www.python.org/dev/summary/20...from-exception for a previous discussion on this). This time, the idea of separating the hierarchy into exceptions one would like to catch with a bare 'except' and those that you wouldn't was brought up. The idea is that some exceptions, such as MemoryError, one does not want to catch in a blanket statement usually. Chances of recovering from that kind of exception is low and should only be caught if you know what you are doing. So tweaking the exception hierarchy so that exceptions that were not near-catastrophic could inherit from an exception class that people could catch so as to allow the proper exceptions to propagate to the top-level without issue. Tim Peters even went as far as to suggest deprecating bare 'except' statements. This would force people to be explicit about what they want to catch, whether it be all "safe" exceptions or *all* exceptions. As it stands now no officially decision has been made for Python 3000 since that is about the only place this could happen. Contributing threads: - `Dangerous exceptions `__ --------------------------------------------------------------- Making decorators not look like decorators to the outside world --------------------------------------------------------------- Raymond Hettinger pointed out that a decorator does not, by default, look like the function that it is fiddling with (if that is the intent). Since most decorators will most likely be a wrapper function some things need to be set in the wrapper in order not to mask things in the wrapped function (doc string, argument parameters, etc.). So Raymond pointed out some things one can do. This also led to the suggestion of having a common name used to store a reference back to the wrapped function. There was also the mention that a decorator-oriented module in the stdlib will probably materialize in Python 2.5 . For now, though, stick recipes either in the Python Cookbook or in the Python wiki at http://www.python.org/cgi-bin/moinmo...coratorLibrary . Contributing threads: - `decorator support `__ =============== Skipped Threads =============== - random.py still broken wrt. urandom - random.py fixage - Re: [Python-checkins] python/dist/src/Lib/test test_compiler.py, 1.5, 1.6 test_decimal.py, 1.13, 1.14 - assert failure on obmalloc - Re: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.304, 1.305 - Install-on-first-use vs. optional extensions - Console vs. GUI applications - Adding status code constants to httplib - PEP 292: method names - PEP 265 - Sorting dicts by value - httplib is not v6 compatible, is this going to be fixed - OT: Unicode history - --with-tsc compile fails - tempfile.TemporaryFile on Windows NT - PyExc_UnicodeDecodeError - urllib.urlopen() vs IDNs, percent-encoded hosts, ':' - tabs in httplib.py and test_httplib.py There is now a vimrc file in the Misc directory that sets things up to follow PEPs 7 & 8 - strawman decision: @decorator won't change - unicode inconsistency
Bookmarks Database and Internet Robot version 3.4.0 (2004-09-23)   (134 Views)
! Bookmarks Database and Internet Robot WHAT IS IT A set of classes, libraries, programs and plugins I use to manipulate my bookmarks.html. I like Mozilla, but I need more features. I want to extend Mozilla's "Check for updates" feature (Navigator4 called it "Update bookmarks"). WHAT'S NEW in version 3.4.0 (2004-09-23) Extended support for Mozilla; keywords in bookmarks. Updated to m_lib version 1.2. WHAT'S NEW in version 3.3.2 parse_html.py can now recode unicode entities in titles. WHAT'S NEW in version 3.3.0 Required Python 2.2. HTML parser. If the protocol is HTTP, and there is Content-Type header, and content type is text/html, the object is parsed to extract its title; if the Content-Type header has charset, or if the HTML has with charset, the title is converted from the given charset to the default charset. The is also parsed to extract tag with redirect, if any. WHAT'S NEW in version 3.0 Complete rewrite from scratch. Created mechanism for pluggable storage managers, writers (DB dumpers/exporters) and robots. WHERE TO GET Master site: http://phd.pp.ru/Software/Python/#bookmarks_db Faster mirrors: http://phd.by.ru/Software/Python/#bookmarks_db http://phd2.chat.ru/Software/Python/#bookmarks_db AUTHOR Oleg Broytmann COPYRIGHT Copyright (C) 1997-2004 PhiloSoft Design LICENSE GPL TODO Cleanup HTML before parsing using BeautifulSoap or Tidy. Parse downloaded file and get javascript redirects. More and better documentation. Merge "writers" to storage managers. New storage managers: shelve, SQL, ZODB, MetaKit. More robots (URL checkers): threading, asyncore-based. Configuration file to configure defaults - global defaults for the system and local defaults for subsystems. Ruleset-based mechanisms to filter out what types of URLs to check: checking based on URL schema, host, port, path, filename, extension, etc. Detailed reports on robot run - what's old, what's new, what has been moved, errors, etc. WWW-interface to the report. Bigger database. Multiuser database. Robot should operates on a part of the DB. WWW-interface to the database. User should import/export/edit bookmarks, schedule robot run, etc. Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
python-dev Summary for 2003-09-01 through 2003-09-15   (109 Views)
python-dev Summary for 2003-09-01 through 2003-09-15 ++++++++++++++++++++++++++++++++++++++++++++++++++++ This is a summary of traffic on the `python-dev mailing list`_ from September 1, 2003 through September 15, 2003. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-list@python.org which is a gateway to the newsgroup) with a subject line mentioning what you are discussing. python-dev members are interested in seeing ideas discussed by the community, so don't hesitate to take a stance on something. And if all of this really interests you then get involved and join `python-dev`_! This is the twenty-fifth summary written by Brett Cannon (with school looming on the horizon). summaries are archived at http://www.python.org/dev/summary/ . Please note that this summary is written using reStructuredText_ which can be found at http://docutils.sf.net/rst.html . Any unfamiliar punctuation is probably markup for reST_ (otherwise it is probably regular expression syntax or a typo =); you can safely ignore it, although I suggest learning reST; it's simple and is accepted for `PEP markup`_ and gives some perks for the HTML output. Also, because of the wonders of programs that like to reformat text, I cannot guarantee you will be able to run the text version of this summary through Docutils_ as-is unless it is from the original text file. ... _PEP Markup: http://www.python.org/peps/pep-0012.html The in-development version of the documentation for Python can be found at http://www.python.org/dev/doc/devel/ and should be used when looking up any documentation on something mentioned here. PEPs (Python Enhancement Proposals) are located at http://www.python.org/peps/ . To view files in the Python CVS online, go to http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/ . Reported bugs and suggested patches can be found at the SourceForge_ project page. ... _python-dev: http://www.python.org/dev/ ... _SourceForge: http://sourceforge.net/tracker/group_id=5470 ... _python-dev mailing list: http://mail.python.org/mailman/listinfo/python-dev ... _comp.lang.python: http://groups.google.com/groupsq=comp.lang.python ... _Docutils: http://docutils.sf.net/ ... _reST: ... _reStructuredText: http://docutils.sf.net/rst.html ... contents:: ... _last summary: http://www.python.org/dev/summary/20...003-08-31.html ===================== Summary Announcements ===================== Summary is nice and short this time. More people went on vacation (although Martin came back and so that helped to pick up the traffic a little). I skipped covering some threads that are due for PEPs since those will be more in-depth then anything I write. I should give fair warning that starting on the 22nd of September I will begin school. I am hoping that it will not be difficult and I will have a carefree time in school. But if my workload becomes a burden the Summaries might suffer. I hope they don't, though, and I am going to do my best to make sure that doesn't happen. ========= Summaries ========= --------------------------------------- If It Isn't Documented, Is It a Secret --------------------------------------- Some undocumented methods in readline were discovered by Philip Eby. He asked if this was on purpose and whether he should submit a bug report on the lack of documentation. Guido told him to go ahead and submit the bug report. If you ever find something undocumented in the Python source code and there is nothing suggesting the code is meant to be hidden from the user (it's for internal use, a comment says it is experimental, etc.), then please file a bug report! Contributing threads: - `Undocumented functions in 'readline' module `__ ----------------------------------------------------------------------------------------- "You are more trouble than you are worth!", screamed the micro release to the new feature ----------------------------------------------------------------------------------------- The topic of what should be backported for micro releases (with Python 2.3.1 looming on the horizon) came up. Originally minor improvements were allowed in if they didn't break backwards compatibility. And of course bugfixes have been as well as long as they didn't break code that came to depend on the buggy behavior (really depends on how long the bugginess has been there and how well-known it is). But then the point of OS X 10.3 possibly becoming the largest install base of Python of any version (it will be 2.3) came up. With rough estimates being thrown around of 5 million installs in about a year's time, the point that making it difficult to run Python 2.3.x code on that size of an install base would be bad. For instance, if some small new feature was added to 2.3.1 then any code using that feature would not be able to run on a virgin install of OS X 10.3 (and considering that this is Mac it should not be expected that most users will want to, let alone know how, to add a secondary install of Python since the original is used by the OS and thus should not be overwritten). It looks like a more conservative patching scheme will be taken with micro releases. Bytecode will also continue to work between releases. Guido has always unofficially held that position but now it has been vocalized. Contributing threads: - `Documenting branch policy `__ ---------------------------------------------- PyPy "Berlin" sprint (29th Sep - 4th Oct 2003) ---------------------------------------------- Just what the title says: there is going to be a sprint_ for PyPy_ in Berlin from September 29 to October 4. Read the email for more specific details on goals and such. ... _sprint: http://www.python.org/cgi-bin/moinmoin/SprintPlan ... _PyPy: http://codespeak.net/pypy/index.cgihome Contributing threads: - `PyPy "Berlin" sprint (29th Sep - 4th Oct 2003) `__ -------------------------------- Away with you ambiguous imports! -------------------------------- A discussion on how to create a hierarchy of loggers in the standard library led to the idea of having a way to cause an import to come directly from the standard library and thus remove any ambiguity from a relative import grabbing a similarly named module from the local package. Barry Warsaw said he was thinking of writing a PEP on this idea. Contributing threads: - `Consistent logging in the standard library `__ --------------------------------------------------- Quick: want to give a Python talk at Linuxworld NY --------------------------------------------------- If you are interested in what the title asks, then read the email for some details. Contributing threads: - `Quick: want to give a Python talk at Linuxworld NY `__ ------------------------------------------- Be careful about saying something is "easy" ------------------------------------------- A word of advice about saying something is "easy" on python-dev: if you say that you should make sure you can back up that claim because otherwise you will be told to write the "easy" patch and that will be the end of the discussion. Contributing threads: - `Making python C-API thread safe (try 2) `__ -------------------------- Parsing dates for datetime -------------------------- There was some talk about coming up with some code to parse dates for the datetime module. It was kind of hand-wavy since there are multiples chunks of code that can do that in the standard library. If you have an opinion on this (or anything for that matter), make sure to make a post to `comp.lang.python`_ about it. Contributing threads: - `datetime issues `__
python openssl x509 CA   (85 Views)
, I'm fighting with Certificate Authority functionality with python I stuck on following problem: How to sign CSR using CA key and write resulted certificate. You can do it using following openssl cmd: openssl ca -cert CA/cert.pem -keyfile CA/private/cakey.pem -policy policy_anything -out user_cert.pem -infiles userreq.pem My try was: import OpenSSL.crypto as pki #load CA key: ca_key=pki.load_privatekey(pki.FILETYPE_PEM,open('CA/private/ cakey.pem').read(),'haselko') #load user's csr: csr=pki.load_certificate_request(pki.FILETYPE_PEM,open('userreq.pem').read()) # sign csr csr.sign(ca_key,'sha1') I don't get any erorrs however I dont' see any way to write or get result from such operation csr exports following methods: csr.add_extensions csr.get_pubkey csr.get_subject csr.set_pubkey csr.sign csr.verify I want to create pure python implementation without use of openssl wrapped with python code.
Call for proposals -- PyCon 2009   (528 Views)
Call for proposals -- PyCon 2009 -- =============================================================== Want to share your experience and expertise PyCon 2009 is looking for proposals to fill the formal presentation tracks. The PyCon conference days will be March 27-29, 2009 in Chicago, Illinois, preceded by the tutorial days (March 25-26), and followed by four days of development sprints (March 30-April 2). Previous PyCon conferences have had a broad range of presentations, from reports on academic and commercial projects to tutorials and case studies. We hope to continue that tradition this year. Online proposal submission will open on September 29, 2008. Proposals will be accepted through November 03, with acceptance notifications coming out on December 15. For the detailed call for proposals, please see: We look forward to seeing you in Chicago!
Symposium ?Image Processing and ****ysis? within the ICCES'09 Thailand - Announce & Call for Papers   (89 Views)
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) ********************************************************************************************************************** Symposium Image Processing and ****ysis International Conference on Computational & Experimental Engineering and Sciences 2009 (ICCES'09) Phuket, Thailand, 8-13 April 2009 http://icces.org/cgi-bin/ices09/pages/index ********************************************************************************************************************** Dear Colleague, Within the International Conference on Computational & Experimental Engineering and Sciences 2009 (ICCES'09), to be held in Phuket, Thailand, in 8-13 April 2009, we are organizing the Symposium Image Processing and ****ysis. Examples of some topics that will be considered in that symposium are: Image restoring, Description, Compression, Segmentation and Description; Objects tracking, Matching, Reconstruction and Registration; Visualization Enhance; Simulation and Animation; Software Development for Image Processing and ****ysis; Grid Computing in Image Processing and ****ysis; Applications of Image Processing and ****ysis. Due to your research activities in those fields, we would like to invite you to submit your work and participate in the Symposium Image Processing and ****ysis. For instructions and submission, please access to the conference website at: http://icces.org/cgi-bin/ices09/pages/index. Please note, when submitting your work you should choose the Symposium Image Processing and ****ysis. Important dates and Instructions: - 15 Oct 2008: Start abstract submission; - 1 Jan 2009: Deadline for abstract submission; - 10 Jan 2009: End of abstract selection. If you intend to submit your work please notify as soon as possible the main organizer of your intention (tavares@fe.up.pt); Instructions for authors are available at: http://icces.org/cgi-bin/ices09/pages/guide. With kind regards, Yours sincerely, The Organizers, Joo Manuel R. S. Tavares (tavares@fe.up.pt) (main organizer) Faculty of Engineering of University of Porto, Porto, Portugal Yongjie (Jessica) Zhan (jessicaz@andrew.cmu.edu) Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, USA Maria Joo M. Vasconcelos (maria.vasconcelos@fe.up.pt) Faculty of Engineering of University of Porto, Porto, Portugal
py2exe socket.gaierror (10093)   (190 Views)
I have encountered a problem which I can not figure out a solution to. Tried Googeling it, but to no help unfortunately. The problem is running smtplib in a py2exe compiled exe file. When it tries to establish a socket to the mail server it fails. Just wondering someone has encountered this before, and if someone might be able to point me in the right direction. Unhandled exception in thread started by Traceback (most recent call last): File "AutomationThread.pyc", line 152, in Run File "mail.pyc", line 11, in sendMail File "smtplib.pyc", line 244, in __init__ File "smtplib.pyc", line 296, in connect socket.gaierror: (10093, 'getaddrinfo failed') Thank you !
array.shape() gives TypeError: 'tuple' object is not callable   (97 Views)
Hi gys -- I am looking at Numpy but getting this error when I try to get array sizes. I'm using Ubuntu Edgy with standard repositories and scipy. Any ideas Am I doing something wrong or is it my install of scipy $ python Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from numpy import * >>> a=array([[1,2],[3,4]]) >>> a array([[1, 2], [3, 4]]) >>> a.shape() Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object is not callable >>>
Re: webbrowser.open still gives problem with file://   (170 Views)
En Mon, 12 Nov 2007 16:18:06 -0300, krishnakant Mane escribi: > some days bac I posted a problem about webbrowser.open() not opening > the file on the local machine. > I get a few responses and I tryed working it out. > I also refered to the cookbook example posted on that thread. > I still can't figure out why > webbrowser.open("file:///home/krishna/documents/tut.html") does not > open the file. > as I mentioned earlier the url in the addressbar of mozilla firefox 3 > alpha is "file:///home/krishna/"/home/krishna/documents/tut.html" > which is indeed wrong. I can think of two alternatives: 1) omit the file: protocol, and just use the absolute file path, like webbrowser.open("/home/krishna/documents/tut.html") 2) use this recipe which lets you display content inside a browser window without requiring a temporary file. -- Gabriel Genellina
python-dev Summary for 2003-09-16 through 2003-09-30   (102 Views)
python-dev Summary for 2003-09-16 through 2003-09-30 ++++++++++++++++++++++++++++++++++++++++++++++++++++ This is a summary of traffic on the `python-dev mailing list`_ from September 16, 2003 through September 30, 2003. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-list@python.org which is a gateway to the newsgroup) with a subject line mentioning what you are discussing. python-dev members are interested in seeing ideas discussed by the community, so don't hesitate to take a stance on something. And if all of this really interests you then get involved and join `python-dev`_! This is the twenty-sixth summary written by Brett Cannon (homework, the Summaries, how does he find the time). summaries are archived at http://www.python.org/dev/summary/ . Please note that this summary is written using reStructuredText_ which can be found at http://docutils.sf.net/rst.html . Any unfamiliar punctuation is probably markup for reST_ (otherwise it is probably regular expression syntax or a typo =); you can safely ignore it, although I suggest learning reST; it's simple and is accepted for `PEP markup`_ and gives some perks for the HTML output. Also, because of the wonders of programs that like to reformat text, I cannot guarantee you will be able to run the text version of this summary through Docutils_ as-is unless it is from the original text file. ... _PEP Markup: http://www.python.org/peps/pep-0012.html The in-development version of the documentation for Python can be found at http://www.python.org/dev/doc/devel/ and should be used when looking up any documentation on something mentioned here. PEPs (Python Enhancement Proposals) are located at http://www.python.org/peps/ . To view files in the Python CVS online, go to http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/ . Reported bugs and suggested patches can be found at the SourceForge_ project page. ... _python-dev: http://www.python.org/dev/ ... _SourceForge: http://sourceforge.net/tracker/group_id=5470 ... _python-dev mailing list: http://mail.python.org/mailman/listinfo/python-dev ... _comp.lang.python: http://groups.google.com/groupsq=comp.lang.python ... _Docutils: http://docutils.sf.net/ ... _reST: ... _reStructuredText: http://docutils.sf.net/rst.html ... contents:: ... _last summary: http://www.python.org/dev/summary/20...003-09-15.html ===================== Summary Announcements ===================== First, sorry about the lateness of this summary. I have started my first quarter at `Cal Poly SLO`_. Not only do I get to deal with being back in school for the first time in over a year, but I also get to be abruptly introduced to the quarter system. Joys abound for me. I am still reworking how I manage my time and the Summaries were the first thing to take a back seat. Hopefully this won't happen again. In case you have not been following general Python news, `Python 2.3.2`_ is now the newest release of Python. In case you missed the Python 2.3.1 release, then you missed the little hiccup in that release, which is fine. The Python 2.3.2 release does not technically fall under the jurisdiction of this summary, but I am not going to wait half a month to let people know about it. ... _Cal Poly SLO: http://www.calpoly.edu/ ... _Python 2.3.2: http://www.python.org/2.3.2/ ========= Summaries ========= ---------------------------------------------------------- Deprecations won't spontaneously appear in a micro release ---------------------------------------------------------- In case you don't know, sets.BaseSet.update() has been deprecated in favor of union_update() in order to cut out the unneeded duplication of functionality in Python 2.4 . While 2.3.1 was still under development it grew a PendingDeprecationWarning. This did not sit well with some people. The argument for the PendingDeprecationWarning was that it is silent by default and gives people a heads-up in terms of things that are known to be deprecated in the next minor version of Python. Against this idea, the argument that it adds a change between micro versions that is not a bug fix was raised. In the end this won. Contributing threads: - `pending deprecation warning for Set.update `__ ------------------------------ Web-SIG on its way, supposedly ------------------------------ Bill Janssen is working on a charter so a Web SIG_ can be started in order to redesign the cgi module as the main goal, but also just making Python friendlier to web coding in general. ... _SIG: http://www.python.org/community/sigs.html Contributing threads: - `Improving the CGI module `__ ------------------------------------------- Threads and the desolation that is shutdown ------------------------------------------- Tim Peters decided to try to deal with the fact that the Zope 3 testing suite was spitting out a ton of messages about unhandled exceptions during shutdown of the interpreter. It turned out that threads were still running during shutdown and thus were throwing a fit because they were accessing module globals that were being torn down and set to None. The problem went away when the second call to PyGC_Collect() in Py_Finalize() was commented out. This is not totally acceptable since the second call is there to help collect garbage at shutdown so that things clean up properly. Tim did end up suggesting just taking it out, though, for a future version of Python. He also suggested tearing down the sys module even later (and thus "even more of a special case than it is now"). This would leave sys.modules around and thus not cause globals to turn to None and cause errors from that side-effect. Neither solution has been taken yet. A temporary solution if you keep running into this is to make sure that either your cleanup code only accesses local variables (if you have to store references to globals since that will keep them around for you during shutdown). Contributing threads: - `Fun with 2.3 shutdown `__ ---------------------- Where is str.rsplit! ---------------------- The reason str.rsplit does not exist in Python is because the method is not difficult to code on your own. And yet people still want it. But there was not of a public outcry and the topic just fizzled. Contributing threads: - `Discussion on adding rsplit() for strings and unicode objects. `__ ----------------- Waxing on PEP 310 ----------------- Holger Krekel brought up PEP 310 (entitled "Reliable Acquisition/Release Pairs") in terms of how code blocks should handle exceptions and such. Michael Hudson suggested that might be taking PEP 310 beyond what it is meant to cover. To this, Holger suggested that then perhaps some other route should be taken. As with all PEPs, discussion of them is always helpful for python-dev and the community. It helps hash out ideas and gives python-dev feedback on whether a PEP should be rejected. Contributing threads: `pep 310 (reliable acquisition/release pairs) `__ ------------------------------------------------------------ bsddb3 failures and the database system it wraps, news at 10 ------------------------------------------------------------ The bsddb3 regression tests were failing during preparation for Python 2.3.1 . Beyond the "the test just fails sometimes" issues that come up with tests that are finicky because of timing, it was suggested that the failures are the fault of the Sleepycat_ DB code. It is still being looked into. ... _Sleepycat: http://www.sleepycat.com/ Contributing threads: - `latest bsddb3 test problems `__ ---------------------------------------------------- We want *you* to help with the war on SF patch items ---------------------------------------------------- Someone wanted to help but wasn't sure how they could. Martin v. Loewis sent an email listing common things anyone can do to help with dealing with the patch items on SourceForge_. The email can be found at http://mail.python.org/pipermail/pyt...er/038253.html . Contributing threads: - `Help offered `__ --------------- Python glossary --------------- Skip Montanaro converted the glossary he has as a wiki at http://manatee.mojam.com/python-glossary to the proper format to be included in the Python documentation. You can peruse the glossary as it stands in the documentation at http://www.python.org/dev/doc/devel/tut/node16.html.
Latest release of SalStat - version 20030911   (118 Views)
Hi folks & Pythonistas! I have just made a new source-code only release of SalStat - version 20030911 (codenamed "Texas!") which is available at the website http://salstat.sunsite.dk. The download is http://salstat.sunsite.dk/salstat.20030911.tar.gz (447k or thereabouts). Sorry, but binaries are not available as I'm up to my ears in Ph.D. work right now. SalStat is a Python/wxPython application for statistical ****ysis, a bit like a low-powered SPSS, but is growing all the time (should grow faster when my Ph.D. is finished..!), and is available under the GPL. I have also merged in wxPyPlot to produce some basic charts which can be saved in bitmapped graphics format (bmp, png and jpeg if I'm not mistaken). This version also features data transformations with buttons for common transforms (square, square root, reciprocal and log), but users can also enter whatever Python function they want. The transforms are non-destructive - any transformed data are automatically put into a new data column, leaving the existing data untouched. Future plans: Finished the xml data format which will enable users to audit their entire ****ysis session; add the multi-factorial anova (plus post-hoc tests and simple effects); improve the charting / graphing; move the code base up to Python 2.3 and wxPython 2.4.x; release executables for Windows & Linux; Add post-hoc ****ysis procecures for the nonparametric tests like Kruskal Wallis and Friedmans; Save the world from certain destruction... And dominate it... Joking about the last two. bug reports and suggestions for interface improvements are, as usual, more than welcome. Have fun! Alan James Salmoni SalStat Statistics http://salstat.sunsite.dk
Re: [PyCon-Organizers] PyCon 2009 (US) - Call for tutorials Extendedto 11/3   (80 Views)
We should get an announcement out on the blog: http://pycon.blogspot.com/ and note that the deadline is approaching for both talks and tutorials. For some reason blogger does not like my google account, so I cant seem to do it :-( ...
Re: Why gives "k = 09" a syntax error ?   (168 Views)
On 10/29/08, Stef Mientki wrote: > hello, > > Why gives "k = 09" a syntax error > 09 is not a valid octal number. Instead use 011. Ok, I guess you were not aware that prefixing a ...