Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
ArcticZombie
Sep 15, 2010
That shouldn't be possible. Here's some chopped down code showing what the Flask app is doing:
code:
@app.route("/solution", methods=['POST'])
def solution():
    json_data = request.get_json()

    board = convert_board_coords(json_data.get("board"))
    wildcards = convert_wildcards_tuple(json_data.get("wildcards"))
    rack = json_data.get("rack")
    layout = json_data.get("layout")
    wordlist = json_data.get("wordlist")

    game = init_scrabble_game(board, wildcards, rack, layout, wordlist)

    start = time.time()
    game.players[0].ai.generate_moves()
    end = time.time()
    time_taken = end - start

def init_scrabble_game(board, wildcards, rack, layout, wordlist):

    game = scrubble_game.ScrabbleGame(layout, wordlist, board, wildcards)

    player_1 = game.add_player("Player 1", rack)
    player_1_ai = scrubble_ai.ScrubbleAI(player_1)
    player_1.attach_ai(player_1_ai)

    return game
And what the standalone is doing:
code:
game = scrubble_game.ScrabbleGame(layouts.Wordfeud(), wordlists.TWL())
game.add_player("Player 1", "K?EPERS")
ai_1 = scrubble_ai.ScrubbleAI(game.get_player("Player 1"))
game.get_player("Player 1").attach_ai(ai_1)

start = time.time()
game.players[0].ai.generate_moves()
end = time.time()
time_taken = end - start
From the perspective of the Flask app and standalone, there are no differences, right?

Adbot
ADBOT LOVES YOU

csammis
Aug 26, 2003

Mental Institution

ArcticZombie posted:

That shouldn't be possible. Here's some chopped down code showing what the Flask app is doing:
code:
@app.route("/solution", methods=['POST'])
def solution():
    json_data = request.get_json()

    board = convert_board_coords(json_data.get("board"))
    wildcards = convert_wildcards_tuple(json_data.get("wildcards"))
    rack = json_data.get("rack")
    layout = json_data.get("layout")
    wordlist = json_data.get("wordlist")

    game = init_scrabble_game(board, wildcards, rack, layout, wordlist)

    start = time.time()
    game.players[0].ai.generate_moves()
    end = time.time()
    time_taken = end - start

def init_scrabble_game(board, wildcards, rack, layout, wordlist):

    game = scrubble_game.ScrabbleGame(layout, wordlist, board, wildcards)

    player_1 = game.add_player("Player 1", rack)
    player_1_ai = scrubble_ai.ScrubbleAI(player_1)
    player_1.attach_ai(player_1_ai)

    return game
And what the standalone is doing:
code:
game = scrubble_game.ScrabbleGame(layouts.Wordfeud(), wordlists.TWL())
game.add_player("Player 1", "K?EPERS")
ai_1 = scrubble_ai.ScrubbleAI(game.get_player("Player 1"))
game.get_player("Player 1").attach_ai(ai_1)

start = time.time()
game.players[0].ai.generate_moves()
end = time.time()
time_taken = end - start
From the perspective of the Flask app and standalone, there are no differences, right?

How are you running the Flask app and how are you running the standalone? If you're using Flask's app.run(debug=True) then the delay might be down Flask's interactive debugger.

ArcticZombie
Sep 15, 2010
Debug mode was enabled, but disabling it only shaves of about 4 seconds so I'm sitting at an average of 16 seconds instead of 20. Still almost double the time. As for the standalone computation, well the code posted is practically all of it, the only part missing is imports. I expect there to be some overhead but it seems a bit extreme.

supercrooky
Sep 12, 2006

ArcticZombie posted:

Debug mode was enabled, but disabling it only shaves of about 4 seconds so I'm sitting at an average of 16 seconds instead of 20. Still almost double the time. As for the standalone computation, well the code posted is practically all of it, the only part missing is imports. I expect there to be some overhead but it seems a bit extreme.

How is your memory utilization? High enough that the extra memory overhead from flask/webserver could be causing some swapping?

OnceIWasAnOstrich
Jul 22, 2006

It may be a slowdown because of the switching between the algorithm and the Flask server both running in the same thread? If you spun off a mini-process to compute the result and then brought it back with something like multiprocessing.apply_async it would probably bring it back to normal time.

