[Python-announce] PyCon Tanzania 2022 - Call for Speakers, Presentations, Hackathons and Workshops - Last Reminder

2022-11-04 Thread Noah .
Dear Python Community,

We hope that you are all well to that end and that you have been busy
working on various awesome Python Code Bases. It's almost that time of the
year and we would like to engage the community for the Fourth ever Python
Conference which is planned to take place from* 4th - 7th December 2022** in
the beautiful and magnificent Island of ZANZIBAR and the venue shall be the
SUZA Auditorium in StoneTown.*

*PyCon Tanzania*, is seeking keynote speakers and instructors to contribute
to the Python Conference Program! *We are looking for speakers who would:*

- Offer a Keynote speaker on an appropriate technical topic;
- Offer a Technical Tutorial or Hackathon on an appropriate Python
topic;

*Topics must be relevant to the Python Language and Open Source Software:*

   - Python in Education
   - Python in Statistical Research
   - Python in Scientific Research
   - Python Machine Learning
   - Python & Artificial Intelligence
   - Open Source Software
   - Python  & Cyber Security
   - Python Gaming Development
   - Cloud Computing & Virtualisation
   - Ideas on improving diversity and inclusiveness
   - Python Functional programming etc
   - Python and IoT

*SUBMIT YOUR PRESENTATION / WORKSHOP/ HACKATHON / TUTORIAL BEFORE 11th Nov
2022 **To*:  *sp...@pycon.or.tz  *
Regards,
PyCon Tanzania 2022
Program Committee
http://www.pycon.or.tz/
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] PyCon Tanzania 2022 - Call for Speakers, Presentations, Hackathons and Workshops - 1st Reminder

2022-10-24 Thread Noah .
Dear Python Community,

We hope that you are all well to that end and that you have been busy
working on various awesome Python Code Bases. It's almost that time of the
year and we would like to engage the community for the Fourth ever Python
Conference which is planned to take place from* 4th - 7th December 2022** in
the beautiful and magnificent Island of ZANZIBAR.*

*PyCon Tanzania*, is seeking keynote speakers and instructors to contribute
to the Python Conference Program! *We are looking for speakers who would:*

- Offer a Keynote speaker on an appropriate technical topic;
- Offer a Technical Tutorial or Hackathon on an appropriate Python
topic;

*Topics must be relevant to the Python Language and Open Source Software:*

   - Python in Education
   - Python in Statistical Research
   - Python in Scientific Research
   - Python Machine Learning
   - Python & Artificial Intelligence
   - Open Source Software
   - Python  & Cyber Security
   - Python Gaming Development
   - Cloud Computing & Virtualisation
   - Ideas on improving diversity and inclusiveness
   - Python Functional programming etc
   - Python and IoT

*SUBMIT YOUR PRESENTATION / WORKSHOP/ HACKATHON / TUTORIAL BEFORE 05th Nov
2022 **To*:  *sp...@pycon.or.tz  *
Regards,
PyCon Tanzania 2022
Program Committee
http://www.pycon.or.tz/
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] Re: PyCon Tanzania 2021 - Call for Presentations and Workshop

2021-11-09 Thread Noah .
Dear Python Community,

If you plan on being in Arusha, Tanzania, please plan on joining the PyCon
Tanzania event. The final agenda will be up by 15th November 2021.

Cheers
Noah
PyCon Tanzania Secretariat
http://www.pycon.or.tz/


On Sat, Sep 25, 2021 at 9:27 PM Noah .  wrote:

> Dear Python Community,
>
> We hope that you are all well to that end and that you have been busy
> working on various awesome Python Projects. It's that time of the year
> folks and we would like to engage the community for another conference and
> workshops during the first week of December 2021.
>
> PyCon Tanzania, is seeking speakers of all experience levels and
> backgrounds to contribute to the Python Conference program! If you use the
> Python programming language professionally, as a hobbyist or are just
> excited about Python or programming and open source communities, we'd love
> to hear from you. We want you and your ideas at the upcoming Python
> Conference!
>
> *We are looking for presenters who would:*
>
> - Offer a technical tutorial on an appropriate topic;
> - Participate in the technical conference sessions as a speaker;
> - Convene and chair panel sessions of relevant topics.
>
> *Topics must be relevant to the Python Language and Open Source Software:*
>
>- Python usage in your Project
>- Python usage in Research
>- Machine Learning
>- Artificial Intelligence
>- Open Source Software
>- Cyber Security
>- Content Development
>- Gaming and Machine Vision
>- Cloud Computing & Virtualisation
>- Ideas on improving diversity and inclusiveness
>- Functional programming etc
>- Data Science
>
> *SUBMIT YOUR PRESENTATION / TUTORIAL BEFORE 15th NOV 2021 **TO*:*  
> sp...@pycon.or.tz
>  *
>
> *More details on timelines are here; *
> http://www.pycon.or.tz/speak/index.html
> *PyCon 2021 will take place in ARUSHA.*
>
> Regards,
> PyCon Tanzania 2021 Program Committee
> http://www.pycon.or.tz/
>
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] PyCon Tanzania 2021 - Call for Presentations and Workshop

2021-09-25 Thread Noah .
Dear Python Community,

We hope that you are all well to that end and that you have been busy
working on various awesome Python Projects. It's that time of the year
folks and we would like to engage the community for another conference and
workshops during the first week of December 2021.

PyCon Tanzania, is seeking speakers of all experience levels and
backgrounds to contribute to the Python Conference program! If you use the
Python programming language professionally, as a hobbyist or are just
excited about Python or programming and open source communities, we'd love
to hear from you. We want you and your ideas at the upcoming Python
Conference!

*We are looking for presenters who would:*

- Offer a technical tutorial on an appropriate topic;
- Participate in the technical conference sessions as a speaker;
- Convene and chair panel sessions of relevant topics.

*Topics must be relevant to the Python Language and Open Source Software:*

   - Python usage in your Project
   - Python usage in Research
   - Machine Learning
   - Artificial Intelligence
   - Open Source Software
   - Cyber Security
   - Content Development
   - Gaming and Machine Vision
   - Cloud Computing & Virtualisation
   - Ideas on improving diversity and inclusiveness
   - Functional programming etc
   - Data Science

*SUBMIT YOUR PRESENTATION / TUTORIAL BEFORE 15th NOV 2021 **TO*:*
sp...@pycon.or.tz
 *

*More details on timelines are here; *
http://www.pycon.or.tz/speak/index.html
*PyCon 2021 will take place in ARUSHA.*

Regards,
PyCon Tanzania 2021 Program Committee
http://www.pycon.or.tz/
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue43170] wintypes.SIZE is 8bytes on 32 bit machines

2021-02-08 Thread Noah Steinberg


New submission from Noah Steinberg :

Noticed while debugging a problem with a test running on Windows 10 x86 that 
sizeof(wintypes.SIZE)==8 when I believe it should be 4. While using 

kernel32.CreateRemoteThread.argtypes = [wintypes.HANDLE, wintypes.LPCVOID, 
wintypes.DWORD, wintypes.LPCVOID, wintypes.LPCVOID, wintypes.DWORD, 
wintypes.LPDWORD] 

and  

kernel32.CreateRemoteThread(h_process, 0, 0, 0xbadadd, 0, 4, byref(thread_id))

It caused CreateRemoteThread to recieve 4 as the last argument, resulting in an 
access denied

--
components: ctypes
messages: 38
nosy: nnstein
priority: normal
severity: normal
status: open
title: wintypes.SIZE is 8bytes on 32 bit machines
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue43170>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[osx] dyld: Library not loaded: /usr/local/Cellar/python@3.8/3.8.3_1/Frameworks/Python.framework/Versions/3.8/Python

2020-12-04 Thread Noah

Hi there,

Anybody know how to fix this issue on a mac?

❯ /usr/local/bin/python
dyld: Library not loaded: 
/usr/local/Cellar/python@3.8/3.8.3_1/Frameworks/Python.framework/Versions/3.8/Python

  Referenced from: /usr/local/bin/python
  Reason: image not found
[1]32209 abort  /usr/local/bin/python

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


[Conferences] PyCon Tanzania 2020 - Call for Presentations

2020-11-11 Thread Noah .
Dear Python Community,

PyCon Tanzania 2020 will take place on the 14th & 15th of December, 2020.
Since conference facilities have been open to the public, we will be
running PyCon Tanzania as an onsite event.

PyCon Tanzania, is seeking speakers of all experience levels and
backgrounds to contribute to the Python Conference program.

*We are looking for presenters who would:*

- Present a Keynote (30 minute long talks on a subject of general
interest)
- Talks for 30 minute on a specific topics as a speaker
- Offer a technical tutorial on an appropriate topic;
- Convene and chair panel sessions of relevant topics.

*Topics must be relevant to the Python Language and Open Source Software:*

   - Python usage in your Project
   - Python usage in Research
   - Machine Learning
   - Artificial Intelligence
   - Open Source Software
   - Cyber Security
   - Content Development
   - Gaming and Machine Vision
   - Cloud Computing & Virtualisation
   - Ideas on improving diversity and inclusiveness
   - Functional programming etc
   - Data Science

We hope to notify accepted presenters by no later than the 31st of November
2020.

*SUBMIT YOUR PRESENTATION / TUTORIAL TO*:* sp...@pycon.or.tz
 *

If you want to present something else at PyCon Tanzania, please contact the
organising committee at sp...@pycon.or.tz

Regards,
Noah
PyCon Tanzania 2020 Program Committee
http://www.pycon.or.tz/
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue40298] Type annotation objects (Tuple, List, etc.) register as callable()

2020-04-16 Thread Noah May


New submission from Noah May :

Whether this is considered a bug or not is subjective. The question is should 
callable(Tuple) return True or False? Or should it for any other annotation 
object?

The reason it returns true in the first place is because of a warning to 
explicitly NOT call them as functions/constructors:

>>> from typing import Tuple
>>> callable(Tuple)
True
>>> Tuple()
TypeError: Type Tuple cannot be instantiated; use tuple() instead

Source code: 
https://github.com/python/cpython/blob/master/Lib/typing.py#L724:L733

I honestly don't know how this could be "fixed" if it even needs to be fixed. 
But I just wanted to bring attention to it.

Cheers.

--
components: Library (Lib)
messages: 366580
nosy: Noah May
priority: normal
severity: normal
status: open
title: Type annotation objects (Tuple, List, etc.) register as callable()
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue40298>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-29 Thread Noah Massman-Hall


Noah Massman-Hall  added the comment:

