Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread dn via Python-list
On 29/05/24 06:49, Gilmeh Serda via Python-list wrote: Solved by using a different method. Hedonist for hire... no job too easy! This combination of sig-file and content seems sadly ironic. How about CONTRIBUTING to the community by explaining 'the solution' to people who may find a simi

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread o1bigtenor via Python-list
On Tue, May 28, 2024 at 9:48 PM Gilmeh Serda via Python-list < python-list@python.org> wrote: > > Solved by using a different method. > > - - - And that was how? TIA -- https://mail.python.org/mailman/listinfo/python-list

Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread Thomas Passin via Python-list
On 5/26/2024 2:28 AM, Gilmeh Serda via Python-list wrote: The web claims (I think on all pages I've read about Markdown and Python) that this code should work, with some very minor variants on the topic: ```python import os with open(os.path.join('/home/user/apath', 'somefile')) as f: pri

Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread dn via Python-list
With reference to another reply here, the "Weird stuff" came from reading the question, finding it unclear, and only later realising that whereas most people write Markdown-formatted documents for later processing, or perhaps docstrings in Markdown-format for collection by doc

Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread Grant Edwards via Python-list
On 2024-05-26, Gilmeh Serda via Python-list wrote: > The web claims (I think on all pages I've read about Markdown and Python) > that this code should work, with some very minor variants on the topic: > > ```python > > import os > > with open(os.path.join('/home/user/apath', 'somefile')) as f: >

Re: File write, weird behaviour

2023-02-19 Thread Thomas Passin
On 2/19/2023 6:10 PM, Mats Wichmann wrote: On 2/19/23 14:06, Dieter Maurer wrote: Azizbek Khamdamov wrote at 2023-2-19 19:03 +0500: ... Example 2 (weird behaviour) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities # the fol

Re: File write, weird behaviour

2023-02-19 Thread Mats Wichmann
On 2/19/23 14:06, Dieter Maurer wrote: Azizbek Khamdamov wrote at 2023-2-19 19:03 +0500: ... Example 2 (weird behaviour) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities # the following code DOES NOT add new record TO THE BEGI

Re: File write, weird behaviour

2023-02-19 Thread Dieter Maurer
Azizbek Khamdamov wrote at 2023-2-19 19:03 +0500: > ... >Example 2 (weird behaviour) > >file = open("D:\Programming\Python\working_with_files\cities.txt", >'r+') ## contains list cities ># the following code DOES NOT add new record TO THE BEGINNING of t

Re: File write, weird behaviour

2023-02-19 Thread Thomas Passin
On 2/19/2023 2:31 PM, Chris Angelico wrote: On Mon, 20 Feb 2023 at 06:24, Thomas Passin wrote: On 2/19/2023 1:53 PM, Chris Angelico wrote: On Mon, 20 Feb 2023 at 03:41, Azizbek Khamdamov wrote: Example 1 (works as expected) file = open("D:\Programming\Python\working_with_files\cities.txt"

Re: File write, weird behaviour

2023-02-19 Thread MRAB
On 2023-02-19 19:31, Chris Angelico wrote: On Mon, 20 Feb 2023 at 06:24, Thomas Passin wrote: On 2/19/2023 1:53 PM, Chris Angelico wrote: > On Mon, 20 Feb 2023 at 03:41, Azizbek Khamdamov > wrote: >> >> Example 1 (works as expected) >> >> file = open("D:\Programming\Python\working_with_files\

Re: File write, weird behaviour

2023-02-19 Thread Chris Angelico
On Mon, 20 Feb 2023 at 06:24, Thomas Passin wrote: > > On 2/19/2023 1:53 PM, Chris Angelico wrote: > > On Mon, 20 Feb 2023 at 03:41, Azizbek Khamdamov > > wrote: > >> > >> Example 1 (works as expected) > >> > >> file = open("D:\Programming\Python\working_with_files\cities.txt", > >> 'r+') ## cont

Re: File write, weird behaviour

2023-02-19 Thread Peter J. Holzer
On 2023-02-19 12:59:43 -0500, Thomas Passin wrote: > On 2/19/2023 11:57 AM, Axy via Python-list wrote: > > Looks like the data to be written is buffered, so actual write takes > > place after readlines(), when close() flushes buffers. > > > > See io package documentation, BufferedIOBase. > > > >

Re: File write, weird behaviour

2023-02-19 Thread Thomas Passin
On 2/19/2023 1:53 PM, Chris Angelico wrote: On Mon, 20 Feb 2023 at 03:41, Azizbek Khamdamov wrote: Example 1 (works as expected) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities Side note: You happened to get lucky with P, w, and c, but for th

Re: File write, weird behaviour

2023-02-19 Thread Chris Angelico
On Mon, 20 Feb 2023 at 03:41, Azizbek Khamdamov wrote: > > Example 1 (works as expected) > > file = open("D:\Programming\Python\working_with_files\cities.txt", > 'r+') ## contains list cities Side note: You happened to get lucky with P, w, and c, but for the future, I recommend using forward slas

Re: File write, weird behaviour

2023-02-19 Thread Thomas Passin
yword or calling f.close() might result in the arguments of f.write() not being completely written to the disk, even if the program exits successfully." I realize that in the example, close() was called ... but not immediately after the write(). Can't deny, such a behaviour looks ut

Re: File write, weird behaviour

2023-02-19 Thread MRAB
;new city\n") file.close() Example 2 (weird behaviour) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities # the following code DOES NOT add new record TO THE BEGINNING of the file IF FOLLOWED BY readline() and readlines()#

Re: File write, weird behaviour

2023-02-19 Thread Peter J. Holzer
r file.write() Or alternatively, file.seek() to the intended position when switching between reading and writing. (The C standard says you have to do this. I can't find it in the Python docs, but apparently Python behaves the same.) > On 19/02/2023 14:03, Azizbek Khamdamov wrote: >

Re: File write, weird behaviour

2023-02-19 Thread Axy via Python-list
Looks like the data to be written is buffered, so actual write takes place after readlines(), when close() flushes buffers. See io package documentation, BufferedIOBase. The solution is file.flush() after file.write() Can't deny, such a behaviour looks utterly weird. Try to avoid desi

File write, weird behaviour

2023-02-19 Thread Azizbek Khamdamov
Example 1 (works as expected) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities # the following code adds new record to the beginning of the file, expected behaviour file.write("new city\n") file.close() Example 2 (we

Re: Weird strace of #! python script

2022-03-14 Thread Barry
> On 14 Mar 2022, at 21:29, Dan Stromberg wrote: > > I expected to see an exec of /usr/bin/python2, but I don't. I just see an > exec of /tmp/t. I understand that the kernel handles the #! Line itself, which is why you do not see it in strace. Barry -- https://mail.python.org/mailman/l

Re: Weird strace of #! python script

2022-03-14 Thread Chris Angelico
On Tue, 15 Mar 2022 at 08:28, Dan Stromberg wrote: > > Hi folks. > > First off, I know, python2 is ancient history. Porting to 3.x is on my > list of things to do (though I'm afraid it's not yet at the top of the > list), and the same thing happens with python3. > > So anyway, I'm strace'ing a #!

Weird strace of #! python script

2022-03-14 Thread Dan Stromberg
Hi folks. First off, I know, python2 is ancient history. Porting to 3.x is on my list of things to do (though I'm afraid it's not yet at the top of the list), and the same thing happens with python3. So anyway, I'm strace'ing a #!/usr/bin/python2 script. I expected to see an exec of /usr/bin/py

Re: Weird behavior for IDLE...

2020-10-13 Thread Terry Reedy
On 10/13/2020 4:51 AM, Steve wrote: Why does IDLE always open with the lowest three lines of the window end up hidden below the bottom of the screen behind the task bar? Every time I use it, I have to stop and grab the top of the window and drag it up to see the line and row information. I expl

Weird behavior for IDLE...

2020-10-13 Thread Steve
Why does IDLE always open with the lowest three lines of the window end up hidden below the bottom of the screen behind the task bar? Every time I use it, I have to stop and grab the top of the window and drag it up to see the line and row information. I explored the Options/Configure IDLE but di

Re: Weird Python Bug

2019-09-13 Thread MRAB
On 2019-09-13 20:17, CrazyVideoGamez wrote: For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers

RE: Weird Python Bug

2019-09-13 Thread David Raymond
gt; nums = [72, 4, 82, 67, 67] >>> odd_ones_out(nums) [4, 67, 67] >>> nums [4, 67, 67] >>> -Original Message- From: Python-list On Behalf Of CrazyVideoGamez Sent: Friday, September 13, 2019 3:18 PM To: python-list@python.org Subject: Weird Python Bug For some

Weird Python Bug

2019-09-13 Thread CrazyVideoGamez
For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers nums = [72, 4, 82, 67, 67] print(odd_ones_out(nums

Re: Help Needed : script weird result.

2018-09-01 Thread mohan4h
On Sunday, September 2, 2018 at 1:12:17 AM UTC+8, moh...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given array of > numbers. The script works fine for various combination of inputs but fails in > a weird way for a particular set

Re: Help Needed : script weird result.

2018-09-01 Thread Peter Pearson
On Sat, 1 Sep 2018 10:11:59 -0700 (PDT), moha...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given > array of numbers. The script works fine for various combination of > inputs but fails in a weird way for a particular set of inputs, can

Re: Help Needed : script weird result.

2018-09-01 Thread Dan Sommers
On 9/1/18 1:11 PM, moha...@gmail.com wrote: All, I m trying to run this small script to find the lowest of the given array of numbers. The script works fine for various combination of inputs but fails in a weird way for a particular set of inputs, can anyone point the mistake in the script

Re: Help Needed : script weird result.

2018-09-01 Thread Joel Goldstick
On Sat, Sep 1, 2018 at 1:26 PM duncan smith wrote: > > On 01/09/18 18:11, moha...@gmail.com wrote: > > All, > > > > I m trying to run this small script to find the lowest of the given array > > of numbers. The script works fine for various combination of inputs but

Re: Help Needed : script weird result.

2018-09-01 Thread duncan smith
On 01/09/18 18:11, moha...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given array of > numbers. The script works fine for various combination of inputs but fails in > a weird way for a particular set of inputs, can anyone point

Help Needed : script weird result.

2018-09-01 Thread mohan4h
All, I m trying to run this small script to find the lowest of the given array of numbers. The script works fine for various combination of inputs but fails in a weird way for a particular set of inputs, can anyone point the mistake in the script and the behavior. Script x = input ("

Re: Weird side effect of default parameter

2018-05-07 Thread Robert Latest via Python-list
Steven D'Aprano wrote: > Python function default values use *early binding*: the default parameter > is evaluated, ONCE, when the function is defined, and that value is used > each time it is needed. Thanks, "early binding" was the clue I was missing. robert -- https://mail.python.org/mailman/

Re: Weird side effect of default parameter

2018-05-04 Thread Steven D'Aprano
On Thu, 03 May 2018 19:47:37 +, Robert Latest via Python-list wrote: > Hello, > > I don't understand the behavior of the code below. Why does the dict > property "a" of both objects contain the same keys? This is only if > "a=dict" is in the initializer. If I put self.a = dict() into the init

Re: Weird side effect of default parameter

2018-05-03 Thread Gary Herron
This is a well known feature of Python.   It's a very common "gotcha" to new Python programmers. Google "Mutable default parameters in Python" for long list of explanations and fixes. In short, don't use a mutable object as a default parameter. Gary Herron On 05/03/2018 12:47 PM, python-

Weird side effect of default parameter

2018-05-03 Thread Robert Latest via Python-list
Hello, I don't understand the behavior of the code below. Why does the dict property "a" of both objects contain the same keys? This is only if "a=dict" is in the initializer. If I put self.a = dict() into the init function, I get two separate dicts class Foo(object): def __init__(self, x,

Re: Replace weird error message?

2016-03-19 Thread Chris Angelico
On Thu, Mar 17, 2016 at 5:39 AM, Joel Goldstick wrote: > can you show the complete code? It doesn't start with "{:02} I don't think Actually, yes it does; I can confirm the OP's concern: $ python3 Python 3.6.0a0 (default:ae76a1046bb9, Mar 17 2016, 05:45:31) [GCC 5.3.1 20160121] on linux Type "h

Re: Replace weird error message?

2016-03-19 Thread Rick Johnson
On Wednesday, March 16, 2016 at 1:53:45 PM UTC-5, Dan Strohl wrote: > Actually, I think that was the complete code... give it a try... > > "{:02}".format("1") > > produces the error listed. > > I agree the error is not very clear, since the "=" was not > passed, it seems like an incorrect error.

Re: Replace weird error message?

2016-03-19 Thread Sven R. Kunze
On 16.03.2016 19:53, Ben Finney wrote: Do you think some better error message should be used? Yes, I think that error message needs to be improved. Please file a bug report in Python's issue tracker https://bugs.python.org/>. For example a hint that "0" does work for the given argument. I sug

Re: Replace weird error message?

2016-03-19 Thread Terry Reedy
On 3/16/2016 3:08 PM, Chris Angelico wrote: On Thu, Mar 17, 2016 at 5:53 AM, Ben Finney wrote: For example a hint that "0" does work for the given argument. I suggest: “zero-padding only allowed for numeric types, not 'str'”. That's very slightly misleading too; zero padding is perfectly le

RE: Replace weird error message?

2016-03-19 Thread Dan Strohl via Python-list
27;=' and '0' padding are not allowed in string format specifiers" > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Joel Goldstick > Sent: Wednesday, March 16, 2016 11:39 AM > Cc: python-list@p

Re: Replace weird error message?

2016-03-19 Thread Joel Goldstick
can you show the complete code? It doesn't start with "{:02} I don't think On Wed, Mar 16, 2016 at 2:34 PM, the.gerenuk--- via Python-list < python-list@python.org> wrote: > The following error message, makes it a bit hard to understand what went > wrong > > >>> "{:02}".format("1") > Traceback (

Re: Replace weird error message?

2016-03-19 Thread Ben Finney
"the.gerenuk--- via Python-list" writes: > The following error message, makes it a bit hard to understand what went wrong > > >>> "{:02}".format("1") > Traceback (most recent call last): > File "", line 1, in > ValueError: '=' alignment not allowed in string format specifier Meaning that the

Replace weird error message?

2016-03-19 Thread the.gerenuk--- via Python-list
The following error message, makes it a bit hard to understand what went wrong >>> "{:02}".format("1") Traceback (most recent call last): File "", line 1, in ValueError: '=' alignment not allowed in string format specifier (this can happen easily if you read in text files and forget to convert

Re: Replace weird error message?

2016-03-19 Thread Terry Reedy
On 3/16/2016 2:53 PM, Ben Finney wrote: "the.gerenuk--- via Python-list" writes: The following error message, makes it a bit hard to understand what went wrong "{:02}".format("1") Traceback (most recent call last): File "", line 1, in ValueError: '=' alignment not allowed in string form

Re: Replace weird error message?

2016-03-19 Thread Joel Goldstick
On Wed, Mar 16, 2016 at 2:53 PM, Ben Finney wrote: > "the.gerenuk--- via Python-list" writes: > > > The following error message, makes it a bit hard to understand what went > wrong > > > > >>> "{:02}".format("1") > > Traceback (most recent call last): > > File "", line 1, in > > ValueError: '

Re: Replace weird error message?

2016-03-18 Thread Chris Angelico
On Thu, Mar 17, 2016 at 5:53 AM, Ben Finney wrote: >> For example a hint that "0" does work for the given argument. > > I suggest: “zero-padding only allowed for numeric types, not 'str'”. That's very slightly misleading too; zero padding is perfectly legal as long as you force the alignment: >>

Re: Replace weird error message?

2016-03-18 Thread Chris Angelico
On Thu, Mar 17, 2016 at 7:55 AM, Terry Reedy wrote: > On 3/16/2016 3:08 PM, Chris Angelico wrote: >> >> On Thu, Mar 17, 2016 at 5:53 AM, Ben Finney >> wrote: For example a hint that "0" does work for the given argument. >>> >>> >>> I suggest: “zero-padding only allowed for numeric types

Re: Weird python 2.7 import thing

2016-02-19 Thread Dan Stromberg
from pypi.python.org, but > it probably is installed from our internal pypi server. > > Thanks! I've taken this to Stackoverflow: http://stackoverflow.com/questions/35512989/weird-cpython-2-7-import-traceback-not-an-importerror Thanks again. -- https://mail.python.org/mailman/listinfo/python-list

Re: Weird python 2.7 import thing

2016-02-19 Thread Dan Stromberg
On Thu, Feb 18, 2016 at 5:40 PM, Dan Stromberg wrote: > > BTW, this is not a package I pip installed from pypi - it's an > internal-only project. I need to correct this: It's not installed from pypi.python.org, but it probably is installed from our internal pypi server. Thanks! -- https://mail

Re: Weird and sparese cgi:error

2016-02-19 Thread Φώντας Λαδοπρακόπουλος
[root@nexus cgi-bin]# head -10 ./metrites.py #!/usr/bin/python3 # coding=utf-8 import cgitb; cgitb.enable() import cgi, re, os, sys, socket, time, datetime, locale, codecs, random, smtplib, subprocess, pymysql, geoip2.database from datetime import datetime, timedelta from http import cookies #

Re: Weird and sparese cgi:error

2016-02-19 Thread Φώντας Λαδοπρακόπουλος
uot;, line 676, in __getitem__ raise KeyError(key) KeyError: 'HTTP_USER_AGENT' [root@nexus cgi-bin]# === everything is they should but still iam gettign that weird cgi:err error -- https://mail.python.org/mailman/listinfo/python-list

Weird and sparese cgi:error

2016-02-18 Thread Φώντας Λαδοπρακόπουλος
Hello, I recentely changed VPS server and when i try to load my webiste iam receiving 500 error which i wasnt receiving in my old VPS server with the same exact cgi scripts. After looking at Apacher's error_log iam seeing the following output when i try to load scripts from cgi-bin directory.

Weird python 2.7 import thing

2016-02-18 Thread Dan Stromberg
OK, I'd rather be on 3.x, but that's not going to happen today. So 2.7. I have added directories to my sys.path hundreds of times before importing from them, and know what to expect from that. I confess, I don't have a lot of package or egg experience. However, I have a somewhat special (appare

Re: Weird and sparese cgi:error

2016-02-17 Thread Chris Angelico
On Thu, Feb 18, 2016 at 12:47 AM, Jeremy Leonard wrote: > On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος > wrote: >> Hello, >> >> I recentely changed VPS server and when i try to load my webiste iam >> receiving 500 error which i wasnt receiving in my old VPS server wi

Re: Weird and sparese cgi:error

2016-02-17 Thread Jeremy Leonard
On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος wrote: > Hello, > > I recentely changed VPS server and when i try to load my webiste iam > receiving 500 error which i wasnt receiving in my old VPS server with the > same exact cgi scripts. > > After looking at Apacher's

Confused by python-dbus weird behavior

2016-01-11 Thread Travis Griggs
This may not be a great list for this question (which would be?); it’s a big group, and I’m hoping there’s some people here that cross into these same areas. I’m new to dbus, it seems it’s a sort of CORBA for the Linux world. :) Python seems to be a popular way to interact with it. I’m trying to

Re: Weird list conversion

2015-12-13 Thread Chris Angelico
On Mon, Dec 14, 2015 at 7:31 AM, Erik wrote: > On 13/12/15 20:28, Erik wrote: >> >> When you call "print", then the list class's __repr__() method is called >> which in turn calls the contained objects' __repr__() methods in turn > > > I mean the __str__() method, not __repr__() in this case - how

Re: Weird list conversion

2015-12-13 Thread Larry Hudson via Python-list
On 12/13/2015 12:05 PM, KP wrote: On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: Hi all, f = open("stairs.bin", "rb") data = list(f.read(16)) print data returns ['=', '\x04', '\x00', '\x05', '\

Re: Weird list conversion

2015-12-13 Thread Erik
On 13/12/15 20:28, Erik wrote: When you call "print", then the list class's __repr__() method is called which in turn calls the contained objects' __repr__() methods in turn I mean the __str__() method, not __repr__() in this case - however, the answer is otherwise the same. E. -- https://m

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 1:05 PM, KP wrote: > On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: >> In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: >> >Hi all, >> > >> > f = open("stairs.bin", "rb") >> > data = list(f.read(16)) >> > print data >> > >> >re

Re: Weird list conversion

2015-12-13 Thread Erik
On 13/12/15 20:05, KP wrote: On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: Hi all, f = open("stairs.bin", "rb") data = list(f.read(16)) print data returns ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '

Re: Weird list conversion

2015-12-13 Thread KP
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: > In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: > >Hi all, > > > > f = open("stairs.bin", "rb") > > data = list(f.read(16)) > > print data > > > >returns > > > >['=', '\x04', '\x00', '\x05', '\x00', '\

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 12:45 PM, wrote: > Hi all, > > f = open("stairs.bin", "rb") > data = list(f.read(16)) > print data > > returns > > ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00', > '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'] > > The fir

Re: Weird list conversion

2015-12-13 Thread Laura Creighton
In a message of Sun, 13 Dec 2015 11:45:19 -0800, high5stor...@gmail.com writes: >Hi all, > > f = open("stairs.bin", "rb") > data = list(f.read(16)) > print data > >returns > >['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00', >'\x00', '\x00', '\x00', '\x0

Weird list conversion

2015-12-13 Thread high5storage
Hi all, f = open("stairs.bin", "rb") data = list(f.read(16)) print data returns ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'] The first byte of the file is 0x3D according to my hex editor, so why

Re: Weird behavior on __dict__ attr

2015-02-10 Thread Steven D'Aprano
Shiyao Ma wrote: > Hi. > > My context is a little hard to reproduce. > > NS3 is a network simulation tool written in C++. I am using its Python > binding. > > So the class I am dealing with is from a .so file. So it is written in (probably) C and you don't have source code for it. > Say, I do

Re: Weird behavior on __dict__ attr

2015-02-09 Thread Dave Angel
On 02/09/2015 09:52 PM, Shiyao Ma wrote: Hi. My context is a little hard to reproduce. WHY don't you try? Telling us about a class without showing how it's defined leaves us all guessing. Start by telling us Python version. And if it's 2.x, tell us whether this class is an old style or n

Weird behavior on __dict__ attr

2015-02-09 Thread Shiyao Ma
Hi. My context is a little hard to reproduce. NS3 is a network simulation tool written in C++. I am using its Python binding. So the class I am dealing with is from a .so file. Say, I do the following: % import ns.network.Node as Node # Node is a class # it has a __dict__ attr # Now I insta

Re: very weird pandas behavior

2014-12-23 Thread Steven D'Aprano
Rick Johnson wrote: > On Tuesday, December 23, 2014 3:35:20 AM UTC-6, wxjm...@gmail.com wrote: >> >> [...] >> >> Wait for ther 3.5 release. I will still show >> you how to make Idle, tkinter, Python crashing >> in 10 seconds. >> >> Discussing with (some) core devs is simply impossible, >> they do

Re: very weird pandas behavior

2014-12-23 Thread Rick Johnson
On Tuesday, December 23, 2014 3:35:20 AM UTC-6, wxjm...@gmail.com wrote: > > [...] > > Wait for ther 3.5 release. I will still show > you how to make Idle, tkinter, Python crashing > in 10 seconds. > > Discussing with (some) core devs is simply impossible, > they do not whish to discuss! > > All

Re: very weird pandas behavior

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 9:15 AM, Rick Johnson wrote: > I mean, if you were dumping it because of it's > shameless herd-conformity to the Unicode standard then AT > LEAST that would make sense me! Wait, which of our trolls are you? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: very weird pandas behavior

2014-12-22 Thread Rick Johnson
On Monday, December 22, 2014 9:56:11 AM UTC-6, ryguy7272 wrote: I've been using Python for quite a few years now an i can only once remember using any type of "python installation tools" (easy_install or pip... puke!). I've always found the easiest route to be just downloading a zip/tar file, and

Re: very weird pandas behavior

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 3:47 AM, Dave Angel wrote: > (I lied. I kept Windows, in a Virtualbox, so I can resurrect it on demand) You remind me of the evil sorcerers who keep their defeated foes around in undead form, so they can torment them whenever they feel like it. Only difference is, resurre

Re: very weird pandas behavior

2014-12-22 Thread Dave Angel
On 12/22/2014 10:55 AM, ryguy7272 wrote: I just uninstalled Python and deleted 15 Python books that I found online. AH! I feel great That's the way i felt when I uninstalled Windows. It's better not to not have something installed that you won't run. Likewise

Re: very weird pandas behavior

2014-12-22 Thread Mark Lawrence
On 22/12/2014 15:55, ryguy7272 wrote: On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: I downloaded pandas and put it in my python directory, then, at the C-prompt, I ran this: "pip install pandas" It looks like everything downloaded and installed fine. Great. Now, in Pytho

Re: very weird pandas behavior

2014-12-22 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-21 Thread oldknackers
On Saturday, December 20, 2014 3:46:40 PM UTC, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > impor

Re: very weird pandas behavior

2014-12-21 Thread Steven D'Aprano
On Sun, 21 Dec 2014 18:25:38 -0800, ryguy7272 wrote: > I just ran these two commands in the c-prompt: > pip install --upgrade numpy > pip install --upgrade pandas What is the purpose of the --upgrade switch? Just run `pip install numpy`, and COPY and PASTE the entire output of pip into your re

Re: very weird pandas behavior

2014-12-21 Thread Rustom Mody
On Monday, December 22, 2014 7:55:50 AM UTC+5:30, ryguy7272 wrote: > Sorry, but that's what drives me nuts. I install a few packages, and the > messages that I get says the package is installed...then it says it's NOT > installed...I don't know what to think... Its nice to bang the head agains

Re: very weird pandas behavior

2014-12-21 Thread Mark Lawrence
On 22/12/2014 02:07, ryguy7272 wrote: On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: I downloaded pandas and put it in my python directory, then, at the C-prompt, I ran this: "pip install pandas" It looks like everything downloaded and installed fine. Great. Now, in Pytho

Re: very weird pandas behavior

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 1:25 PM, ryguy7272 wrote: > > I just ran these two commands in the c-prompt: > pip install --upgrade numpy > pip install --upgrade pandas > > It seemed like everything was being downloaded and installed. Seems ok. > Then I go back to the Python Shell and ran 'import nump

Re: very weird pandas behavior

2014-12-21 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-21 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-21 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-21 Thread Dave Angel
On 12/21/2014 08:01 PM, ryguy7272 wrote: On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: I downloaded pandas and put it in my python directory, then, at the C-prompt, I ran this: "pip install pandas" It looks like everything downloaded and installed fine. Great. Now, in Py

Re: very weird pandas behavior

2014-12-21 Thread oldknackers
, in Python Shell, I enter this: > import pandas as pd > > I get this error. > Traceback (most recent call last): > File "", line 1, in > import pandas as pd > ImportError: No module named pandas > > > Any idea what I'm doing wrong? It's

Re: very weird pandas behavior

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 12:01 PM, ryguy7272 wrote: > Part of the problem is, I don't know why in 2014 we're entering commands in > the C-prompt to run a Windows program. I thought all of that stuff was over > in the very early 1990s. Also, I can't understand why Python can't download > this f

Re: very weird pandas behavior

2014-12-21 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-21 Thread Dave Angel
On 12/21/2014 07:44 AM, ryguy7272 wrote: On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: I downloaded pandas and put it in my python directory, then, at the C-prompt, I ran this: "pip install pandas" Thanks Steven. I just tried what you recommended, and got this. import

Re: very weird pandas behavior

2014-12-21 Thread ryguy7272
On Saturday, December 20, 2014 10:46:40 AM UTC-5, ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the C-prompt, > I ran this: > "pip install pandas" > > It looks like everything downloaded and installed fine. Great. > > Now, in Python Shell, I enter this: > im

Re: very weird pandas behavior

2014-12-20 Thread Steven D'Aprano
ryguy7272 wrote: > I downloaded pandas and put it in my python directory, then, at the > C-prompt, I ran this: "pip install pandas" C-prompt? Are you maybe running Windows? I'll assume so. > It looks like everything downloaded and installed fine. Great. Did pip print any output? What did it

very weird pandas behavior

2014-12-20 Thread ryguy7272
I downloaded pandas and put it in my python directory, then, at the C-prompt, I ran this: "pip install pandas" It looks like everything downloaded and installed fine. Great. Now, in Python Shell, I enter this: import pandas as pd I get this error. Traceback (most recent call last): File ""

Re: Weird connection problem

2014-10-25 Thread Roland Hedberg
It’s a special HTTPS url and searching further it seems to be a SNI problem talked about here: http://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support > 25 okt 2014 kl. 08:48 skrev Joel Goldstick : > > On Sat, Oct 25, 2014 at 9:40 AM, Roland Hedberg wrote: >

Re: Weird connection problem

2014-10-25 Thread Joel Goldstick
On Sat, Oct 25, 2014 at 9:40 AM, Roland Hedberg wrote: > When I try to access a URL using requests I always get: > socket.error: [Errno 104] Connection reset by peer > > If I try to access the same URL using curl I get no error message instead I > get the page. > The same result if I use a web br

Re: Weird connection problem

2014-10-25 Thread Roland Hedberg
Oh, by the way! To make this more interesting :-/ I saw this behavior on a Linux machine (Ubuntu 14.04 LTS) using Python 2.7.6 if I do the same exercise on a Mac OS X machine also with Python 2.7.6 - no problem what so ever. > 25 okt 2014 kl. 08:40 skrev Roland Hedberg : > > When I try to acce

Weird connection problem

2014-10-25 Thread Roland Hedberg
When I try to access a URL using requests I always get: socket.error: [Errno 104] Connection reset by peer If I try to access the same URL using curl I get no error message instead I get the page. The same result if I use a web browser like Safari. But, if I use python httplib I also get Errno

Re: Weird SSL problem

2014-10-01 Thread Roland Hedberg
30 sep 2014 kl. 00:55 skrev Ned Deily : > In article , > Roland Hedberg wrote: > >> Hi! >> >> I¹m trying to access >> https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration >> >> Doing it the simplest way I get the following: >> > import urllib > f = > urllib.

Re: Weird SSL problem

2014-09-29 Thread Ned Deily
In article , Roland Hedberg wrote: > Hi! > > I¹m trying to access > https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration > > Doing it the simplest way I get the following: > > >>> import urllib > >>> f = > >>> urllib.urlopen("https://stsadweb.one.microsoft.com/adfs/.well

  1   2   3   4   5   6   7   >