ArcticZombie
Sep 15, 2010
I gave multiprocessing a go and it got the time down to the 9-10 second range, which I'm pretty happy with I guess. Thanks. There's room for further optimization but I'll cross that bridge when I get to it.

EDIT: Did some profiling and discovered I had an expensive list opertion being carried out thousands of times. Checking if a move is a duplicate of a move already known, when I can remove duplicates afterwards much faster using an OrderedSet :downs:. Time for that same computation is now 2.5 seconds and I can see some more low-hanging fruit.

ArcticZombie fucked around with this message at 16:21 on Feb 12, 2015

Jose Cuervo
Aug 25, 2004
What is an example of when I would use
Python code:
for x in dict.itervalues():
instead of
Python code:
for x in dict.values():
?

I guess I don't know what itervalues() gives me that values() does not.

EDIT: I am using Python 2.7 if that matters.

Jose Cuervo fucked around with this message at 21:05 on Feb 12, 2015

No Safe Word
Feb 26, 2005

Jose Cuervo posted:

What is an example of when I would use
Python code:
for x in dict.itervalues():
instead of
Python code:
for x in dict.values():
?

I guess I don't know what itervalues() gives me that values() does not.

EDIT: I am using Python 2.7 if that matters.

itervalues gives you an iterator over that dict's values, values gives you a copy of that dict's values

If you're just iterating over it and looking at the values then it's functionally identical

Dominoes
Sep 20, 2007

In Python 2, itervalues() returns an iterator, and .values() returns a list. The iterator loads each value as it's needed, which prevents loading all the values into memory at the same time. If you plan to iterate over the values more than once, you need to convert to a list first, or split it with itertools.tee().

In Python 3, itervalues() is gone, and values() returns an iterator. Python 3's built in functions and methods tend to return iterators when practical.

Dominoes fucked around with this message at 21:33 on Feb 12, 2015

Jose Cuervo
Aug 25, 2004

Dominoes posted:

In Python 2, itervalues() returns an iterator, and .values() returns a list. The iterator loads each value as it's needed, which prevents loading all the values into memory at the same time. If you plan to iterate over the values more than once, you need to convert to a list first, or split it with itertools.tee().

In Python 3, itervalues() is gone, and values() returns an iterator. Python 3's built in functions and methods tend to return iterators when practical.

Ok great. Now suppose I was iterating over the keys of a dictionary and would be removing keys that fit a certain criteria. In this case I must use
Python code:
for k in dict.keys():
    if condition_is_satisfied:
       del dict[k]
because I am (potentially) changing the dictionary as the loop progresses, correct?

Dominoes
Sep 20, 2007

You're right about changing the dictionary being a problem with an iterator: Your example would raise RuntimeError: dictionary changed size during iteration. To avoid this, you could use keys() in Python 2, or list(keys()) in Python 3.

Here are two ways to make it work using iterators:
Python code:
for k in mydict.copy().keys():  # .iterkeys() in Python 2
    if condition_is_satisfied:
       del mydict[k]
Or

Python code:
mydict = {k: v for k, v in mydict.items() if condition_is_satisfied}  # .iteritems() in Python 2

Dominoes fucked around with this message at 22:50 on Feb 12, 2015

Hughmoris
Apr 21, 2007
Let's go to the abyss!
I'm hacking together a script for work and I'm running into a snag.

What I want my script to do is be double-clicked and launched from the desktop. The user types in some input into the console window, then the script will launch an appropriate PDF file. The PDF is launched using a subprocess.call function.

My hangup is that the console window for my script stays open, and the script is in a "pause" state, until the user closes the PDF window. How do I go about having the script launch the PDF viewer then close/end itself?

accipter
Sep 12, 2003

Hughmoris posted:

I'm hacking together a script for work and I'm running into a snag.

What I want my script to do is be double-clicked and launched from the desktop. The user types in some input into the console window, then the script will launch an appropriate PDF file. The PDF is launched using a subprocess.call function.

My hangup is that the console window for my script stays open, and the script is in a "pause" state, until the user closes the PDF window. How do I go about having the script launch the PDF viewer then close/end itself?

How are you launching your PDF viewer? You might trying launching it with something like 'cmd /C viewer.exe filename'. Of course, you would want to break that up into a list and pass it through subprocess.call.

You might also try os.startfile(path[, operation]).

accipter fucked around with this message at 02:05 on Feb 13, 2015

EAT THE EGGS RICOLA
May 29, 2008

Dominoes posted:

You're right about changing the dictionary being a problem with an iterator: Your example would raise RuntimeError: dictionary changed size during iteration. To avoid this, you could use keys() in Python 2, or list(keys()) in Python 3.

Here are two ways to make it work using iterators:
Python code:
for k in mydict.copy().keys():  # .iterkeys() in Python 2
    if condition_is_satisfied:
       del mydict[k]
Or

Python code:
mydict = {k: v for k, v in mydict.items() if condition_is_satisfied}  # .iteritems() in Python 2

I significantly prefer the first one for anything that anyone else is going to have to read (not that this is really a complex example)

EAT THE EGGS RICOLA fucked around with this message at 02:04 on Feb 13, 2015

Hughmoris
Apr 21, 2007
Let's go to the abyss!

accipter posted:

How are you launching your PDF viewer? You might trying launching it with something like 'cmd /C viewer.exe filename'. Of course, you would want to break that up into a list and pass it through subprocess.call.

You might also try os.startfile(path[, operation]).

I am calling it like this:

code:
program = 'C:/Program Files (x86)/Adobe/Reader 10.0/Reader/AcroRd32.exe'
argue1 = '/A'
argue2 = 'page='+str(found_page)
file_location = "./resultPdf.pdf"

subprocess.call([program, argue1, argue2, file_location])
The script will stay running until the user closes Adobe Reader. I'd like it to launch Adobe Reader, the end the script, regardless of what the user does.

accipter
Sep 12, 2003

Hughmoris posted:

I am calling it like this:

code:
program = 'C:/Program Files (x86)/Adobe/Reader 10.0/Reader/AcroRd32.exe'
argue1 = '/A'
argue2 = 'page='+str(found_page)
file_location = "./resultPdf.pdf"

subprocess.call([program, argue1, argue2, file_location])
The script will stay running until the user closes Adobe Reader. I'd like it to launch Adobe Reader, the end the script, regardless of what the user does.

By launching Acrobat through cmd.exe /C you can essentially fork process, which allows the cmd.exe window to terminate.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

accipter posted:

By launching Acrobat through cmd.exe /C you can essentially fork process, which allows the cmd.exe window to terminate.

Could you give me a simple example of what you're talking about using the cmd.exe /c?

QuarkJets
Sep 8, 2008

Dominoes posted:

You're right about changing the dictionary being a problem with an iterator: Your example would raise RuntimeError: dictionary changed size during iteration. To avoid this, you could use keys() in Python 2, or list(keys()) in Python 3.

Here are two ways to make it work using iterators:
Python code:
for k in mydict.copy().keys():  # .iterkeys() in Python 2
    if condition_is_satisfied:
       del mydict[k]
Or

Python code:
mydict = {k: v for k, v in mydict.items() if condition_is_satisfied}  # .iteritems() in Python 2

This is all true but you should probably not use iterators while removing items from a dictionary

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Hughmoris posted:

I am calling it like this:

code:
program = 'C:/Program Files (x86)/Adobe/Reader 10.0/Reader/AcroRd32.exe'
argue1 = '/A'
argue2 = 'page='+str(found_page)
file_location = "./resultPdf.pdf"

subprocess.call([program, argue1, argue2, file_location])
The script will stay running until the user closes Adobe Reader. I'd like it to launch Adobe Reader, the end the script, regardless of what the user does.

This is because subprocess.call waits for the program to exit before returning the error code.
If you want to continue without waiting for it to finish, you can replace subprocess.call with subprocess.Popen.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Edison was a dick posted:

This is because subprocess.call waits for the program to exit before returning the error code.
If you want to continue without waiting for it to finish, you can replace subprocess.call with subprocess.Popen.

This does the job, thanks!

I'm running into another issue that seems like it should be very simple but I can't think of an elegant way to do it.

My user will input a working date in the format YYYY-MM-DD. Due to the way our files are named, my script needs to do all of its work with the working date + 1. So if the user inputs "2015-02-13" then I need to pass to my functions the date "2015-02-14". Ignoring temporarily the issues if it is the last day of the month, I can't think of a simple way to do that.

I guess I could hack away at it with a lot of code to turn "2015-02-13" into a list, then remove the '-', then turn it into an int, then add one to that int, then back to a list, re-insert the '-', then turn all that back into a string.

Any ideas on a simpler way to handle that?