I ended up doing exactly what I said would probably be needed, and wrote a 
small sphinx extension that handles this. I kept the same reST substitution 
syntax, but I'm parsing for '|ucd_version|' as the source files are read in and 
just replacing it with the version number.

Feedback is much appreciated. This is my first really involved PR. :)

--

___
Python tracker 
<https://bugs.python.org/issue22593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-29 Thread Noah Massman-Hall


Change by Noah Massman-Hall :


--
pull_requests: +17186
pull_request: https://github.com/python/cpython/pull/17748

___
Python tracker 
<https://bugs.python.org/issue22593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-26 Thread Noah Massman-Hall


Change by Noah Massman-Hall :


--
pull_requests:  -17155

___
Python tracker 
<https://bugs.python.org/issue22593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-26 Thread Noah Massman-Hall


Change by Noah Massman-Hall :


--
keywords: +patch
pull_requests: +17155
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17710

___
Python tracker 
<https://bugs.python.org/issue22593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-26 Thread Noah Massman-Hall


Noah Massman-Hall  added the comment:

I took a crack at the rst side of this, to see if I could reduce it to just one 
easy to parse for line in each file that needs to be modified.

Yeah, not so easy.

Substituting text in rst isn't hard, you just insert '|ucd_version|' where the 
version string should go and then include the following line somewhere below.

.. |ucd_version| replace:: 12.1.0

The problem is that I cant find any combination that makes this work for 
substituting the version string inside of a hyperlink. I've tried multiple 
combinations and every time the hyperlink gets broken.

So this, inside Doc/library/stdtypes.rst:

See http://www.unicode.org/Public/\ |ucd_version|\ 
/ucd/extracted/DerivedNumericType.txt

Becomes this in the html:

See http://www.unicode.org/Public/;>http://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedNumericType.txt

It does in fact do the substitution, but the substituted text onward doesn't 
get included in the hyperlink.

It gets worse if you try to hyperlink text instead of just the url.

In Doc/library/unicodedata.rst I tried this:

compiled from the |ucd_link|_.

.. |ucd_link| replace:: UCD version |ucd_version|
.. _ucd_link: http://www.unicode.org/Public/|ucd_version|/ucd

and got:

compiled from the http://www.unicode.org/Public/|ucd_version|/ucd">UCD version 12.1.0

The sub inside a sub works fine, but no combination I tried could get it to 
work in the hyperlink itself.

Near as I can tell, the only way to accomplish this would require adding or 
possibly creating a plugin for sphinx.

--
nosy: +nmassman

___
Python tracker 
<https://bugs.python.org/issue22593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Noah


Change by Noah :


--
keywords: +patch
pull_requests: +17126
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17658

___
Python tracker 
<https://bugs.python.org/issue39091>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Noah


Noah  added the comment:

I'm not sure if this will actually appear as a message (I just registered for 
the bug tracker and I'm not sure how it works), but I wrote the gist and I can 
definitely make a PR.

--
nosy: +coolreader18

___
Python tracker 
<https://bugs.python.org/issue39091>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Library Generate a diff between two text files

2019-11-25 Thread Noah
Hi Folks,

>From experience, could someone point me to a library that can do a diff
between two separate text files...

*difflib* doesn't seem to cut it to this end

*./noah*
neo - network engineering and operations
-- 
https://mail.python.org/mailman/listinfo/python-list


UG Announcement - Python Tanzania Community

2019-10-15 Thread Noah .
Dear Listers,

As per requirements, we are pleased to announce the existence of the Python
language community in Tanzania.

Please find below some information and the current developments.

*User Group Details;*

Name: Python Community Tanzania
Mailing list: https://mail.python.org/mailman3/lists/tanzania.python.org/
Under Other: Africa
First Local Meetings Held: Yes

*Meetings and Events;*

Name: PyCon Tanzania
Website: pycon.or.tz
Github:  https://github.com/pycontanzania
Under Other: Africa
Organizing Members: 5 - 10

Goal and motivation: To build and sustain while bringing together and
growing the Python language users and community in Tanzania through Python
related meetups, workshops and annual events.

FWIW, Tanzania is a peaceful nation formed out of the political union
between (Tanganyika and Zanzibar ) in the East African Region. The land of
the Serengeti Game Park and the tallest mountain in Africa, the Kilimanjaro.

For more about Tanzania [1] http://www.tanzania.go.tz/home/pages/68

Cheers,
Noah
Community Moderator
https://twitter.com/PyconTanzania
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


UG Announcement - Python Tanzania Community

2019-10-15 Thread Noah .
Dear Listers,

As per requirements, we are pleased to announce the existence of the Python
language community in Tanzania.

Please find below some information and the current developments.

*User Group Details;*

Name: Python Community Tanzania
Mailing list: https://mail.python.org/mailman3/lists/tanzania.python.org/
Under Other: Africa
First Local Meetings Held: Yes

*Meetings and Events;*

Name: PyCon Tanzania
Website: pycon.or.tz
Github:  https://github.com/pycontanzania
Under Other: Africa
Organizing Members: 5 - 10

Goal and motivation: To build and sustain while bringing together and
growing the Python language users and community in Tanzania through Python
related meetups, workshops and annual events.

FWIW, Tanzania is a peaceful nation formed out of the political union
between (Tanganyika and Zanzibar ) in the East African Region. The land of
the Serengeti Game Park and the tallest mountain in Africa, the Kilimanjaro.

For more about Tanzania [1] http://www.tanzania.go.tz/home/pages/68

Cheers,
Noah
Community Moderator
https://twitter.com/PyconTanzania
-- 
https://mail.python.org/mailman/listinfo/python-list


python requests get from API and post to another API and remote u'

2019-08-20 Thread Noah

Hi,

I am trying to migrate information and data between two systems using 
their corresponding APIs. I am using python requests.


I place a get request and the response from the API is "{'id': 32, 
'description': u'Firewall Outside', 'address': u'10.10.10.230/30'}"


I then take that information and attempt post it to the other API.  The 
data is not accepted and the result is an HTTP 400 code.


I tried posting with postman and still rejected.

I can post to the second API if I change the data to look like this: 
{"id": 32, "description": "Firewall Outside", "address": "10.10.10.230/30"}


How can I remove all u' from the get data or from the data I am 
attempting to post?


Cheers\
--
https://mail.python.org/mailman/listinfo/python-list


[issue37184] suggesting option to raise exception if process exits nonzero in `with subprocess.Popen(...):`

2019-06-11 Thread Noah


Noah  added the comment:

I subscribed and emailed python-id...@python.org but it still hasn't passed 
moderation I guess, hmm

--

___
Python tracker 
<https://bugs.python.org/issue37184>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37184] suggesting option to raise exception if process exits nonzero in `with subprocess.Popen(...):`

2019-06-06 Thread Noah


Noah  added the comment:

Yes, I'm piping a large amount of data to/from a fairly long-running subprocess.

--

___
Python tracker 
<https://bugs.python.org/issue37184>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37184] suggesting option to raise exception if process exits nonzero in `with subprocess.Popen(...):`

2019-06-06 Thread Noah


New submission from Noah :

Suggesting option to raise exception if process exits nonzero in `with 
subprocess.Popen(...):`

with subprocess.Popen('/bin/false'):
pass

I made the mistake of assuming this construct would raise an exception 
(CalledProcessError). It would be nice if there were a way to do that.

--
components: Library (Lib)
messages: 344880
nosy: nlevitt
priority: normal
severity: normal
status: open
title: suggesting option to raise exception if process exits nonzero in `with 
subprocess.Popen(...):`
type: behavior

___
Python tracker 
<https://bugs.python.org/issue37184>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2019-02-22 Thread noah


noah  added the comment:

I was able to recreate the 'bad' output on Linux using 'bad' input.

The issue is caused when you misspell WHERE, regex is looking for the exact 
word "WHERE", any lowercase (where), multicase (WHeRe), or misspelling (WERE) 
is going to cause it to return None because regex didn't find a matching 
substring.

I also on a whim tested out a bunch of encodings before realizing it didn't run 
on bytes objects anyways, so really the only way to get this output is to 
misspell the input. I think this problem should probably be closed as it's not 
a bug with the python core.

--
nosy: +ngwood111
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue34315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21314] Document '/' in signatures

2018-11-21 Thread Noah Haasis

Noah Haasis  added the comment:

I don‘t have the time right now. Feel free to work on it!

--

___
Python tracker 
<https://bugs.python.org/issue21314>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah


noah  added the comment:

Is this a feature request? Because it doesn't look like a bug to me. Where 
NoReturn is defined it says it's supposed to fail in static type checkers.

Anyway, I'm not entirely sure on the whole process of contributing but here 
goes:

The code ultimately fails at _type_check.
According to _type_check, "special forms like Union are not valid, while 
Union[int, str] is OK, etc."

NoReturn isn't subscriptable.

So basically the code is getting to this point and executing

_type_check(NoReturn, msg)

which fails on any special form.

If you try to force NoReturn to have additional parameters it will fail at 
__getitem__ because NoReturn is not subscriptable.

Any is also not subscriptable, but it's specifically handled in the 
_type_check() function ala:

