On 29/03/15 07:00, Cameron Simpson wrote:
print(a_list.sort())
is printing the result of "a_list.sort()".
Like most Python functions that operate on something (i.e. .sort, which
sorts the list in place), the .sort method returns None. And that is
printed.
But you can use the sorted() funct
Ha ha thanks Danny for the hex message!
I am looking to basically match 2 unknown hex values or a byte at the end of
the 4 byte sequence.
I realise now I am trying to use a numeric \d expression when it needs to be
matching 2 nibbles or a byte.
Is there a way to match using some sort of wil
On 29/03/15 02:16, Juan C. wrote:
Ok, so, let me try to express what I think is 'right' here according to
what you said.
My code structure needs to be something like that:
pycinema
- package: pycinema
- - __init__.py
- - api.py
- - actor.py
- - movie.py
- - serie.py
- __main__.py
What I said
Ok I got it.
pchars = re.compile(b'\x00\x00\x00[\0-\xff]')
preceeding b and [0-\xff]
> From: dux...@hotmail.com
> To: tutor@python.org
> Date: Sun, 29 Mar 2015 07:55:01 +
> Subject: Re: [Tutor] escape character regex
>
> Ha ha thanks Danny for th
Ian D wrote:
> Ok I got it.
>
> pchars = re.compile(b'\x00\x00\x00[\0-\xff]')
>
> preceeding b and [0-\xff]
Also possible:
re.compile(b"\0\0\0.", re.DOTALL)
. by default means "any byte except \n", the re.DOTALL flag changes that to
"any byte".
or
re.compile(b"\0{3}.", re.DOTALL)
{3} mean
On 03/28/2015 09:16 PM, Juan C. wrote:
Ok, so, let me try to express what I think is 'right' here according to
what you said.
My code structure needs to be something like that:
pycinema
- package: pycinema
- - __init__.py
- - api.py
- - actor.py
- - movie.py
- - serie.py
- __main__.py
I'd su
On 29/03/2015 02:32, Juan C. wrote:
On Sat, Mar 28, 2015 at 10:26 PM Mark Lawrence
wrote:
If your classes are small put them in one source file, which is clearly
simpler than your proposed structure. Why over-engineer something if
there is no need to?
Well, my classes won't be that small, and s
Dave Angel wrote:
> On 03/28/2015 09:16 PM, Juan C. wrote:
>> Ok, so, let me try to express what I think is 'right' here according to
>> what you said.
>>
>> My code structure needs to be something like that:
>>
>> pycinema
>> - package: pycinema
>> - - __init__.py
>> - - api.py
>> - - actor.py
>>
On Sun, Mar 29, 2015 at 2:53 AM, Alan Gauld wrote:
> On 29/03/15 07:00, Cameron Simpson wrote:
>
>> print(a_list.sort())
>>
>> is printing the result of "a_list.sort()".
>>
>> Like most Python functions that operate on something (i.e. .sort, which
>> sorts the list in place), the .sort method re
On 29/03/2015 16:25, boB Stepp wrote:
On Sun, Mar 29, 2015 at 2:53 AM, Alan Gauld wrote:
On 29/03/15 07:00, Cameron Simpson wrote:
print(a_list.sort())
is printing the result of "a_list.sort()".
Like most Python functions that operate on something (i.e. .sort, which
sorts the list in pla
On Sun, Mar 29, 2015 at 3:56 AM Ben Finney
wrote:
As a side issue: You apparently intend to choose names that are English
language.
If that's true, you should know that “actor”, “movie”, “series” are all
singular.
My bad, it's series indeed.
On Sun, Mar 29, 2015 at 10:33 AM Dave Angel wrote:
On 29/03/2015 18:30, Juan C. wrote:
On Sun, Mar 29, 2015 at 3:56 AM Ben Finney
wrote:
As a side issue: You apparently intend to choose names that are English
language.
If that's true, you should know that “actor”, “movie”, “series” are all
singular.
My bad, it's series indeed.
On Sun, Mar 29
Ok, applying what you guys said I have:
- folder: pycinema
- package: pycinema
- - core.py
- - mdb.py
- __main__.py
Current code on core.py:
# -*- coding: utf-8 -*-
from pycinema.mdb import MovieDB
API = MovieDB('API KEY GOES HERE')
class Actor:
def __init__(self, actor_id):
api = API.get_act
On 29/03/15 20:16, Juan C. wrote:
Current code on core.py:
from pycinema.mdb import MovieDB
API = MovieDB('API KEY GOES HERE')
class Actor:
...
Current code on mdb.py:
import requests
class MovieDB:
...
def get_actor(self, actor_id):
response = requests.get('http://api.themoviedb.org/3/per
Hello:
Here is what I am trying have my program do:
• Monitor a folder for files that are dropped throughout the day
• When a file is dropped in the folder the program should scan the file
o IF all the contents in the file have the same length
o THEN the file should be moved to a "success" fo
I'm currently making a pygame using IDLE and i'm having a minor issue with
my functions not changing color. My text is all plain black and its
bothering me. Is there a solution or can i make my program using another
text editor?
(I tried using notepad++ but i don't know how to run the program, it o
Hehey!
I'm learning python on a website called codecademy.com, where I made a
program to decode binary numbers. I guess the site uses a different
compiler, because on the site my code worked fine, but when I copied and
pasted it into the Python IDLE (3.4.2) it didn't work! I'm really don't know
wh
Found the solution
On Sun, Mar 29, 2015 at 2:56 PM, Calvin Thai wrote:
> I'm currently making a pygame using IDLE and i'm having a minor issue with
> my functions not changing color. My text is all plain black and its
> bothering me. Is there a solution or can i make my program using another
> t
Shouldn't this give me a list of squares?
[lambda x: x**2 for x in range(10)]
Instead I'm getting ten of these (with different addresses)
. at 0x01262A50>]
--
Jim
I can't think of a clever tagline today, so just imagine I said something
clever.
___
Tu
Hello:
I would appreciate your feedback on whether I correctly wrote my XML. I am
exporting a DataFrame and writing into a XML file. I used the ElementTree
library. The DataFrame has 11 rows and 8 columns (excluding the index
column).
#My schema assumption:
#
#[
#Some number row
#Sample text
#]
I downloaded Python 3.4.3 today (twice) and I can't get the IDLE to start.
The Python in the command window works great but I can't figure how to start
the IDLE. When I installed python there are two icons, 'PYTHON' and
"PYTHONW" . The first will opens Python in a command window and all is
Hello,
I recently learned about if statements and math functions. For my class we
are unit testing absolute values and have to make if statements so the
tests pass, but we cannot use built in functions like (abs). How do I start
it, I am so lost.
Thank you
hi, i am new to python and i have not done programming before but i am
learning along the way,
just want you to help me on how i can write a script that accepts an input
a measurement of a time interval in
seconds and prints a sentence giving the equivalent of the given number of
seconds
in hours,
On 29/03/2015 02:25, Jim Mooney wrote:
Shouldn't this give me a list of squares?
[lambda x: x**2 for x in range(10)]
Instead I'm getting ten of these (with different addresses)
. at 0x01262A50>]
That's exactly what you've asked the code to do. What makes you think
you need a lambda function
On Sun, Mar 29, 2015 at 8:55 PM Alan Gauld
wrote:
Can you explain how that works? Does the user create their own
random unique values? Do you use a source of unique keys?
Or could the Actor init() maybe generate an ID for the user?
But without the API knowing the ID, how does the correct data get
On Sat, Mar 28, 2015 at 6:25 PM, Jim Mooney wrote:
> Shouldn't this give me a list of squares?
> [lambda x: x**2 for x in range(10)]
>
> Instead I'm getting ten of these (with different addresses)
> . at 0x01262A50>]
Mark Lawrence's answer shows how to correct this.
Let's look at the problem a
On Fri, Jan 23, 2015 at 1:40 PM, Antonia van der Leeuw
wrote:
> Hehey!
>
> I'm learning python on a website called codecademy.com, where I made a
> program to decode binary numbers. I guess the site uses a different
> compiler, because on the site my code worked fine, but when I copied and
> paste
On Sat, Mar 28, 2015 at 4:04 PM, George Bollen wrote:
> hi, i am new to python and i have not done programming before but i am
> learning along the way,
>
> just want you to help me on how i can write a script that accepts an input
> a measurement of a time interval in
> seconds and prints a sente
On Thu, Mar 26, 2015 at 5:42 PM, Priya Persaud wrote:
> Hello,
>
> I recently learned about if statements and math functions. For my class we
> are unit testing absolute values and have to make if statements so the
> tests pass, but we cannot use built in functions like (abs). How do I start
> it,
Danny Yoo writes:
> Python 3 is a different language than Python 2. It looks like the
> codeacademy materials use Python 2, so you should probably do the same
> on your local system.
Alternatively, learn Python 3 (which at this time means learning
somewhere other than Codecademy).
https://w
On Thu, Mar 26, 2015 at 12:55 PM, Troll Worfolk wrote:
> I downloaded Python 3.4.3 today (twice) and I can't get the IDLE to start.
Did you run the installer afterwards?
What menu items do you see in your Windows "Start Menu" that are
associated to "Python 3.4"?
Hi.
Doing a quick/basic pycurl test on a site and trying to convert the
returned page to pure ascii.
The page has the encoding line
The test uses pycurl, and the StringIO to fetch the page into a str.
pycurl stuff
.
.
.
foo=gg.getBuffer()
-at this point, foo has the page in a str buffer.
W
On Sun, Mar 29, 2015 at 9:39 PM Juan C. wrote:
The ID is set by the API, I don't have control over it, I can't modify it,
and I don't really need to modify it. There is an option to search the API
using the name, like so (
http://private-anon-37abaab74-themoviedb.apiary-mock.com/3/search/person?qu
On 01/23/2015 04:40 PM, Antonia van der Leeuw wrote:
Hehey!
I'm learning python on a website called codecademy.com, where I made a
program to decode binary numbers. I guess the site uses a different
compiler, because on the site my code worked fine, but when I copied and
pasted it into the Pytho
On 03/29/2015 09:49 PM, bruce wrote:
Hi.
Doing a quick/basic pycurl test on a site and trying to convert the
returned page to pure ascii.
You cannot convert it to pure ASCII. You could replace all the invalid
characters with some special one, like question marks. But I doubt if
that's what
On 29Mar2015 21:49, bruce wrote:
Doing a quick/basic pycurl test on a site and trying to convert the
returned page to pure ascii.
And if the page cannot be representing in ASCII?
The page has the encoding line
The test uses pycurl, and the StringIO to fetch the page into a str.
Which Stri
Greetings,
Here is what I am trying have my program do:
• Monitor a folder for files that are dropped throughout the day
• When a file is dropped in the folder the program should scan the file
o IF all the contents in the file have the same length
o THEN the file should be moved to a "succe
Good evening again,
I'm replying to your second post, because I replied to the first.
This may be a more specific request than is typically handled on
Python tutor. This involves specific knowledge of the
xml.etree.ElementTree and pandas.DataFrame objects.
I would appreciate your feedback
38 matches
Mail list logo