Hughmoris fucked around with this message at 17:22 on Feb 13, 2015

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Hughmoris posted:

This does the job, thanks!

I'm running into another issue that seems like it should be very simple but I can't think of an elegant way to do it.

My user will input a working date in the format YYYY-MM-DD. Due to the way our files are named, my script needs to do all of its work with the working date + 1. So if the user inputs "2015-02-13" then I need to pass to my functions the date "2015-02-14". Ignoring temporarily the issues if it is the last day of the month, I can't think of a simple way to do that.

I guess I could hack away at it with a lot of code to turn "2015-02-13" into a list, then remove the '-', then turn it into an int, then add one to that int, then back to a list, re-insert the '-', then turn all that back into a string.

Any ideas on a simpler way to handle that?

Python code:
import datetime

print datetime.datetime.strptime('2015-1-13', '%Y-%m-%d').date() + datetime.timedelta(days=1)
Note that this is calendar-aware so it will handle last day of month correctly.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Thermopyle posted:

Python code:
import datetime

print datetime.datetime.strptime('2015-1-13', '%Y-%m-%d').date() + datetime.timedelta(days=1)
Note that this is calendar-aware so it will handle last day of month correctly.

Thermopyle, you're a genius. This works perfectly, thank you.

Dominoes
Sep 20, 2007

Check out the arrow library too. It has clean syntax, and defaults to timezone-aware dates.

Python code:
arrow.get('2015-01-13').replace(days=1)

Dominoes
Sep 20, 2007

Regex issue. How can I use an or statement groups, so that only the part of the or that mathes has its group taken?

Python code:
'([NSns])\s*|(-?)'
For example, the ablove regex, when matched with 'N', returns ('N', None) instead of 'N'. I can solve the problem I'm working on by checking two separate regexes, ie ([NSns])\s* and (-?), but I feel like there should be a cleaner, one-regex solution. (his is notable, since in my actual, more complicated example, using two regexes involves duplicating a bunch of code.


edit: It looks like I can work around this particular example with

Python code:
'([NSns-]?)\s*'
, since spaces could come after the minus sign too.

Dominoes fucked around with this message at 17:29 on Feb 15, 2015

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Dominoes posted:

Check out the arrow library too. It has clean syntax, and defaults to timezone-aware dates.

Python code:
arrow.get('2015-01-13').replace(days=1)

Wow, that's pretty simple. I'll take a look at it, thanks.

Tacos Al Pastor
Jun 20, 2003

Quick question: Does a shelf act just like a dictionary? For example, if you're going to shelf say some high scores from a game and you wanted to return the highest score along with the name of the player from a shelf would you act on it just like a dictionary? Is a shelfs data type the same as a dictionary?