if (isinstance(arg, _SpecialForm) and arg is not Any or ...

if you wanted to add NoReturn you could do something like

if (isinstance(arg, _SpecialForm) and arg not in [Any, NoReturn] or ...

Tested it and it works fine on 3.7 and 3.8 for me!

I've submitted a pull request with my proposed fix

--
nosy: +ngwood111 -levkivskyi, xtreak
versions: +Python 3.8

___
Python tracker 
<https://bugs.python.org/issue34921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah


Change by noah :


--
keywords: +patch
pull_requests: +9136
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue34921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21314] Document '/' in signatures

2018-09-10 Thread Noah Haasis


Noah Haasis  added the comment:

Can I work on this?

--
nosy: +noah.haasis

___
Python tracker 
<https://bugs.python.org/issue21314>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34545] error in the repl due to indentation

2018-08-29 Thread Noah Haasis


New submission from Noah Haasis :

Pressing the tab key in the python REPL in my command line (cmder on windows 10 
32bit) causes an exception:
>>> Readline internal error 
>>>   
Traceback (most recent call last):  
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\console\console.py",
 line 768, in hook_wrapper_23   
res = ensure_str(readline_hook(prompt)) 
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\rlmain.py",
 line 571, in readline   
self._readline_from_keyboard()  
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\rlmain.py",
 line 536, in _readline_from_keyboard
if self._readline_from_keyboard_poll(): 
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\rlmain.py",
 line 556, in _readline_from_keyboard_pol
result = self.mode.process_keyevent(event.keyinfo)  
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\modes\emacs.py",
 line 243, in process_keyevent  
r = self.process_keyevent_queue[-1](keyinfo)
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\modes\emacs.py",
 line 286, in _process_keyevent 
r = dispatch_func(keyinfo)  
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\modes\basemode.py",
 line 257, in complete   
completions = self._get_completions()   
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyreadline\modes\basemode.py",
 line 200, in _get_completions   
r = self.completer(ensure_unicode(text), i) 
  
  File 
"C:\Users\leinw\AppData\Local\Programs\Python\Python36-32\lib\rlcompleter.py", 
line 80, in complete
readline.redisplay()
  
AttributeError: module 'readline' has no attribute 'redisplay'  


This happens even if python expects indentation.

--
components: Windows
messages: 324366
nosy: noah.haasis, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: error in the repl due to indentation
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue34545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-21 Thread Noah Haasis


Noah Haasis  added the comment:

This are all the classes where the keywords are missing in the docs and their 
missing keywords:
TopLevel
['padx', 'pady']

Checkbutton
['compound', 'offrelief', 'overrelief', 'tristateimage', 'tristatevalue']

Entry
['disabledbackground', 'disabledforeground', 'readonlybackground']

Frame
['padx', 'pady']

Label
['compound']

Radiobutton
['compound', 'offrelief', 'overrelief', 'tristateimage', 'tristatevalue']

Text
['blockcursor', 'endline', 'inactiveselectbackground', 'insertunfocussed', 
'startline', 'tabstyle']

Spinbox
['validatecommand', 'values']

Menubutton
['activebackground', 'activeforeground', 'anchor', 'background', 'bitmap', 
'borderwidth', 'compound', 'cursor', 'direction', 'disabledforeground', 'font', 
'foreground', 'height', 'highlightbackground', 'highlightcolor', 
'highlightthickness', 'image', 'indicatoron', 'justify', 'menu', 'padx', 
'pady', 'relief', 'state', 'takefocus', 'text', 'textvariable', 'underline', 
'width', 'wraplength']

Message
['anchor', 'aspect', 'background', 'borderwidth', 'cursor', 'font', 
'foreground', 'highlightbackground', 'highlightcolor', 'highlightthickness', 
'justify', 'padx', 'pady', 'relief', 'takefocus', 'text', 'textvariable', 
'width']

The missing keywords appear in the OPTIONS list in the test but not in the 
docstring.

--

___
Python tracker 
<https://bugs.python.org/issue34154>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-21 Thread Noah Haasis


Change by Noah Haasis :


--
keywords: +patch
pull_requests: +7909
stage: needs patch -> patch review

___
Python tracker 
<https://bugs.python.org/issue34154>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-21 Thread Noah Haasis


Noah Haasis  added the comment:

This is a list of all valid keywordarguments of Listbox.__init__() listed in 
the test file: 
'activestyle', 'background', 'borderwidth', 'cursor',
'disabledforeground', 'exportselection',
'font', 'foreground', 'height',
'highlightbackground', 'highlightcolor', 'highlightthickness',
'listvariable', 'relief',
'selectbackground', 'selectborderwidth', 'selectforeground',
'selectmode', 'setgrid', 'state',
'takefocus', 'width', 'xscrollcommand', 'yscrollcommand'

The ones that are missing in the doc string:
'activestyle', 'disabledforeground', 
'listvariable','state'

--

___
Python tracker 
<https://bugs.python.org/issue34154>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-20 Thread Noah Haasis


Noah Haasis  added the comment:

I'd like to work on this, if it's ok for everybody.

--
nosy: +noah.haasis

___
Python tracker 
<https://bugs.python.org/issue34154>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33836] [Good first-time issue] Recommend keyword-only param for memoization in FAQ

2018-06-13 Thread Noah Haasis


Change by Noah Haasis :


--
keywords: +patch
pull_requests: +7300
stage: needs patch -> patch review

___
Python tracker 
<https://bugs.python.org/issue33836>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon

Noah Simon <noahs2...@gmail.com> added the comment:

Actually, you wouldn't even need to import asyncio.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33447>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon

New submission from Noah Simon <noahs2...@gmail.com>:

It would be very useful to add an asynchronous lambda syntax, as a shortcut for 
coroutines. I'm not experienced enough to write a PEP or edit the C source, but 
I have some ideas for syntax:

import asyncio
foo = async lambda a,b: 5 + await bar(b)

--
components: asyncio
messages: 316304
nosy: Noah Simon, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Asynchronous lambda syntax
type: enhancement
versions: Python 3.7

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33447>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: New PyPI launched, legacy PyPI shutting down April 30

2018-04-18 Thread Noah
Awesome

On Mon, Apr 16, 2018 at 8:21 PM, Laura Hampton <la...@laura-hampton.com>
wrote:

> New PyPI launched, legacy PyPI shutting down April 30[1]
>
> Starting today, the canonical Python Package Index is at https://pypi.org
> and uses the new Warehouse codebase.  We announced the https://pypi.org
> beta on March 26 and your feedback and test usage have helped us get it
> production-ready.
>
> Monday April 16 (2018-04-16): We launched the new PyPI, redirecting
> browser traffic and API calls (including "pip install") from
> pypi.python.org to the new site. The old codebase is still available at
> https://legacy.pypi.org for now.
>
> Monday April 30 (2018-04-30): We plan to shut down legacy PyPI
> https://legacy.pypi.org . The address pypi.python.org will continue to
> redirect to Warehouse.
>
> For more details, see our roadmap: https://wiki.python.org/psf/
> WarehouseRoadmap
>
> If your site/service links to or uses pypi.python.org, you should start
> using pypi.org instead: https://warehouse.readthedocs.
> io/api-reference/integration-guide/#migrating-to-the-new-pypi
>
> Thank you.
>
> [1] https://blog.python.org/2018/04/new-pypi-launched-legacy-
> pypi-shutting.html
>
>   Laura Hampton
>   laura at laura-hampton dot com
> --
> https://mail.python.org/mailman/listinfo/python-announce-list
>
> Support the Python Software Foundation:
> http://www.python.org/psf/donations/
>



-- 
*./noah*
-- 
https://mail.python.org/mailman/listinfo/python-list


install on host not connected to the internet and no local proxy

2017-11-02 Thread Noah

Hi,

I am trying to install a python package with about 80 dependencies on a 
server that is not connected to the internet and has no local proxy.  I 
can ssh to it via VPN.


I was able to find python bundle and download the tarballs for all the 
main python package and all the tarballs for the subsequent 
dependencies.They reside in the same directory on the isolated server.


Does anybody have some recommendations on how to install the main 
package and that process triggers the installation of all the 
dependencies from their corresponding tar.gz file?  I cant seem to 
figure out how to do that easily with pip.


Cheers

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


Re: Your feedback on our free Advanced Python tutorial

2017-07-20 Thread Noah
On 20 Jul 2017 3:03 p.m., "Aude Barral, CodinGame" <a...@codingame.com>
wrote:

Hi everyone,

I am co-founder of a startup called CodinGame.

A few days ago we've launched a project: Tech.io <https://tech.io/>. It's a
free knowledge-sharing platform that allows tech professionals to learn new
programming concepts through hands-on content crafted by volunteers in the
community.

Everything runs on our backend. Our system relies on Docker images so we
can play tutorials and demos of virtually any technology from the browser.

So why this project? Because as more and more resources over the Internet
now need to be paid for (Udacity, Udemy, etc), we want to foster free
online technology education thanks to peer learning. In a sense, we'd like
to become some kind of Wikipedia for tech.

One of the first tutorials our contributors published is about Advanced
Python Features (hope more will be published soon!): https://tech.io/play
grounds/500/advanced-python-features/advanced-python-features



Perfect and thanks for taking your time folks to put this together out
there for free.



I have 2 questions for you:

- Do you think this tutorial could be helpful to your Python user
community?


100% Yes


- Would you be willing to help us spread the word about Tech.io?



Yes yes yes...


Thanks a lot for checking,

Cheers!
Aude



Cheers,
Noah

-
Evolve or Extinct. Enable IPv6 now?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Changes by Noah Levitt <nlevi...@gmail.com>:


Added file: http://bugs.python.org/file46943/issue30593-test.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Noah Levitt added the comment:

And here's a fix.

Unfortunately I think the change could break people's scripts. If they have 
isolation_level set (not None) and use executescript(), they will have to issue 
an explicit call to connection.commit().

executescript() could do the commit itself explicitly after running the sql, I 
suppose. Then the behavior is much like the old behavior, but at least you get 
the performance boost of running inside a transaction. (Substantial if you pass 
10k insert statements to executescript(), or something like that.)

Or, we could not change the code, and instead change the documentation. The 
docs could suggest wrapping the sql script with "begin;" and "commit;".

--
keywords: +patch
Added file: http://bugs.python.org/file46942/issue30593-fix.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Noah Levitt added the comment:

Here's a test case

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-07 Thread Noah Levitt

New submission from Noah Levitt:

As far as I can tell, sqlite3 executescript() does not respect isolation_level. 
Is that true? If so, I think it's worth mentioning in the doc. Or maybe it 
should respect isolation_level, not sure there's any particular reason not to.

--
components: Library (Lib)
messages: 295376
nosy: Noah Levitt
priority: normal
severity: normal
status: open
title: sqlite3 executescript does not respect isolation_level?
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30593>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python and ssh for remote login

2016-10-06 Thread Noah
On 6 Oct 2016 04:56, "Michael Torrie" <torr...@gmail.com> wrote:
>
> On 10/05/2016 11:46 AM, Noah wrote:
> > Hello folk,
> >
> > I would like to use a python script to ssh into a server using a
username
> > and password and perhaps ass port.
> >
> > Any ideas on how to script that.
>
> If paramiko doesn't fit your needs, traditionally this sort of work was
> done with the pexpect module for drying a TTY. There is a submodule of
> pexpect called pxssh for automating things.
>

Hi Micheal

Thank youn for your suggestion. I played around with paramiko today and the
results are owesome.

> http://pexpect.readthedocs.io/en/stable/api/pxssh.html
>
> Note that pexpect uses your normal ssh binary.  Paramiko is a complete
> implementation of the ssh protocol in python.  Both modules are useful
> and fill certain needs.

So i  am going to also try pexpect and everything pexpect and i will let
you know.

Thank you so much

Noah
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: BeautifulSoup help !!

2016-10-06 Thread Noah
+1 at Steve

On 6 Oct 2016 19:17, "Steve D'Aprano"  wrote:

> On Fri, 7 Oct 2016 02:30 am, alister wrote:
>
> > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote:
> >
> >> So I've just started up with python and an assignment was given to me by
> >> a company as an recruitment task.
> >>
> > so by your own admission you have just started with python yet you
> > consider your self suitable for employment?
>
> What's your problem Alister? Do you think that junior devs aren't allowed
> to
> ask for help?
>
> Desolate.Soul.Me has either applied for a job, and their interview test
> is "do this task using Python", or he's been accepted in a new job, and the
> same applies.
>
> Whether it's a learning exercise, a test of skill + initiative, or actual
> work given to a junior developer, Desolate.Soul.Me is perfectly entitled
> to
> ask for help.
>
> This isn't some artificially constrained academic homework, with stupidly
> strict and hypocritical rules about so-called "plagiarism". This is the
> real world where you take all the help you can get and you shouldn't feel
> ashamed for asking for help. ESPECIALLY in the open source world, including
> Python, where one of the community values is to share expertise.
>
> My own employer has hired plenty of junior developers and given them
> relatively minor tasks to do as a learning exercise. We're not going to
> trust a junior developer with a critical piece of code, but we might say:
>
> "Scrape this website. Use Python. Here's the Python For Beginners
> book. Here's the Python documentation, and a few more forums where
> you can ask for help. If you get stuck, and aren't getting useful
> answers from the forums, you can ask Lisa. But not today, as she's
> busy doing a critical release and can't be disturbed."
>
>
> P.S. Desolate.Soul.Me, you might be taken a bit more seriously if you
> give a
> name, or at least a moniker or nick-name which is easier for others to
> refer to you by. It doesn't have to be your birthname, or legal name. What
> do your friends and workmates call you?
>
>
> I don't know Beautiful Soup, so I'm afraid I can't help.
>
>
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and ssh for remote login

2016-10-05 Thread Noah
On 5 Oct 2016 22:02, "Ethan Furman" <et...@stoneleaf.us> wrote:
>
> On 10/05/2016 10:46 AM, Noah wrote:
>
>> I would like to use a python script to ssh into a server using a username
>> and password [...]
>
>
> I've written a module called scription to help with scripts; it supports
giving passwords to programs like ssh.
>

Hi Ethan and for writting this script.

> Here's an example from one of my utility scripts:
>
> -- 8< ---
> #!/usr/local/bin/python
>
> from getpass import getpass
> from antipathy import Path
> from scription import Command, Execute, Main, OPTION, REQUIRED
>
> ...
>
> @Command(
> repo=('repository to pull [default: all]', OPTION),
> path=('base path to search', OPTION, 'p', Path),
> )
> def pull(repo, *path):
> '''
> retrieve remote change sets
> '''
> password = getpass('[mercurial] password: ')
> target = repo
> for repo in workhorse(*path):
> if target and repo.filename != target:
> continue
> history = Execute(('hg', 'pull'), cwd=repo, password=password,
pty=True)
>
> -- 8< 
>
> and in use:
>
> ==
>
> $ hgc --help
> Available commands/options in hgc
>incoming  displays changesets in remote repo not present locally
>list  displays all repos
>log-date  displays all log entries for matching date
>outgoing  displays changesets in remote repo not present locally
>parentdisplays parent of active branch
>pull  retrieve remote change sets
>push  send local changesets to remote repo
>statusdisplay status for each repo
>updateupdate active files to latest version
>
> $ hgc pull
> [mercurial] password:
>
> ...
> ===
>
> It's available via pip.  Feedback welcome.  :)
>

I will pip it too and try it out and give some feedback based on my use
case.

Thanks a lot.

> --
> ~Ethan~
> --

Noah
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and ssh for remote login

2016-10-05 Thread Noah
Hi Rob

Thank you for your email.

I am guessing that is some module. Ok i will pip it and see how it goes.

Noah

On 5 Oct 2016 21:32, "Rob Gaddi" <rgaddi@highlandtechnology.invalid> wrote:

> Noah wrote:
>
> > Hello folk,
> >
> > I would like to use a python script to ssh into a server using a username
> > and password and perhaps ass port.
> >
> > Any ideas on how to script that.
> >
> > Thanks
> >
> > Noah
>
> paramiko
>
> --
> Rob Gaddi, Highland Technology -- www.highlandtechnology.com
> Email address domain is currently out of order.  See above to fix.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Python and ssh for remote login

2016-10-05 Thread Noah
Hello folk,

I would like to use a python script to ssh into a server using a username
and password and perhaps ass port.

Any ideas on how to script that.

Thanks

Noah
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27471] sre_constants.error: bad escape \d

2016-07-08 Thread Noah Petherbridge

New submission from Noah Petherbridge:

I found a bug in Python 3.6.0a2 that wasn't present on previous versions of 
Python concerning the "\d" escape sequence as used in the following regular 
expression:

import re
s = "hello"
s = re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', s)

(The purpose of this regular expression was to translate the literal regexp 
string "(\d+?)" to be a non-capturing literal regexp string, to eventually be 
used as a re pattern).

When running this code in 3.6.0a2 I receive the following stack traces:

- - - - - - - - - -

Traceback (most recent call last):
  File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/sre_parse.py", line 
877, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\d'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 4, in 
s = re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', s)
  File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 181, in 
sub
return _compile(pattern, flags).sub(repl, string, count)
  File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 324, in 
_subx
template = _compile_repl(template, pattern)
  File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 311, in 
_compile_repl
p = sre_parse.parse_template(repl, pattern)
  File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/sre_parse.py", line 
880, in parse_template
raise s.error('bad escape %s' % this, len(this))
sre_constants.error: bad escape \d at position 3

- - - - - - - - - -

However, the script runs without crashing on Python 3.5.1 and 2.7.11

% python --version
Python 3.6.0a2

--
components: Regular Expressions
messages: 270010
nosy: Noah Petherbridge, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: sre_constants.error: bad escape \d
type: crash
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27471>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python-list Digest, Vol 152, Issue 43

2016-05-28 Thread Noah Fleiszig
Thank you and ok

-- 
Sent from Gmail Mobile
-- 
https://mail.python.org/mailman/listinfo/python-list


[no subject]

2016-05-27 Thread Noah Fleiszig
Thank you

-- 
Sent from Gmail Mobile
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python-list Digest, Vol 152, Issue 40

2016-05-26 Thread Noah Fleiszig
thank you

On Thu, May 26, 2016 at 2:00 AM,  wrote:

> Send Python-list mailing list submissions to
> python-list@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
> python-list-requ...@python.org
>
> You can reach the person managing the list at
> python-list-ow...@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
> Today's Topics:
>
>1. html & python connection problem with hyperlinks
>   (litssa2...@gmail.com)
>2. Re: Exended ASCII and code pages [was Re: for / while else
>   doesn't make sense] (Chris Angelico)
>3. Re: for / while else doesn't make sense (Marko Rauhamaa)
>4. Re: Spurious issue in CPython 2.7.5 (thomas povtal.org)
>5. Re: Spurious issue in CPython 2.7.5 (Tim Golden)
>6. Re: for / while else doesn't make sense (Christopher Reimer)
>7. Re: Spurious issue in CPython 2.7.5 (thomas povtal.org)
>8. ValueError: I/O operation on closed file (San)
>9. Re: ValueError: I/O operation on closed file (Joel Goldstick)
>   10. Find the max number of elements in lists as value in a
>   dictionary (Daiyue Weng)
>   11. Re: ValueError: I/O operation on closed file (alister)
>   12. IndexError for using pandas dataframe values (Daiyue Weng)
>   13. Re: Find the max number of elements in lists as value in a
>   dictionary (Jussi Piitulainen)
>   14. Re: Find the max number of elements in lists as value in a
>   dictionary (Jon Ribbens)
>   15. Re: html & python connection problem with hyperlinks
>   (justin walters)
>
>
> -- Forwarded message --
> From: litssa2...@gmail.com
> To: python-list@python.org
> Cc:
> Date: Wed, 25 May 2016 03:24:30 -0700 (PDT)
> Subject: html & python connection problem with hyperlinks
> Why not created the field title, that located on the template
> BusinessList.html as a link to go to Business_Detail.html..? please check
>
> Code:
>
> models. py:
>
> from django.db import models
>
>
> REGIONS = (
> ('ΘΕΣ', 'ΘΕΣΣΑΛΟΝΙΚΗ'),
> ('ΣΕΡ', 'ΣΕΡΡΕΣ'),
> ( 'ΑΘΗ', 'ΑΘΗΝΑ'),
>
>
>
> TYPEOFBUSINESS = (
> ('ΕΣΤ', 'ΕΣΤΙΑΤΟΡΙΑ'),
> ('ΦΑΡ', 'ΦΑΡΜΑΚΕΙΑ'),
> ('ΒΙΒ', 'ΒΙΒΛΙΟΠΩΛΕΙΑ'),
> ( 'ΚΟΜ', 'ΚΟΜΜΩΤΗΡΙΑ'),
> ('ΣΙΝ', 'ΣΙΝΕΜΑ')
>
> )
>
> class Business(models.Model):
> created_Date = models.DateTimeField(auto_now_add=True)
> owner = models.ForeignKey('auth.User', related_name='snippets', null=True)
> title = models.CharField(max_length=100, blank=True, default='')
> Type_of_Business = models.CharField(max_length=3, choices=TYPEOFBUSINESS)
> region = models.CharField(max_length=3, choices=REGIONS)
> address = models.CharField(max_length=100, blank=True, default='')
> phone = models.CharField(max_length=15, blank=True, default='')
> image = models.ImageField(null=True)
>
>
> def __str__(self):
> return str(self.title)
>
> views.py
>
> from django.contrib.auth.models import User
> from django.http import HttpResponse
> from django.shortcuts import render, get_object_or_404
> from rest_framework import filters
> from rest_framework import generics
> from rest_framework import permissions
> from snippets.permissions import IsOwnerOrReadOnly
> from snippets.serializers import SnippetSerializer
> from snippets.serializers import UserSerializer
> from .models import Business
>
>
>
> class UserList(generics.ListAPIView):
> queryset = User.objects.all()
> serializer_class = UserSerializer
>
>
> class UserDetail(generics.RetrieveAPIView):
> queryset = User.objects.all()
> serializer_class = UserSerializer
>
> class BusinessList(generics.ListCreateAPIView):
>
> permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
> queryset = Business.objects.all()
> serializer_class = SnippetSerializer
> filter_backends = (filters.DjangoFilterBackend,filters.SearchFilter,
> filters.OrderingFilter,)
> filter_fields = ('Type_of_Business', 'region')
> search_fields = ('Type_of_Business', 'region')
> ordering_fields = ('Type_of_Business','title', 'region')
>
>
> def BusinessList(request):
> business = Business.objects.all();
> return render(request, 'snippets/BusinessList.html' {'business':business})
>
> def perform_create(self, serializer):
> serializer.save(owner=self.request.user)
>
>
>
> class Business_Detail(generics.RetrieveUpdateDestroyAPIView):
> permission_classes = (permissions.IsAuthenticatedOrReadOnly,
> IsOwnerOrReadOnly,)
> queryset = Business.objects.all()
> serializer_class = SnippetSerializer
>
>
> def Business_Detail(request, pk):
> business = get_object_or_404(Business, pk=pk)
> return render(request, 'snippets/Business_Detail.html', {'business':
> business})
>
> serializers.py
>
> from rest_framework import serializers
> from snippets.models import Business
> from django.contrib.auth.models import User
>
>
> class 

multiprocessing not quite working

2016-05-24 Thread Noah


Hi,

I am using this example: 
http://spartanideas.msu.edu/2014/06/20/an-introduction-to-parallel-programming-using-pythons-multiprocessing-module/


I am sending and receiving communication from the worker processes.

Two issues. the join is only getting to the process and waiting.
When I comment out the .join() process the output.get() appends the 
previous process and therefore the returned output keeps getting longer 
and longer after each process returns its output.


hostnames is an array of hostnames.

here is my code from main():

# Define an output queue
output = mp.Queue()

# Setup a list of processes that we want to run
processes = [mp.Process(target=worker, args=(hostnames[x], output)) 
for x in range(len(hostnames))]


# Run processes
for p in processes:
print "start: {}".format(p)
p.start()

time.sleep(6)
print "processes: {}".format(processes)

# Exit the completed processes
'''for p in processes:
print "join: {}".format(p)
p.join()'''

print "got here"
# Get process results from the output queue
# results = [output.get() for p in processes]

io = StringIO()
count = 0
for p in processes:
found_output = output.get()
print "returned {}".format(p)
io.write (found_output)
zipArchive.writestr(hostnames[count] + "." + 
content['sitename'] + '.config.txt', io.getvalue())

count = count + 1
io.close()


def worker(hostname, output):
.
.
.
output.put(template_output)


Cheers

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


finding the diff

2015-09-10 Thread Noah

Hi there,

I am researching a nice slick way to provide the difference between 
generated python multi-line configuration output and specific 
configuration lines gathered from an output file.  I could put things in 
a list?   I could put both forms output into IOString() and run a diff 
command to it?


What are some options that work well?

Cheers,

Noah
--
https://mail.python.org/mailman/listinfo/python-list


Re: [pydotorg-www] www.python.org - Backend is unhealthy

2015-05-08 Thread Noah Kantrowitz

On May 8, 2015, at 10:28 AM, Chris Angelico ros...@gmail.com wrote:

 On Fri, May 8, 2015 at 6:17 PM,  jarau...@skynet.be wrote:
 I cannot access www.python.org.
 I always get
 
 Error 503 Backend is unhealthy
 
 Backend is unhealthy
 
 Guru Mediation:
 
 Details: cache-ams4149-AMS 1431072956 2041303800
 
 Varnish cache server
 
 
 Is it only me?
 
 
 No, it's not only you. I get the same but with different details:
 
 Details: cache-syd1627-SYD 1431073575 864283876
 
 It looks to me as if my result is coming from a cache node in Sydney;
 yours is coming from some other cache node, so it's not just one node
 that's down.
 
 Cc'ing in the www list in case someone there knows, and I'll create a
 github issue to ping the people there.

Should be recovering now.

--Noah



signature.asc
Description: Message signed with OpenPGP using GPGMail
-- 
https://mail.python.org/mailman/listinfo/python-list


netaddr value back to IP

2014-11-13 Thread Noah

Hi there List,

I am trying to get a value back to IP using the netaddr python module.
How do I get the value 'ip' back to IP format?  how is it done?

 snip 

print IPNetwork(v4_peer_ip).value
ip = IPNetwork(v4_peer_ip).value + 1
print ip

--- snip ---

Cheers,
Noah
--
https://mail.python.org/mailman/listinfo/python-list


xml issue with Type 'bool' cannot be serialized

2014-08-28 Thread Noah

Hi list,

I am not clear how to fix this issue.

Traceback (most recent call last):
  File ./command.py, line 81, in module
connect(host, USER, PASSWORD)
  File ./command.py, line 63, in connect
dump = etree.tostring(xml_cmd)
  File lxml.etree.pyx, line 3165, in lxml.etree.tostring 
(src/lxml/lxml.etree.c:69414)

TypeError: Type 'bool' cannot be serialized.


here is snippets from the code



--- code ---

from jnpr.junos import Device
from jnpr.junos.utils.config import Config
from lxml import etree
import jnpr.junos.exception
import sys, os, time, re, getopt

def connect(host, user, password):
conn = Device(host=host, user=user, password=password).open()

xml_cmd = ''
xml_cmd = conn.rpc.get_configuration()
dump = etree.tostring(xml_cmd)
print dump

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


reading text files with indentation

2014-07-28 Thread Noah

Hi there,

The following code I am using to read in lines from a text file.  The 
indentation of the text is getting lost.  How can I correct that?



for file in files:
with open (file, r) as file:
lines = file.readlines()

for line in lines:
line = re.sub(#.*, , line)
line = line.strip()
policy_lines.append(line)
print line

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


python template lint

2014-07-26 Thread Noah

Hi there List,

I am looking for a little guidance here.  I am taking a series of 
template files for building configuration.  I want to design some simple 
lint rules to check for some of the syntax of the template files I 
created.  For instance if an open brace is seen indent 4 spaces each 
time.  unindent when a close brace is seen.  remove blank lines. Remove 
comments after '#' and so on.  I could write this with search adn 
replace rules but I might want a module that allows for some complexity 
down the road.


Any cool python module recommendations out there that does this well?

Cheers,

Noah
--
https://mail.python.org/mailman/listinfo/python-list


beginners python mail list

2014-06-21 Thread Noah

HI there,

I have some amateur python questions.  Is there a beginners python mail 
list?


Cheers,

Noah
--
https://mail.python.org/mailman/listinfo/python-list


[issue17127] multiprocessing.dummy.Pool does not accept maxtasksperchild argument

2013-02-04 Thread Noah Yetter

New submission from Noah Yetter:

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on 
win32

Type help, copyright, credits or license for more information.

The docs claim that multiprocessing.dummy replicates the API of 
multiprocessing but is no more than a wrapper around the threading module. 
however dummy's Pool method does not replicate the API of multiprocessing's 
Pool method:

 import inspect
 import multiprocessing
 inspect.getargspec(multiprocessing.Pool)
ArgSpec(args=['processes', 'initializer', 'initargs', 'maxtasksperchild'], 
varargs=None, keywords=None, defaults=(None, None, (), None))
 import multiprocessing.dummy
 inspect.getargspec(multiprocessing.dummy.Pool)
ArgSpec(args=['processes', 'initializer', 'initargs'], varargs=None, 
keywords=None, defaults=(None, None, ()))

Thus when attempting to downshift from multiprocessing to threading like so...

import multiprocessing.dummy as multiprocessing

...code that supplies the maxtasksperchild argument to Pool() will not run.

--
components: Library (Lib)
messages: 181365
nosy: Noah.Yetter
priority: normal
severity: normal
status: open
title: multiprocessing.dummy.Pool does not accept maxtasksperchild argument
type: behavior
versions: Python 2.7, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17127
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



easy_install says not a recognized archive type Windows Py3

2012-10-15 Thread Noah Coad
Hello, I'm new to Python, have v3.0 32bit installed on Windows 7, installed 
distribute, now trying to install pymysql and am getting the below error.  Any 
pointers on how to fix?  thanks!!  -Noah

[C:\Python32]pip install --upgrade distribute
Real name of requirement distribute is distribute
Requirement already up-to-date: distribute in c:\python32\lib\site-packages\dist
ribute-0.6.28-py3.2.egg
Cleaning up...

[C:\Python32]easy_install pymysql
Searching for pymysql
Reading http://pypi.python.org/simple/pymysql/
Couldn't find index page for 'pymysql' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Reading http://pypi.python.org/simple/PyMySQL/
Reading http://code.google.com/p/pymysql
Best match: PyMySQL 0.5
Downloading http://pypi.python.org/packages/source/P/PyMySQL/PyMySQL-0.5.tar.gz#
md5=125e8a3449e05afcb04874a19673426b
Processing PyMySQL-0.5.tar.gz
error: Not a recognized archive type: c:\users\noahco~1\appdata\local\temp\easy_
install-gpekqc\PyMySQL-0.5.tar.gz
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How can I verify if the content of a variable is a list or a string?

2012-01-31 Thread Noah Hall
On Wed, Feb 1, 2012 at 12:44 AM, Andres Soto soto_and...@yahoo.com wrote:
 Hi,
 I'm writing a function which receive a list which elements are strings or
 new lists (sublists) containing strings.
 How can I verify if sone element of the list (which is contained in a
 variable) is a list or a string?
 I found the method isinstance(object,class) but I don't know which class
 should I use for.
 Thank you, regards

 Prof. Dr. Andrés Soto
 DES DACI
 UNACAR

list and str

 my_list = [1, 2, 3]
 isinstance(my_list, list)
True
 my_string = foobar
 isinstance(my_string, str)
True
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Noah Hall
On Thu, Jan 19, 2012 at 10:47 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 On Thu, 19 Jan 2012 20:43:23 +1100, Chris Angelico wrote:

 On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano
 steve+comp.lang.pyt...@pearwood.info wrote:
 With all the tools installed, it's a matter of a few minutes effort to
 build from scratch:

 [...]
 Now, granted, this was Debian and I can't speak for Centos. But it would
 surprise me greatly if your package manager can't provide build
 essentials.

 I daresay any decent package manager would be able to provide the
 complete tool chain for building Python from source. But I have no idea
 what tools are needed -- gcc and make, obviously, but what else? Maybe it
 really is as simple as yum install gcc make, but I suspect that it
 won't be. yum install gcc make yacc bison elephant weasel fox cow spam
 ham cheese chalk aardvark perhaps. (I may have made one or two of those
 up.)

I am fairly certain nobody would be silly enough to make a package
called gcc. make, maybe, but not gcc. I mean, that's not even a
real word!

yum groupinstall Development  Tools will probably do what the OP
needs unless 6 no longer has it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-14 Thread Noah Hall
On Sat, Jan 14, 2012 at 2:39 AM, Terry Reedy tjre...@udel.edu wrote:
 On 1/13/2012 3:42 PM, Noah Hall wrote:

 On Fri, Jan 13, 2012 at 8:07 PM, Tamer Higazith9...@googlemail.com
  wrote:

 dear people!
 I have just opened my MTU client, and figured out that through my
 comment, i caused a complete NONSENSE discussion at all.


 1. I am not a zealot or whatever. I code on Linux and port it on MAC and
 WINDOWS. I do write solutions for customers across the whole 3 platform,
 and mostly I succeed because I have to figure out in advance which
 software (packages) are being supported and how far.


 Use Linux!
 Specially Gentoo Linux!


 Screams zealot to me. If not, certainly not a very useful reply.


 Noah, those last two lines you quoted are NOT in the post you are quoting.
 Perhaps Tamer said them previously. If so, you should say so: In a previous
 post, you said Otherwise, it looks like you made those up and put words
 in his pen.

Good point. In a previous post, that started all this, he said

 Use Linux!
 Specially Gentoo Linux!

when replying to someone who asked

 how can i install the lxml  in my xp??
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can someone explain 2to3?

2012-01-14 Thread Noah Hall
On Sat, Jan 14, 2012 at 5:06 PM, Joshua Miller millej...@gmail.com wrote:
 Ok i'm trying to convert https://github.com/rdeaton/spyral to python3
 but i'm at a loss on how to actually use 2to3. Can someone explain
 it's proper use to me so i can do the conversion? prefereably where i
 can take C:\Python32\Lib\site-packages\spyral\ and put it in a new
 directory that i will name C:\Python32\Lib\site-packages\spyralpy3\?
 Thanks in advance for the help

Have a read of the docs[0]. 2to3 will convert it to 3, but it may need
more fixes to run as well.

[0] - http://docs.python.org/library/2to3.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can someone explain 2to3?

2012-01-14 Thread Noah Hall
On Sat, Jan 14, 2012 at 7:08 PM, Joshua Miller millej...@gmail.com wrote:
 I've looked there and it didn't worki may've made all the nesscary
 changes manually anyways though i'm not sure...

What about it didn't work?
Have a read of this too -
http://wiki.python.org/moin/PortingPythonToPy3k and if you're still
stuck, contact the developer of the program in question.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zealotry [was Re: how to install lxml in window xp?] (OT)

2012-01-13 Thread Noah Hall
On Fri, Jan 13, 2012 at 7:54 AM, Stefan Behnel stefan...@behnel.de wrote:
 Noah Hall, 13.01.2012 08:29:
 I'M SO COOL
 USE MY HARDCORE GENTOO INSTALL THAT TOOK 36 HOURS AND SHAVED 2 SECONDS
 OFF MY BOOTUP TIME

 Just an off-topic thing that your comment above reminded me of: has anyone
 ever noticed that there are even quick install guides for Gentoo Linux?

Gentoo Linux - for when life's just too simple.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-13 Thread Noah Hall
On Fri, Jan 13, 2012 at 8:07 PM, Tamer Higazi th9...@googlemail.com wrote:
 dear people!
 I have just opened my MTU client, and figured out that through my
 comment, i caused a complete NONSENSE discussion at all.


 1. I am not a zealot or whatever. I code on Linux and port it on MAC and
 WINDOWS. I do write solutions for customers across the whole 3 platform,
 and mostly I succeed because I have to figure out in advance which
 software (packages) are being supported and how far.

 Use Linux!
 Specially Gentoo Linux!

Screams zealot to me. If not, certainly not a very useful reply.

Hey guys, I want to cut the bread, can someone tell me how to use the knife?

Use a futuristic laser! Build it yourself for the uber 1337 status!

 2. There are many open source projects out (don't ask where, look for
 yourself, you are old enough!) as well commercial software vendors who
 don't offer their products, or give support for Windows XP.

More fool them; XP is still (unfortunately) heavily used in workplaces
and in Universities. Luckily, Windows, unlike Linux, is largely
backwards compatible - it's rare to find a program which won't run on
XP if it can run on Vista+, unless it's a game that relies on DX11 or
something.

 3. All of you know, that windows xp is by Microsoft not anymore
 supported. Neither with Security Updated, Enhancements with Software,
 SDK or whatever. and not only XP, also Win95,98,ME, and 2000
 Professional (not the server editions).

Mainstream support ended, yes, but extended support lasts until 2014.
Extended support is security updates and the like.
http://support.microsoft.com/lifecycle/?C2=1173

 4. Of course any OS has it's advantages and disadvantages. Gentoo is a
 rolling distribution, when it's set up it works nicely. Of course, you
 have to invest a lot of effort to get in what doesn't mean that Debian
 and Ubuntu, and the others are worse.

Yeah, no. I prefer an operating system that's stable and secure for my
servers and for my development. Call me crazy, but I like to get work
done.

 From my personal point of view, I will never set up a gentoo machine as
 a server in a datacenter, I would rather use BSD Unix. But this is
 something that personally everybody has to decide for him/herself.

Good boy you! I'm glad you've got some sense, there.

 Now, I hope that I put a line under this discussions and beg the kids
 between the age of 18 - 24 who are really impulsive to fire around with
 the guns on others to stop this nonsense thread.

 That doesn't leave a nice picture in the community.

Hate to break it to you, but you started it with

 Use Linux!
 Specially Gentoo Linux!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread Noah Hall
On Fri, Jan 13, 2012 at 5:47 AM, alex23 wuwe...@gmail.com wrote:
 On Jan 13, 3:02 pm, Steven D'Aprano steve
 +comp.lang.pyt...@pearwood.info wrote:
 Why is it that only Linux and Mac users are accused of being zealots?

 Incidentally, in the post I replied to, Tamer was talking about
 Windows 7, so there's that too.

I agree with what you posted.

If there was a single bad thing I would point out to anyone about the
Python community, it would be that there are a huge amount of
freetards - people who believe that Linux is the only way, or that
Linux is the best way. Protip: It's not the only way, and it's not
always the best way.

Use what works for you. If Windows works for you, great. Same applies
to every OS. It's not then unreasonable to ask others for support for
that OS - they may not have the ability to provide support, but it's
always good to ask. If you have no choice in the matter, sucks to be
you, but live with it. Worse things have happened than having to use
Windows XP, as much as I *personally* dislike XP.

Claiming that x OS is best, and that every other OS is rubbish is
insane. Different operating systems do things differently, and are
therefore suited for different tasks and for different people.

Suggesting to someone that doing a task is easier on a different OS -
Yeah, I can't help you but I might I suggest you do Python
development on Linux - these sort of problems are much easier to
handle when you have a package manager system and Linux distros have
awesome Python support  is fine and perfectly sensible - USE LINUX
OMFG!111!! YOU'RE SO LAME, WINDOZE SUCKS OMFG YOU N00B! I'M SO COOL
USE MY HARDCORE GENTOO INSTALL THAT TOOK 36 HOURS AND SHAVED 2 SECONDS
OFF MY BOOTUP TIME! LOOK AT THE SPINY COMPIZ CUBE! I DON'T KNOW WHAT I
DID BEFORE I COULD MAKE MY DESKTOP CUBE-Y!, as in the post you
referred to, is not.

I see this kind of nonsense everywhere, but it tends to be in the
Linux and Apple community more - I've no idea why, probably has
something to do with being a minority.

For reference, I am a Linux developer who uses Windows, Linux, *BSD
and OS X, each in a place where it's suitable.

tl;dr - Use what works for you. Suggest, don't preach.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Please explain this for me

2011-12-20 Thread Noah Hall
On Wed, Dec 21, 2011 at 4:39 AM, Emeka emekami...@gmail.com wrote:

 Hello All,

 v = []

 def add_to_list(plist):
     u = plist.append(90)
     return u

 add_to_list(v)  # This function call returns nothing
 Could someone explain why this function call will return nothing?

It's because add_to_list returns the value returned from plist.append
stored in u.
append changes a list in place and returns nothing. Functions that
return nothing return None. This is why it'll be None - u is None
because append returns None.


 add_to_list([])
 This one returns nothing, why?

It's because the object [] here has no name, so that you have no way
to refer to it after the function changes it, since it changes it in
place. It gets eaten by Python, never to be seen again.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Return of an old friend

2011-11-25 Thread Noah Hall
On Fri, Nov 25, 2011 at 5:08 AM, Matt Joiner anacro...@gmail.com wrote:
 I haven't heard of you before, but feel like I've missed out on something.

 Do you (or someone else) care to link to some of your more contentious work?

Ignore him, he's a troll with an unjustly inflated ego.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to test if object is an integer?

2011-10-17 Thread Noah Hall
On Sat, Oct 15, 2011 at 12:44 AM, MrPink tdsimp...@gmail.com wrote:

 Is there a function in Python that can be used to test if the value in
 a string is an integer?  I had to make one up for myself and it looks
 like this:

 def isInt(s):
    try:
        i = int(s)
        return True
    except ValueError:
        return False


There's the isdigit method, for example -

 str = 1324325
 str.isdigit()
True
 str = 1232.34
 str.isdigit()
False
 str = I am a string, not an int!
 str.isdigit()
False
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 1/2 evaluates to 0

2011-10-12 Thread Noah Hall
On Wed, Oct 12, 2011 at 11:14 AM, Laurent Claessens moky.m...@gmail.com wrote:
 This is well known :

 1/2
 0

 This is because the division is an integer division.

 My question is : how can I evaluate 1/2 to 0.5 ? Is there some non integer

Include from __future__ import division on the top of your file

 from __future__ import division
 1/2
0.5
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 1/2 evaluates to 0

2011-10-12 Thread Noah Hall
On Wed, Oct 12, 2011 at 12:28 PM, Laurent moky.m...@gmail.com wrote:

 Include from __future__ import division on the top of your file

  from __future__ import division
  1/2

 0.5


 Wohaw. This means that this behavior is going to be default in a foreseeable
 future ?

Never in Python 2.x, but it already is in Python 3.x [1]

[1] - http://www.python.org/dev/peps/pep-0238/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is the Usenet to mailing list gateway borked?

2011-06-29 Thread Noah Hall
On Wed, Jun 29, 2011 at 9:34 PM, Andrew Berg bahamutzero8...@gmail.com wrote:
 I didn't get at least two messages from the call a function every 10
 seconds thread, and possibly some other messages, and I access the
 group via the mailing list. I use the latest stable Thunderbird, if that
 matters. I've only noticed this recently, and I'm still getting other
 messages. In fact, I only noticed this because I got a message that
 referenced messages I didn't get.

I think the more likely answer is that it was sent without being also
sent to python-list.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Suppressing newline writing to file after variable

2011-06-28 Thread Noah Hall
On Tue, Jun 28, 2011 at 5:05 PM, Ellerbee, Edward eeller...@bbandt.com wrote:
 Hi all, newbie question here. I'm using python 2.7. I've built my first
 program to pull some info off the web, process it, and build dialpeers for a
 cisco router. I have 2 problems - the first is the formatting of printing
 the gathered information to a file. It seems to be inserting a new line
 after the variable is written. I've searched the web, but unsure of which
 method could fix this issue.

 Here is my code snippet:

 count=0
 o = open('dialpeers.txt', 'w')
 for line in open('final.txt', 'r'):
     figureDpn = count + 1000

     dpn = str(figureDpn)
     label = dial-peer voice  + dpn
     o.write(label)
     o.write('\n')
     destpatt = destination-pattern  + line + 

Try line.rstrip() instead. It'll remove all newlines. Also, I suggest
you use string formatting, for example,
destpatt = destination-pattern %s % line.rstrip()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Suppressing newline writing to file after variable

2011-06-28 Thread Noah Hall
On Tue, Jun 28, 2011 at 6:32 PM, Ellerbee, Edward eeller...@bbandt.com wrote:
 Thank you!

 That works perfect, I'll have to look into string formatting more.

 My next issue to solve I've been researching is:

 How to condense a group of numbers to a wildcard list. For example:

 252205
 252206
 252208
 252220
 252221
 25
 252223
 919745
 919725
 919785
 704770 thru 704799 (all numbers listed individually in a file)

 Condense to:
 25220[568]
 25222[0-3] (or 25222[0123] is fine too)
 9197[248]5
 7047[0-9][0-9]

 Any recommendations on where to start, a method or function to research?

Hm, perhaps re (http://docs.python.org/library/re.html). It depends on
whether it's a standard static set of values you need to compare
against, or a undefined dynamic set.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python basic program problem

2011-06-27 Thread Noah Hall
On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh asingh0...@gmail.com wrote:
 Hi,
 I am fairly new to python, I am trying to write simple code and It is
 giving me syntax error. I am reading a book and following the
 directions as it says in the book but I am not sure why it is not
 working. Please guide me through. Any help appreciated.
 x = 2
 if x == 2:
   print This is a test

 SyntaxError: invalid syntax
 if x == 2:
           print This is a test

 SyntaxError: invalid syntax
 x = 2
 if x = 2:

 SyntaxError: invalid syntax
 if x == 2:
        print This is test

 SyntaxError: invalid syntax
 Type copyright, credits or license() for more information.
 SyntaxError: invalid syntax


 print this is a test
 SyntaxError: invalid syntax
 import keyword
 print keyword.kwlist
 SyntaxError: invalid syntax
 print hellow world
 SyntaxError: invalid syntax
 print 'hellow world'
 SyntaxError: invalid syntax

Looks like you're using the 3.x version, while your guide is 2.x. I
suggest you download the 2.x version, or find a new tutorial.

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


Re: Python basic program problem

2011-06-27 Thread Noah Hall
On Mon, Jun 27, 2011 at 11:18 PM, Amaninder Singh asingh0...@gmail.com wrote:
 Yes, I think I am using 3.0 version. So how much difference is in between 
 these two?
 On Jun 26, 2011, at 11:18 PM, Noah Hall wrote:
 On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh asingh0...@gmail.com 
 wrote:
 Hi,
 I am fairly new to python, I am trying to write simple code and It is
 giving me syntax error. I am reading a book and following the
 directions as it says in the book but I am not sure why it is not
 working. Please guide me through. Any help appreciated.
 Looks like you're using the 3.x version, while your guide is 2.x. I
 suggest you download the 2.x version, or find a new tutorial.


Well, quite a lot. Read this -
http://wiki.python.org/moin/Python2orPython3 to get a better picture.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 syntax error question

2011-06-26 Thread Noah Hall
On Sun, Jun 26, 2011 at 2:04 PM, rzed rzan...@gmail.com wrote:
 I've tried to install PySVG in a Python 3 setting, and I get a few
 errors on the build. Most are easy to fix, but this one I can't
 explain or fix:

 error
 Traceback (most recent call last):
  File stdin, line 1, in module
  File builders.py, line 12, in module
    from pysvg.shape import *
  File C:\Python32\lib\site-packages\pysvg\shape.py, line 91
    def moveToPoint(self,(x,y)):
                         ^
 SyntaxError: invalid syntax
 /error

 The moveToPoint method occurs three times in the file, with identical
 signatures. The other two are not showing up as errors, though since
 they occur later in the file, that may not be indicative.

 I don't see anything erroneous in this line. The syntax error often
 comes from the previous line, but I've moved this method around and
 it has always failed on this line and no other, regardless of what
 went before.

 I'm new to Py3, so maybe there's some obvious thing I'm not seeing
 here. Does anyone have any suggestions?

Did you run it through 2to3? When I run
def a(b, (c,d)):
pass
through 2to3, it tells me what I need to change.

-def a(b, (c,d)):
+def a(b, xxx_todo_changeme):
+(c,d) = xxx_todo_changeme

(which is what Steven said)

If you haven't used 2to3, I suggest you use it.

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


Re: Python 3 syntax error question

2011-06-26 Thread Noah Hall
On Sun, Jun 26, 2011 at 4:28 PM, rzed rzan...@gmail.com wrote:
 steve+comp.lang.pyt...@pearwood.info wrote in
 news:4e074768$0$29982$c3e8da3$54964...@news.astraweb.com:

 rzed wrote:

 I've tried to install PySVG in a Python 3 setting, and I get a
 few errors on the build. Most are easy to fix, but this one I
 can't explain or fix:

 error
 Traceback (most recent call last):
   File stdin, line 1, in module
   File builders.py, line 12, in module
     from pysvg.shape import *
   File C:\Python32\lib\site-packages\pysvg\shape.py, line 91
     def moveToPoint(self,(x,y)):
                          ^
 SyntaxError: invalid syntax
 /error

 Function signatures with automatic tuple-unpacking are no longer
 allowed in Python3. So functions or methods like this:

 def moveToPoint(self,(x,y)):

 have to be re-written with the tuple unpacking moved into the
 body of the function, e.g. something like this:

 def moveToPoint(self, x_y):
     x, y = x_y


 Are you aware that you're trying to install a Python2 library
 under Python3?



 Thank you all for your responses. Yes, I am aware of the version
 difference, but not of all the implications of that. I will run this
 through 2to3, but even without doing that, there are only about four
 syntax errors, and the others were obvious and easily corrected.

 There does not seem to be a Py3 version of this package. I was hoping
 to try it to see what broke. Well, I found out at least part of that,
 didn't I?

 I was not aware of the removal of tuple-unpacking. I expect there was
 some extensive conversation about that.

 As to 2to3, I have to say that:

 -def a(b, (c,d)):
 +def a(b, xxx_todo_changeme):
 +    (c,d) = xxx_todo_changeme

 ... is not terribly revealing if one is unaware of what about it
 needs changing. I know, I know: RTFM

It means delete every line with a '-' and replace them with those next
to the '+'
Of course, if you read the doc, it'll give you lots of different
options, including writing to the file, so all you need to do is
change the variable names.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Default value for optional parameters unexpected behaviour?

2011-06-26 Thread Noah Hall
On Sun, Jun 26, 2011 at 7:28 PM, Marc Aymerich glicer...@gmail.com wrote:
 Hi,
 I'm trying to define a function that has an optional parameter which
 should be an empty list whenever it isn't given. However, it takes as
 value the same value as the last time the function was executed. What
 is the reason of this behaviour? How does python deal with default
 values (i.e. when are they assigned/created)?

 Thanks :)

 def a(foo=[]):
 ...  foo.append(1)
 ...  print foo
 ...
 a()
 [1]
 a()
 [1, 1]
 a()
 [1, 1, 1]
 a()
 [1, 1, 1, 1]
 a()
 [1, 1, 1, 1, 1]
 a()
 [1, 1, 1, 1, 1, 1]

Your problem arises because lists are mutable. Because foo (by
default, initially) points to a given list, every time the function is
called, it uses the same list that foo was first pointed to, if the
default argument value is taken.
The way to fix this is to instead do -

def a(foo=None):
if foo is None:
foo = []
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: reg: playing with the list

2011-06-24 Thread Noah Hall
On Fri, Jun 24, 2011 at 8:01 AM, kaustubh joshi kandrjo...@gmail.com wrote:
 Hey all,
 I am new here and new to python too. In general new to programming .
 I was working on aproblem.
 and need some help.
 I have a list of numbers say [2,3,5,6,10,15]
 which all divide number 30.
 Now i have to reduce this list to the numbers which are prime in number.
 i.e.
 [2,3,5]
 can somebody suggest?

Well, you can use a built-in function called filter to create a list
containing only values that meet a certain need, for example, this
will filter out everything that is even and put it into a new list -
 numbers = [1,2,3,4]
 def is_even(n):
return n%2==0 # returns true if even, false if not.

 filter(is_even,numbers)
[2, 4]


All you need to do is to create or adapt an algorithm that tests
whether a number is prime or not, and use that along with filter on
your list of numbers. Several examples exist, it's quite a popular
question.

HTH.

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


Re: Project-wide variable...

2011-06-23 Thread Noah Hall
On Thu, Jun 23, 2011 at 2:41 PM, Gnarlodious gnarlodi...@gmail.com wrote:
 Is there a way to declare a project-wide variable and use that in all
 downstream modules?

Well, the standard way you should do it is to use import to import a
certain variable - for example -

a.py -

x = 3


from a import x
x
3
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Project-wide variable...

2011-06-23 Thread Noah Hall
On Thu, Jun 23, 2011 at 3:09 PM, Gnarlodious gnarlodi...@gmail.com wrote:
 On Jun 23, 7:59 am, Noah Hall wrote:
 from a import x

 I'm doing that:
 import Module.Data as Data

Well, that's not quite the same. You're using Module.Data as Data - I
guess you've done this because you've realised that import Module
means you still have to write Module.Data every time. But the correct
way to is state exactly which function or object you want - for
example, from Module import Data. Simple, right? I mean, you almost
had it, but it seems like you've gotten a little confused with various
theories.



 However I end up doing it in every submodule, so it seems a little
 redundant. I wish I could load the variable in the parent program and
 have it be available in all submodules. Am I missing something?

Well, generally, if you've got a variable that you need in all your
sub-modules, the chances are that your code infrastructure needs a bit
of reordering (at least, that's what I find in my case). Without
seeing your code, though, I would find it hard to make a judgement on
what you need. Perhaps reading up on the documentation will help -
http://docs.python.org/tutorial/modules.html#packages

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


Re: Project-wide variable...

2011-06-23 Thread Noah Hall
On Thu, Jun 23, 2011 at 6:18 PM, Guillaume Martel-Genest
guillaum...@gmail.com wrote:
 On Jun 23, 9:41 am, Gnarlodious gnarlodi...@gmail.com wrote:
 Is there a way to declare a project-wide variable and use that in all
 downstream modules?

 What about using an environment variable?

Yes, that's fine, but only if the data is suitable for it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: what happens inside?

2011-06-22 Thread Noah Hall
On Wed, Jun 22, 2011 at 4:45 PM, Chetan Harjani
chetan.harj...@gmail.com wrote:
 why tuples are immutable whereas list are mutable?
Because an immutable data type was needed, and a mutable type was also needed ;)

 why when we do x=y where y is a list and then change a element in x, y
 changes too( but the same is not the case when we change the whole value in
 x ), whereas, in tuples when we change x, y is not affected and also we cant
 change each individual element in tuple. Someone please clarify.

That's because y points to an object. When you assign x = y, you say
assign name x to object that's also pointed to by name y. When you
change the list using list methods, you're changing the actual object.
Since x and y both point to the same object, they both change.
However, if you then assign y = [1], name y no longer points to the
original object. x still remains pointing to the original object.

 a = [1,2] # assign name a to object [1,2]
 b = a # assign name b to object referred to by name a
 b
[1, 2]
 a = [3,4] # assign name a to object [3,4]
 b
[1, 2]
 a
[3, 4]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python 3 constant

2011-06-22 Thread Noah Hall
On Wed, Jun 22, 2011 at 7:54 PM, sidRo slacky2...@gmail.com wrote:
 How to declare a constant in python 3?

There aren't true constants in Python, but instead we use a standard
defined by PEP 8, which states constants are in all caps, for example,
PI = 3.14, as opposed to pi = 3.14 which could change (according to
PEP 8, that is)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Better way to iterate over indices?

2011-06-21 Thread Noah Hall
On Tue, Jun 21, 2011 at 7:05 PM, Billy Mays no...@nohow.com wrote:
 I have always found that iterating over the indices of a list/tuple is not
 very clean:

 for i in range(len(myList)):
    doStuff(i, myList[i])

 I know I could use enumerate:

 for i, v in enumerate(myList):
    doStuff(i, myList[i])

 ...but that stiff seems clunky.

You're not using it properly. Think about it. You're giving two names
- i and v. You've forgotten about v -

 for i, v in enumerate('fish'):
... print i, v
...
0 f
1 i
2 s
3 h


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


Re: What is this syntax ?

2011-06-19 Thread Noah Hall
On Sun, Jun 19, 2011 at 2:41 PM, candide candide@free.invalid wrote:
 With Python 2.7 :

 x=foo
 print ''+x+''
 foo

 What is this curious syntax on line 2 ? Where is it documented ?

Just to make it clear to you what is happening -

 x = foo
 print '  ' + x + '  '
  foo 


Anyway, it's documented here -
http://docs.python.org/tutorial/introduction.html#strings
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Free Software University - Python Certificate

2011-03-22 Thread Noah Hall
On Tue, Mar 22, 2011 at 11:30 AM, Giovani elgrana...@gmail.com wrote:
 I don't know whether this site is useful or not.

 Assuming this site is serious:
 If you are already subscribed you might be able to give some feedback.

 One can't even see the list of courses without regsitering.
 This is very unprofessional and might indicate, that they just want to
 reap contact information.

 I'm not the admin of the site, when the course finish will be aviable
 throgh the main website (I think).


 One can't even see a date or a time line without registering. So one
 doesn't even know whether the whole project is already dead for several
 years or really active.


 I really active, there more than 100 users registered and lots of them
 are working to make several course certificates (PHP, Python, Java,
 JavaScript, FreeNAS, etc..).

 To me all this does not look professional for somebody who want to
 attract students / instructors

 The finally is make professional contents, but this project is already
 in a early stage.


I've been following this project for a while, since it was annouced on
the Ubuntu forums. I can't say that I've been at all impressed by
anything they have to offer.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Minor questions on Class and Functions

2011-03-20 Thread Noah Hall
 class Message:
    def __init__(self,string1,string2,lenstr1,lenstr2):
        self.string1=MY
        self.string2=NAME
        self.lenstr1=lenstr1
        self.lenstr2=lenstr2

The variables string1 and string2 that you're passing here are in fact
useless. They don't do anything inside the method. Is there any point
for them? There's no need to pass __init__ variables just so you can
assign self.variable_name = fixed text.

    def lenstring(self):
        lenstr1=len(self.string1)
        lenstr2=len(self.string2)

I think you want self.lenstr1 and self.lenstr2 here - otherwise you're
assigning local variables with the same name as those defined within
the class, and throwing them away.

    def printstr(self):
        print lenstr1
        print lenstr2

Again, I think you want self.lenstr1 and self.lenstr2
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How Translate This PHP

2011-03-06 Thread Noah Hall
On Sun, Mar 6, 2011 at 2:45 PM, Victor Subervi victorsube...@gmail.com wrote:
 Hi;
 How do I translate this PHP code?

 if($ok){
     echo returnValue=1;
 }else{
     echo returnValue=0;
 }

From the code provided -

if ok:
print 'returnValue=1'
else:
print 'returnValue=0'
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How Translate This PHP

2011-03-06 Thread Noah Hall
On Sun, Mar 6, 2011 at 3:11 PM, Victor Subervi victorsube...@gmail.com wrote:
 Ah. I thought I had to return something!

Well, based on what you asked, you would've, but based on the code,
all it was doing is printing returnValue - value

Of course, a better way of doing it would be to use formatting -

For example,

print 'returnValue=%d' % ok
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: learn the network program of python

2011-03-04 Thread Noah Hall
On Fri, Mar 4, 2011 at 12:47 PM, loopzhong001 loopzhong...@126.com wrote:
 Dear All,
     Would anyone tell me haow to start?


Well, to start on this mailing list - 1) Name the networking
framework/modules you want to use (if you have one, else say can
someone suggest a networking framework/module?) 2) Say what you want
to do with it and 3) State how much programming you've done in Python
already.

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