Hughmoris
Apr 21, 2007
Let's go to the abyss!
I'm slowly fumbling my way through trying to build a very simple GUI for my Python script, using Tkinter. Its going to be used my non-tech nurses at my hospital, so I'm trying to make it as simple as possible (I'm a nurse too).



Is there a way to have the fields auto-tab as they are completed?

For instance, when they type in the "month" block, after two digits it would then automatically tab over to the "day" block, and after two more digits it would then jump to the final block. I see it a lot in HTML forms but I'm not if its possible to do that in Tkinter.

QuarkJets
Sep 8, 2008

Hughmoris posted:

I'm slowly fumbling my way through trying to build a very simple GUI for my Python script, using Tkinter. Its going to be used my non-tech nurses at my hospital, so I'm trying to make it as simple as possible (I'm a nurse too).



Is there a way to have the fields auto-tab as they are completed?

For instance, when they type in the "month" block, after two digits it would then automatically tab over to the "day" block, and after two more digits it would then jump to the final block. I see it a lot in HTML forms but I'm not if its possible to do that in Tkinter.

I think you'll have to code that up yourself. Sounds like a chore, but you can use set_focus to move the cursor between fields, and then you just need to connect a function to each field to check the current length upon an edit. If 2 digits are present in the most recently edited string, then use set_focus to move to the next widget.

Personally, I'm infuriated whenever I encounter data entry fields that auto-tab. If I'm not expecting auto-tab, then suddenly I've unintentionally skipped a field because I always use Tab when entering data into fields anyway. It's one of those features that sounds nice on the surface but just winds up frustrating a lot of users who aren't expecting it.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

QuarkJets posted:

I think you'll have to code that up yourself. Sounds like a chore, but you can use set_focus to move the cursor between fields, and then you just need to connect a function to each field to check the current length upon an edit. If 2 digits are present in the most recently edited string, then use set_focus to move to the next widget.

Personally, I'm infuriated whenever I encounter data entry fields that auto-tab. If I'm not expecting auto-tab, then suddenly I've unintentionally skipped a field because I always use Tab when entering data into fields anyway. It's one of those features that sounds nice on the surface but just winds up frustrating a lot of users who aren't expecting it.

Hmmm, good point. I've never designed any sort of GUI, much less one that would be used by others. I'm just trying to make this as fool proof as possible because I know that the users aren't going to input the Date in the correct format, and the script won't work and they'll say its a piece of crap.

Maybe I'm better off figuring out how to do basic error checking on their inputs.

QuarkJets
Sep 8, 2008

Hughmoris posted:

Hmmm, good point. I've never designed any sort of GUI, much less one that would be used by others. I'm just trying to make this as fool proof as possible because I know that the users aren't going to input the Date in the correct format, and the script won't work and they'll say its a piece of crap.

Maybe I'm better off figuring out how to do basic error checking on their inputs.

Yeah, basic error checking would probably be good. You could also auto-fill the current date if you really want to be helpful, unless this is a form that won't usually be using the current date

Hed
Mar 31, 2004

Fun Shoe
I'm with QuarkJets--the autotab kind of stinks, especially if you screw up and it quickly slings you back forward because whatever condition (length check probably) passed.

You could always fire up dateutil.parse and have it guess the format between MM-DD-YYYY, MM-DD-YY, MM/DD/YY, etc.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Hed posted:

I'm with QuarkJets--the autotab kind of stinks, especially if you screw up and it quickly slings you back forward because whatever condition (length check probably) passed.

You could always fire up dateutil.parse and have it guess the format between MM-DD-YYYY, MM-DD-YY, MM/DD/YY, etc.

Thanks for the idea. I used the datetime module to check to see if they entered the date in the format MM/DD/YYYY. If they didn't, it warns them and tells them to put it in correctly.

Does anyone have any experience with portable python? Does it work in the sense that its name wound imply? I have a Python script, with a Tkinter GUI, that I want to roll out to some of the nurses that work in my hospital. The computers they use are Windows XP and Windows 7. They all have access to a network "Nurse" folder. I was thinking I could install Portable Python in that network folder and place my script there. then just place a shortcut icon on their desktops. Then when they double click it, it will launch my python script.

Am I way off base with this? Any simpler ideas on how to deploy this to make it available on about 20 different computers? I'm way out of my depth on this but I've created something simple that I think will be immensely useful.

Harriet Carker
Jun 2, 2009

KICK BAMA KICK posted:

Think Python Like a Computer Scientist is very good and written for Python 2; here's the chapter on classes and objects.

I was actually just coming to this thread to say thank you to the posters several months ago who recommended this book. I slowly worked my way through it in my free time and finished it today. The exercises were supremely helpful and well-designed and I feel like I understand Python basics extremely well.

As a self-taught Python learner, where do I go next? I find that the readily available resources are either targeted toward beginners or experts. There isn't much I can find targeted toward intermediate learners. My goal is to become proficient enough at coding to make it a marketable skill.

I am enrolled an and currently taking one of the only Coursera Python courses, which is aimed at complete beginners and quite boring. The others I could find are either significantly above my level or also for complete beginners.

Harriet Carker fucked around with this message at 08:32 on Feb 16, 2015

QuarkJets
Sep 8, 2008

Hughmoris posted:

Thanks for the idea. I used the datetime module to check to see if they entered the date in the format MM/DD/YYYY. If they didn't, it warns them and tells them to put it in correctly.

Does anyone have any experience with portable python? Does it work in the sense that its name wound imply? I have a Python script, with a Tkinter GUI, that I want to roll out to some of the nurses that work in my hospital. The computers they use are Windows XP and Windows 7. They all have access to a network "Nurse" folder. I was thinking I could install Portable Python in that network folder and place my script there. then just place a shortcut icon on their desktops. Then when they double click it, it will launch my python script.

Am I way off base with this? Any simpler ideas on how to deploy this to make it available on about 20 different computers? I'm way out of my depth on this but I've created something simple that I think will be immensely useful.

Unfortunately, I don't think that installing Portable Python to the network folder will be enough. Each Windows computer won't know what to do with a .py file unless it has associated that file extension with a Python executable. The admin-independent way of doing this would be to have each user log in to each computer, double click on the script, and then navigate to your Portable Python's python.exe. But it would be better to faster and easier to just install Python on all of those computers

Other users have had some experience with cx_freeze, with just lets you turn your Python code into an executable. This might actually be the easiest thing to do in your case unless you can get your IT department to install Python on all of your systems

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

dantheman650 posted:

I was actually just coming to this thread to say thank you to the posters several months ago who recommended this book. I slowly worked my way through it in my free time and finished it today. The exercises were supremely helpful and well-designed and I feel like I understand Python basics extremely well.

As a self-taught Python learner, where do I go next? I find that the readily available resources are either targeted toward beginners or experts. There isn't much I can find targeted toward intermediate learners. My goal is to become proficient enough at coding to make it a marketable skill.

I am enrolled an and currently taking one of the only Coursera Python courses, which is aimed at complete beginners and quite boring. The others I could find are either significantly above my level or also for complete beginners.

I'm a big fan of Peter Norvig's course on Udacity and I think it's just right for your level: https://www.udacity.com/course/cs212

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

dantheman650 posted:

I was actually just coming to this thread to say thank you to the posters several months ago who recommended this book. I slowly worked my way through it in my free time and finished it today. The exercises were supremely helpful and well-designed and I feel like I understand Python basics extremely well.

As a self-taught Python learner, where do I go next? I find that the readily available resources are either targeted toward beginners or experts. There isn't much I can find targeted toward intermediate learners. My goal is to become proficient enough at coding to make it a marketable skill.

I am enrolled an and currently taking one of the only Coursera Python courses, which is aimed at complete beginners and quite boring. The others I could find are either significantly above my level or also for complete beginners.

Think of a project and build it with the help of Google, this thread, stack overflow, etc.

Something like a script to organize your download folder, or fetch your favorite stock price and insert it into a spreadsheet, or...

Hughmoris
Apr 21, 2007
Let's go to the abyss!

QuarkJets posted:

Unfortunately, I don't think that installing Portable Python to the network folder will be enough. Each Windows computer won't know what to do with a .py file unless it has associated that file extension with a Python executable. The admin-independent way of doing this would be to have each user log in to each computer, double click on the script, and then navigate to your Portable Python's python.exe. But it would be better to faster and easier to just install Python on all of those computers

Other users have had some experience with cx_freeze, with just lets you turn your Python code into an executable. This might actually be the easiest thing to do in your case unless you can get your IT department to install Python on all of your systems

Thanks for the ideas. I tried to look at py2exe last night but got pretty confused. I'm wondering how the conversion to exe will work since I'm using quite a few of additional modules such as Tkinter and pyPdf.

I'll see if I can figure out cx_freeze this evening.

Dominoes
Sep 20, 2007

You've stumbled across one of Python's biggest weaknesses. Let me know if you run into trouble configuring cx_freeze.

Another approach is making a webapp using Flask or Django.

Harriet Carker
Jun 2, 2009

Symbolic Butt posted:

I'm a big fan of Peter Norvig's course on Udacity and I think it's just right for your level: https://www.udacity.com/course/cs212

Thanks for this! I like the Udacity layout better than Coursera and I enjoy the ability to study at my own pace. The first lesson is making a poker program, which, coincidentally, is one of the last exercises in Think Python, so that seems like a good sign this will be appropriate for my level. I'll give it a go.

Thermopyle posted:

Think of a project and build it with the help of Google, this thread, stack overflow, etc.

Something like a script to organize your download folder, or fetch your favorite stock price and insert it into a spreadsheet, or...

This is what I was trying to do but I couldn't think of any great ideas. I tend to learn better when there's a directed goal someone else creates for me, but after I finish this course it seems like working on my own projects will be the best way to get better. Thanks!

Adbot
ADBOT LOVES YOU

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Dominoes posted:

You've stumbled across one of Python's biggest weaknesses. Let me know if you run into trouble configuring cx_freeze.

Another approach is making a webapp using Flask or Django.

I've thought about making a webapp but when I looked at Django, I was 100% lost. I don't think I have a decent enough grasp on Python yet to delve into Django. I might take you up on your offer with cx_freeze though. Going to try and get some time to dive into it.

  • Locked thread