Re: Newbie getting desperate with for

2011-02-18 Thread Noah Hall
On Fri, Feb 18, 2011 at 4:54 PM, Michael Torrie torr...@gmail.com wrote:
 On 02/17/2011 04:10 PM, Werner wrote:
 Just for your information, your code is the equivalent of:

 while True:
    temp = range(2000)

 The for loop does absolutely nothing in your case.  After the range is
 computed, the for loop exits on the first iteration.

Ah, but the for loop is there for a reason, I imagine. It'd certainly
be slower per while loop.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-02 Thread Noah Hall
On Wed, Feb 2, 2011 at 7:44 PM, rantingrick rantingr...@gmail.com wrote:
 On Feb 1, 11:23 am, rantingrick rantingr...@gmail.com wrote:
  py troll_group.append(Red John)
 py flamer_group.append(troll_group.pop(Corey Richardson))


Out of interest, what interpretor uses py?
I've never seen any. Just sayin'.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-02 Thread Noah Hall
On Wed, Feb 2, 2011 at 9:25 PM, Emile van Sebille em...@fenx.com wrote:
 ActivePython 2.6.1.1 (ActiveState Software Inc.) based on
 Python 2.6.1 (r261:67515, Dec  5 2008, 13:58:38) [MSC v.1500 32 bit (Intel)]
 on
 win32
 Type help, copyright, credits or license for more information.
 import sys
 sys.ps1
 ' '
 sys.ps1=py
 py

I know how to do it already, thanks, but I've never seen it native. ;)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-01 Thread Noah Hall
On Tue, Feb 1, 2011 at 3:14 PM, rantingrick rantingr...@gmail.com wrote:
 #-- Embedded Trolls and Minions --#
 Steven D'Aprano(smart and witty (annoying) troll)
 Stephan Hansen (controversy troll)
 Ben Finny (haughty troll)
 alex23(angry/dangerous troll)
 Tyler Littlefeild(confused troll)
 Bryan ? (annoying troll)
 Corey Richarson
 Nicholas Devenish
 Alexander Kapps
 rusi ?
 Andre ?
 Geremy Condra (troll-wagoneer)
 Ethan Furman
 Noah Hall
 Adam Skutt
 Arndt Rodger Schnieder
 Mark Roseman (Tkinter's minion)

These people, including myself, aren't trolls nor minions. They just
don't agree with you.

And on the topic of IDLE, I agree the coding's not great, but I
disagree with it being a problem for the Python community. I've never,
ever seen a thread saying OMG, WHAT DOES THIS IDLE SOURCE CODE
EXTRACT MEAN? PLEASE HELP, I CAN'T UNDERSTAND IDLE, THEREFORE I CAN
NOT USE Tkinter! I'm leaving Python, Visual Basic's for me from now
on! NO DAMN IDLE TO MESS UP EVERYTHING, YOU SEE?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-24 Thread Noah Hall
On Mon, Jan 24, 2011 at 5:57 PM, rantingrick rantingr...@gmail.com wrote:

 Why don't you just tell him to shut the hell up Mark?

 accidentally quoting me too much. You guys are very disappointing to
 this community. Everyone here needs a voice. We must never engage in
 behaviors that would limit speech from our community members who have
 the intelligence to offer reasonable arguments. Octavian is not a
 troll or spammer and should not be treated as such! Stop this
 threating of our community members NOW!

Oh, the irony. It's not so much what you're saying, but the way you're
saying it. You're not allowed to treat people like that - no matter
how much you *think* you're right. You've done nothing but accuse
anyone disagreeing with you of being a troll and then proceed to curse
them. I don't know why you're surprised people won't discuss matters
with you. It sounds like you have a lot of growing up you need to do.
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >